Skip to content

Instantly share code, notes, and snippets.

@kuruma-gs
Created August 23, 2011 07:27
Show Gist options
  • Save kuruma-gs/1164562 to your computer and use it in GitHub Desktop.
Save kuruma-gs/1164562 to your computer and use it in GitHub Desktop.
config/initializers/version.rb
require 'shell'
class VERSION
sh = Shell.cd(Rails.root)
@@i=sh.system('hg','identify','-i').to_s.gsub("\n","")
@@n=sh.system('hg','identify','-n').to_s.gsub("\n","")
@@b=sh.system('hg','identify','-b').to_s.gsub("\n","")
cattr_reader :i,:n,:b
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment