Module: PDK::Util::Version
- Defined in:
- lib/pdk/util/version.rb
Class Method Summary collapse
Class Method Details
.git_ref ⇒ Object
27 28 29 30 31 |
# File 'lib/pdk/util/version.rb', line 27 def self.git_ref ref_result = PDK::CLI::Exec.git('--git-dir', File.join(File.('../../..', File.dirname(__FILE__)), '.git'), 'describe', '--all', '--long') ref_result[:stdout].strip if ref_result[:exit_code].zero? end |
.pdk_ref ⇒ Object
11 12 13 14 |
# File 'lib/pdk/util/version.rb', line 11 def self.pdk_ref ref = "#{pkg_sha} #{git_ref}".strip ref.empty? ? nil : "(#{ref})" end |
.pkg_sha ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pdk/util/version.rb', line 16 def self.pkg_sha version_file = File.join(File.('../../..', File.dirname(__FILE__)), 'VERSION') if File.exist? version_file ver = File.read(version_file) sha = ver.strip.split('.')[-1] unless ver.nil? end sha end |