Skip to content

Instantly share code, notes, and snippets.

@edooley
Last active December 15, 2015 12:29
Show Gist options
  • Save edooley/5260850 to your computer and use it in GitHub Desktop.
Save edooley/5260850 to your computer and use it in GitHub Desktop.
My approach to Rails app versioning. Keep up with your VCS tags and forget about the rest! (git shown here)
# Only attempt update on local machine
if Rails.env.development?
# Update version file from latest git tag
File.open('config/version', 'w') do |file|
file.write `git describe --tags --always` # or equivalent
end
end
config.version = File.read('config/version')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment