Module: Runbook::Generators::Base::ClassMethods

Defined in:
lib/runbook/generators/base.rb

Instance Method Summary collapse

Instance Method Details

#commandObject



22
23
24
# File 'lib/runbook/generators/base.rb', line 22

def command
  self.to_s.gsub("Runbook::Generators::", "").underscore
end

#descriptionObject



32
33
34
# File 'lib/runbook/generators/base.rb', line 32

def description
  "Generate a #{command}"
end

#long_descriptionObject



36
37
38
# File 'lib/runbook/generators/base.rb', line 36

def long_description
  description
end

#optionsObject



40
41
42
# File 'lib/runbook/generators/base.rb', line 40

def options
  {}
end

#usageObject



26
27
28
29
30
# File 'lib/runbook/generators/base.rb', line 26

def usage
  args = arguments.map(&:banner).join(" ")
  args += " " unless args.empty?
  "#{command} #{args}[options]"
end