# File lib/foreman_maintain/cli/base.rb, line 60 def self.interactive_option option ['-y', '--assumeyes'], :flag, 'Automatically answer yes for all questions' end
# File lib/foreman_maintain/cli/base.rb, line 42 def self.label_option option '--label', 'label', 'Limit only for a specific label. ' '(Use "list" command to see available labels)' do |label| raise ArgumentError, 'value not specified' if label.nil? || label.empty? underscorize(label).to_sym end end
# File lib/foreman_maintain/cli/base.rb, line 32 def available_checks filter = {} filter[:tags] = tags if respond_to?(:tags) ForemanMaintain.available_checks(filter) end
# File lib/foreman_maintain/cli/base.rb, line 6 def dashize(string) string.to_s.tr('_', '-') end
# File lib/foreman_maintain/cli/base.rb, line 14 def label_string(string) HighLine.color("[#{dashize(string)}]", :yellow) end
# File lib/foreman_maintain/cli/base.rb, line 22 def reporter @reporter ||= ForemanMaintain::Reporter::CLIReporter.new(STDOUT, STDIN, :assumeyes => assumeyes?) end
# File lib/foreman_maintain/cli/base.rb, line 28 def run_scenario(scenario) ForemanMaintain::Runner.new(reporter, scenario, :assumeyes => assumeyes?).run end
# File lib/foreman_maintain/cli/base.rb, line 18 def tag_string(string) HighLine.color("[#{dashize(string)}]", :cyan) end
# File lib/foreman_maintain/cli/base.rb, line 10 def underscorize(string) string.to_s.tr('-', '_') end