Module: Hglib::VersionInfo

Included in:
Hglib, Repo
Defined in:
lib/hglib/version_info.rb

Overview

Version information methods for Repos and the top-level module.

Instance Method Summary collapse

Instance Method Details

#extension_enabled?(name) ⇒ Boolean

Returns true if the extension with the given name is enabled in the current (global) configuration.

Returns:

  • (Boolean)


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_versionsObject

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

#versionObject

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

#versionsObject

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