On 22 Apr 2010, at 20:02, Rob Biedenharn wrote:
>> p = `cd #{RAILS_ROOT} && git rev-parse HEAD`.strip
=> "031154343573f846dc4f9d31806e58438bfe783e"
>> q = `cd #{RAILS_ROOT} && git show-ref`.strip
=> "031154343573f846dc4f9d31806e58438bfe783e refs/heads/master"
Would be best if you store the result in a constant at startup, so
the IO operation isn't called on every page.
Hope this helps.
Best regards
Peter De Berdt
You can always use the contents of the REVISION file that cap puts
in your Rails.root directory
File.read(File.expand_path('REVISION', RAILS_ROOT))
Ah indeed, totally forgot about that one.
Best regards
Peter De Berdt
--
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.