Created
          May 5, 2009 19:55 
        
      - 
      
- 
        Save jpemberthy/107158 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #Add this line at the end of your environment.rb file | |
| ENV['RAILS_ASSET_ID'] = `git log -1 --pretty=format:"%h"` | |
| #Now ENV['RAILS_ASSET_ID'] has the last commit number and can be used to cache your contents | |
| #In my case Unity3D objects | |
| <script type="text/javascript"> | |
| var asset_id = <%= ENV['RAILS_ASSET_ID'].to_json %> | |
| var uniObj = new UnityObject('/unity3d/WebTesis.unity3d' + '?' + asset_id, "Unity3D", "600", "450"); | |
| </script> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment