Sha256: 0ce4237d96012000cb9e0b330fe5484aae58d9cd8e8042848a9d2f8aa226a394
Contents?: true
Size: 1.54 KB
Versions: 1
Compression:
Stored size: 1.54 KB
Contents
module QB # Constants # ===================================================================== GEM_NAME = 'qb' VERSION = "0.3.10" MIN_ANSIBLE_VERSION = Gem::Version.new '2.1.2' # Class Methods # ===================================================================== def self.gemspec Gem.loaded_specs[GEM_NAME] end # Get the {Gem::Version} parse of {QB::VERSION}. # # @return [Gem::Version] # def self.gem_version Gem::Version.new VERSION end # @return [Gem::Version] # the Ansible executable version parsed into a Gem version so we can # compare it. # def self.ansible_version out = Cmds.out! 'ansible --version' version_str = out[/ansible\ ([\d\.]+)/, 1] if version_str.nil? raise NRSER.dedent <<-END could not parse ansible version from `ansible --version` output: #{ out } END end Gem::Version.new version_str end # .ansible_version # Check that the Ansible version is not less than {QB::MIN_ANSIBLE_VERSION}. # # @raise [QB::AnsibleVersionError] # If the version of Ansible found is less than {QB::MIN_ANSIBLE_VERSION}. # def self.check_ansible_version if ansible_version < QB::MIN_ANSIBLE_VERSION raise QB::AnsibleVersionError, NRSER.squish( <<-END QB #{ QB::VERSION } requires Ansible #{ QB::MIN_ANSIBLE_VERSION }, found version #{ version_str } at #{ `which ansible` } END ) end end # .check_ansible_version end # module QB
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
qb-0.3.10 | lib/qb/version.rb |