Class: CodeHunter::OptionParser

Inherits:
OptionParser
  • Object
show all
Defined in:
lib/code_hunter/option_parser.rb

Defined Under Namespace

Classes: Argument

Constant Summary collapse

OPTIONS =
[
  "--application-path=",       "(default:    ./) rails application root path",
  "--format=",                 "(default:  yaml) output format (yaml or json)",
  "--no-brakeman",             "(default: false) disable brakeman",
  "--no-pendaxes",             "(default: false) disable pendaxes",
  "--no-rails-best-practices", "(default: false) disable rails-best-practices",
]

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOptionParser

Returns a new instance of OptionParser.



21
22
23
24
# File 'lib/code_hunter/option_parser.rb', line 21

def initialize(*)
  super
  configure_options
end

Class Method Details

.helpObject



17
18
19
# File 'lib/code_hunter/option_parser.rb', line 17

def self.help
  new.help
end

.parse!(argv) ⇒ Object



13
14
15
# File 'lib/code_hunter/option_parser.rb', line 13

def self.parse!(argv)
  new.parse!(argv)
end

Instance Method Details

#optionsObject



31
32
33
# File 'lib/code_hunter/option_parser.rb', line 31

def options
  @options ||= { :application_path => "./" }
end

#parse!Object



26
27
28
29
# File 'lib/code_hunter/option_parser.rb', line 26

def parse!(*)
  super
  options
end