Module: Cane::CLI
- Defined in:
- lib/cane/cli.rb,
lib/cane/cli/parser.rb,
lib/cane/cli/options.rb
Defined Under Namespace
Classes: Parser
Class Method Summary collapse
Class Method Details
.default_options ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/cane/cli/options.rb', line 17 def { max_violations: 0, exclusions_file: nil, checks: Cane.default_checks }.merge(Cane.default_checks.inject({}) {|a, check| a.merge(defaults(check)) }) end |
.defaults(check) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/cane/cli/options.rb', line 5 def defaults(check) check..each_with_object({}) {|(k, v), h| option_opts = v[1] || {} if option_opts[:type] == Array h[k] = [] else h[k] = option_opts[:default] end } end |