Michael Schuerig wrote:
> Capistrano already writes a REVISION file containing the commit sha1.
> Let's assume there's a TAG file, too. Then an initializer like this
> would do the job
> 
> if Rails.env.production?
>   version = File.read('TAG').strip
> else
>   version = `git describe --tags --always --dirty`.chomp
> end
> Rails.application.config.version = version

That achieves precisely what I was saying, except uses 'TAG' instead of
'VERSION'. The version is simple to locate, and can be used anywhere it
is needed.
-- 
Posted via http://www.ruby-forum.com/.

-- 
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.

Reply via email to