Class: ComplianceEngine::CLI
- Inherits:
-
Thor
- Object
- Thor
- ComplianceEngine::CLI
- Defined in:
- lib/compliance_engine/cli.rb
Overview
Compliance Engine CLI
Instance Method Summary collapse
- #dump ⇒ Object
- #hiera ⇒ Object
- #inspect ⇒ Object
- #lookup(key) ⇒ Object
- #profiles ⇒ Object
- #version ⇒ Object
Instance Method Details
#dump ⇒ Object
36 37 38 39 40 41 |
# File 'lib/compliance_engine/cli.rb', line 36 def dump require 'yaml' data.files.each do |file| puts({ file => data.get(file) }.to_yaml) end end |
#hiera ⇒ Object
23 24 25 26 |
# File 'lib/compliance_engine/cli.rb', line 23 def hiera require 'yaml' puts data.hiera([:profile]).to_yaml end |
#inspect ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/compliance_engine/cli.rb', line 50 def inspect # Run the CLI with `data` as the object containing the compliance data. require 'irb' # rubocop:disable Lint/Debugger binding.irb # rubocop:enable Lint/Debugger end |
#lookup(key) ⇒ Object
30 31 32 33 |
# File 'lib/compliance_engine/cli.rb', line 30 def lookup(key) require 'yaml' puts data.hiera([:profile]).select { |k, _| k == key }.to_yaml end |
#profiles ⇒ Object
44 45 46 47 |
# File 'lib/compliance_engine/cli.rb', line 44 def profiles require 'yaml' puts data.profiles.select { |_, value| value.ces&.count&.positive? || value.controls&.count&.positive? }.keys.to_yaml end |
#version ⇒ Object
17 18 19 |
# File 'lib/compliance_engine/cli.rb', line 17 def version puts ComplianceEngine::VERSION end |