Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to define Rails app's version number [closed]

Is there any convention about how/where to specify application's version number?

For example, for the ruby gems lib/mygem/version.rb is the file generally used for that purpose.

My guess would be creating config/version.rb file like that:

module MySite
  VERSION = "0.0.4"

  # or in MySite::Application class
  # 
  # class Application
  #   VERSION = "0.0.4"
  # end
end
like image 708
Oguz Bilgic Avatar asked Jun 26 '12 01:06

Oguz Bilgic


People also ask

How do I know which version of Rails app I have?

Use the command: rake about . This command will output the following info plus more (hence the ellipsis: About your application's environment Rails version 4.2. 0 Ruby version 2.2.


1 Answers

I will reply my own question, I was not able to find a better answer.

Since Rails application is basically MySite::Application I thought app's version should be accessed by MySite::Application::VERSION so create :

config/initializers/version.rb

module MySite
  class Application
    VERSION = "0.0.4"
  end
end

or config/version.rb and require this file from config/application.rb

like image 175
Oguz Bilgic Avatar answered Oct 26 '22 17:10

Oguz Bilgic