Class: HammerCLIForeman::CommandExtensions::Status

Inherits:
HammerCLI::CommandExtensions
  • Object
show all
Defined in:
lib/hammer_cli_foreman/command_extensions/status.rb

Class Method Summary collapse

Class Method Details

.normalize_failed_features(features) ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/hammer_cli_foreman/command_extensions/status.rb', line 32

def self.normalize_failed_features(features)
  failed_features = []
  features.each_pair do |name, error|
    failed_features << {
      name: name,
      error: error
    }
  end
  failed_features
end

.normalize_features(features) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/hammer_cli_foreman/command_extensions/status.rb', line 21

def self.normalize_features(features)
  active_features = []
  features.each_pair do |name, version|
    active_features << {
      name: name,
      version: version
    }
  end
  active_features
end

.normalize_plugins(plugins) ⇒ Object



14
15
16
17
18
19
# File 'lib/hammer_cli_foreman/command_extensions/status.rb', line 14

def self.normalize_plugins(plugins)
  plugins.map! do |plugin|
    name, version = plugin.split(': ', 2)[1].split(', ', 3)[0..1]
    { name: name, version: version }
  end
end