Skip to content

Instantly share code, notes, and snippets.

@wmoxam
Forked from defunkt/production.rb
Created April 29, 2009 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wmoxam/104049 to your computer and use it in GitHub Desktop.
Save wmoxam/104049 to your computer and use it in GitHub Desktop.
# version 2.0 of http://ozmm.org/posts/easy_rails_asset_ids_with_git.html
repo = Grit::Repo.new('/path/to/your/app/shared/cached-copy')
js = repo.log('deploy', 'public/javascripts', :max_count => 1).first
css = repo.log('deploy', 'public/stylesheets', :max_count => 1).first
ENV['RAILS_ASSET_ID'] = js.committed_date > css.committed_date ? js.id : css.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment