document.write('<link rel="stylesheet" href="http://gist.github.com/stylesheets/gist/embed.css"/>')





document.write('<div id=\"gist-107158\" class=\"gist\">\n  \n  \n    \n            \n\n      <div class=\"gist-file\">\n        <div class=\"gist-data gist-syntax\">\n          \n          \n          \n            <div class=\"gist-highlight\"><pre><div class=\"line\" id=\"LC1\"><span class=\"c1\">#Add this line at the end of your environment.rb file<\/span><\/div><div class=\"line\" id=\"LC2\"><span class=\"no\">ENV<\/span><span class=\"o\">[<\/span><span class=\"s1\">&#39;RAILS_ASSET_ID&#39;<\/span><span class=\"o\">]<\/span> <span class=\"o\">=<\/span> <span class=\"sb\">`git log -1 --pretty=format:&quot;%h&quot;`<\/span><\/div><div class=\"line\" id=\"LC3\">&nbsp;<\/div><div class=\"line\" id=\"LC4\">&nbsp;<\/div><div class=\"line\" id=\"LC5\"><span class=\"c1\">#Now ENV[&#39;RAILS_ASSET_ID&#39;] has the last commit number and can be used to cache your contents<\/span><\/div><div class=\"line\" id=\"LC6\"><span class=\"c1\">#In my case Unity3D objects<\/span><\/div><div class=\"line\" id=\"LC7\"><span class=\"o\">&lt;<\/span><span class=\"n\">script<\/span> <span class=\"nb\">type<\/span><span class=\"o\">=<\/span><span class=\"s2\">&quot;text/javascript&quot;<\/span><span class=\"o\">&gt;<\/span><\/div><div class=\"line\" id=\"LC8\">&nbsp;&nbsp;<span class=\"n\">var<\/span> <span class=\"n\">asset_id<\/span> <span class=\"o\">=<\/span> <span class=\"o\">&lt;<\/span><span class=\"sx\">%= ENV[&#39;RAILS_ASSET_ID&#39;].to_json %&gt;<\/span><\/div><div class=\"line\" id=\"LC9\"><span class=\"sx\">  var uniObj =<\/span> <span class=\"kp\">new<\/span> <span class=\"no\">UnityObject<\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;/unity3d/WebTesis.unity3d&#39;<\/span> <span class=\"o\">+<\/span> <span class=\"s1\">&#39;?&#39;<\/span> <span class=\"o\">+<\/span> <span class=\"n\">asset_id<\/span><span class=\"p\">,<\/span> <span class=\"s2\">&quot;Unity3D&quot;<\/span><span class=\"p\">,<\/span> <span class=\"s2\">&quot;600&quot;<\/span><span class=\"p\">,<\/span> <span class=\"s2\">&quot;450&quot;<\/span><span class=\"p\">);<\/span><\/div><div class=\"line\" id=\"LC10\"><span class=\"o\">&lt;<\/span><span class=\"sr\">/script&gt;<\/span><\/div><\/pre><\/div>\n          \n        <\/div>\n\n        <div class=\"gist-meta\">\n          <a href=\"http://gist.github.com/raw/107158/9b42544f66918086aec2b8bb615ce33a29f1d49d/gistfile1.rb\" style=\"float:right;\">view raw<\/a>\n          <a href=\"http://gist.github.com/107158#file_gistfile1.rb\" style=\"float:right;margin-right:10px;color:#666\">gistfile1.rb<\/a>\n          <a href=\"http://gist.github.com/107158\">This Gist<\/a> brought to you by <a href=\"http://github.com\">GitHub<\/a>.\n        <\/div>\n      <\/div>\n    \n  \n<\/div>\n')
