Where do you store your Rails Application's version number?

前端 未结 8 1739
终归单人心
终归单人心 2021-01-30 05:41

We use the wonderful semantic versioning paradigm when versioning our rails app. One question I had was where is it best to store this number? I\'ve seen it stored in /l

8条回答
  •  野的像风
    2021-01-30 06:11

    I don't really think there's any convention for this. I guess it's all about what seems natural to you.

    Some places the version number can be placed are in:

    • config/environment.rb
    • config/application.rb
    • config/initializers/version.rb

    by adding:

    VERSION = '1.0.0'
    

    Regardless of which option you choose (from above) - the VERSION constant will be set at the initialization of the app.

    For my blog I just update the footer of my layout - as the version number isn't used anywhere else.

    The lib-folder does sound a bit strange though, as this folder is meant to store re-usable modules.

提交回复
热议问题