Class: Hiera::Backend::Eyaml::Subcommands::Version

Inherits:
Hiera::Backend::Eyaml::Subcommand show all
Defined in:
lib/hiera/backend/eyaml/subcommands/version.rb

Class Method Summary collapse

Methods inherited from Hiera::Backend::Eyaml::Subcommand

all_options, attach_option, find, hidden?, load_config_file, parse, prettyname, validate

Class Method Details

.descriptionObject



15
16
17
# File 'lib/hiera/backend/eyaml/subcommands/version.rb', line 15

def self.description
  "show version information"
end

.executeObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/hiera/backend/eyaml/subcommands/version.rb', line 19

def self.execute
  plugin_versions = {}

  Eyaml::LoggingHelper.info "hiera-eyaml (core): #{Eyaml::VERSION}"

  Plugins.plugins.each do |plugin|
    plugin_shortname = plugin.name.split("hiera-eyaml-").last
    plugin_version = begin
      Encryptor.find(plugin_shortname)::VERSION.to_s
    rescue
      "unknown (is plugin compatible with eyaml 2.0+ ?)"
    end
    Eyaml::LoggingHelper.info "hiera-eyaml-#{plugin_shortname} (gem): #{plugin_version}"
  end

  nil
  
end

.optionsObject



11
12
13
# File 'lib/hiera/backend/eyaml/subcommands/version.rb', line 11

def self.options
  []
end