Class: Abide::CLI::PuppetScoreModuleCommand
- Inherits:
-
AbideCommand
- Object
- CmdParse::Command
- AbideCommand
- Abide::CLI::PuppetScoreModuleCommand
- Defined in:
- lib/abide_dev_utils/cli/puppet.rb
Constant Summary collapse
- CMD_NAME =
'score'
- CMD_SHORT =
'Scores a Puppet module just like Puppet Forge'
- CMD_LONG =
'Scores a Puppet module just like Puppet Forge. This is a useful quality-check before publishing a module.'
Constants included from AbideDevUtils::Config
AbideDevUtils::Config::DEFAULT_PATH
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ PuppetScoreModuleCommand
constructor
A new instance of PuppetScoreModuleCommand.
Methods inherited from AbideCommand
Methods included from AbideDevUtils::Config
config_section, #config_section, fetch, #fetch, to_h, #to_h
Constructor Details
#initialize ⇒ PuppetScoreModuleCommand
Returns a new instance of PuppetScoreModuleCommand.
225 226 227 228 229 230 231 |
# File 'lib/abide_dev_utils/cli/puppet.rb', line 225 def initialize super(CMD_NAME, CMD_SHORT, CMD_LONG, takes_commands: false) .on('-o [PATH]', '--outfile [PATH]', 'Save results to a file') { |x| @data[:outfile] = x } .on('-q', '--quiet', FalseClass, 'Do not print results to console') { |x| @data[:quiet] = x } .on('-c', '--checks', Array, 'Comma-separated list of individual checks to run. Defaults to running all checks.') { |x| @data[:check] = x } .on('-m [PATH]', '--module [PATH]', 'Path to a Puppet module to score. Defaults to using the current directory.') { |x| @data[:module] = x } end |
Instance Method Details
#execute ⇒ Object
233 234 235 236 |
# File 'lib/abide_dev_utils/cli/puppet.rb', line 233 def execute module_path = @data.fetch(:module, nil) AbideDevUtils::Ppt.score_module(module_path, **@data) end |