# 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