Class: Abide::CLI::CemGenerateReference

Inherits:
AbideCommand
  • Object
show all
Defined in:
lib/abide_dev_utils/cli/cem.rb

Constant Summary collapse

CMD_NAME =
'reference'
CMD_SHORT =
'Generates a reference doc for the module'
CMD_LONG =
'Generates a reference doc for the module'

Constants included from AbideDevUtils::Config

AbideDevUtils::Config::DEFAULT_PATH

Instance Method Summary collapse

Methods included from AbideDevUtils::Config

config_section, #config_section, fetch, #fetch, to_h, #to_h

Constructor Details

#initializeCemGenerateReference

Returns a new instance of CemGenerateReference.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/abide_dev_utils/cli/cem.rb', line 99

def initialize
  super(CMD_NAME, CMD_SHORT, CMD_LONG, takes_commands: false)
  options.on('-o [FILE]', '--out-file [FILE]', 'Path to save the updated config file') do |o|
    @data[:out_file] = o
  end
  options.on('-f [FORMAT]', '--format [FORMAT]', 'Format to save reference as') do |f|
    @data[:format] = f
  end
  options.on('-v', '--verbose', 'Verbose output') do
    @data[:debug] = true
  end
  options.on('-q', '--quiet', 'Quiet output') do
    @data[:quiet] = true
  end
  options.on('-s', '--strict', 'Fails if there are any errors') do
    @data[:strict] = true
  end
  options.on('-p [PROFILE]', '--select-profile [PROFILE]', 'The list of profiles that the reference.md will use separated by commas') do |pr|
    @data[:select_profile] = pr.split(',')
  end
  options.on('-l [LEVEL]', '--select-level [LEVEL]', 'The list of level that the reference.md will use separated by commas') do |l|
    @data[:select_level] = l.split(',')
  end
end

Instance Method Details

#executeObject



124
125
126
127
# File 'lib/abide_dev_utils/cli/cem.rb', line 124

def execute
  AbideDevUtils::Validate.puppet_module_directory
  AbideDevUtils::CEM::Generate::Reference.generate(@data)
end