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
34 35 36 37 38 39 |
# File 'lib/compliance_engine/cli.rb', line 34 def dump require 'yaml' data.files.each do |file| puts({ file => data.get(file) }.to_yaml) end end |
#hiera ⇒ Object
21 22 23 24 |
# File 'lib/compliance_engine/cli.rb', line 21 def hiera require 'yaml' puts data.hiera([:profile]).to_yaml end |
#inspect ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/compliance_engine/cli.rb', line 48 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
28 29 30 31 |
# File 'lib/compliance_engine/cli.rb', line 28 def lookup(key) require 'yaml' puts data.hiera([:profile]).select { |k, _| k == key }.to_yaml end |
#profiles ⇒ Object
42 43 44 45 |
# File 'lib/compliance_engine/cli.rb', line 42 def profiles require 'yaml' puts data.profiles.select { |_, value| value.ces&.count&.positive? || value.controls&.count&.positive? }.keys.to_yaml end |
#version ⇒ Object
15 16 17 |
# File 'lib/compliance_engine/cli.rb', line 15 def version puts ComplianceEngine::VERSION end |