Module: OpenstudioStandards
- Defined in:
- lib/openstudio-standards.rb,
lib/openstudio-standards/version.rb
Constant Summary collapse
- VERSION =
'0.2.2'.freeze
Class Method Summary collapse
Class Method Details
.git_revision ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/openstudio-standards/version.rb', line 2 def self.git_revision cmd = 'git' exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| exts.each do |ext| exe = "#{path}/#{cmd}#{ext}" if File.executable?(exe) revision = `#{exe} -C #{__dir__} rev-parse --short HEAD` return revision.strip! end end end return 'git-not-found-on-this-system' end |