Module: Hglib::VersionInfo
Overview
Version information methods for Repos and the top-level module.
Instance Method Summary collapse
-
#extension_enabled?(name) ⇒ Boolean
Returns
true
if the extension with the givenname
is enabled in the current (global) configuration. -
#extension_versions ⇒ Object
Fetch the version of the Mercurial extensions that’re being used as a Hash.
-
#version ⇒ Object
Fetch the version of Mercurial that’s being used as a String.
-
#versions ⇒ Object
Fetch a Hash of version information about the Mercurial that is being used.
Instance Method Details
#extension_enabled?(name) ⇒ Boolean
Returns true
if the extension with the given name
is enabled in the current (global) configuration.
35 36 37 |
# File 'lib/hglib/version_info.rb', line 35 def extension_enabled?( name ) return self.extension_versions.key?( name.to_sym ) end |
#extension_versions ⇒ Object
Fetch the version of the Mercurial extensions that’re being used as a Hash.
24 25 26 27 28 29 30 |
# File 'lib/hglib/version_info.rb', line 24 def extension_versions ext_info = self.versions[ :extensions ] return ext_info.each_with_object({}) do |ext, hash| ext = ext.dup hash[ ext.delete(:name).to_sym ] = ext end end |
#version ⇒ Object
Fetch the version of Mercurial that’s being used as a String.
18 19 20 |
# File 'lib/hglib/version_info.rb', line 18 def version return self.versions[ :ver ] end |
#versions ⇒ Object
Fetch a Hash of version information about the Mercurial that is being used.
11 12 13 14 |
# File 'lib/hglib/version_info.rb', line 11 def versions response = self.server.run_with_json_template( :version ) return response.first end |