Module: Cane::CLI
- Defined in:
- lib/cane/cli.rb,
lib/cane/cli/parser.rb,
lib/cane/cli/options.rb
Overview
Default options for command line interface
Defined Under Namespace
Classes: Parser
Class Method Summary collapse
Class Method Details
.default_options ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/cane/cli/options.rb', line 18 def { max_violations: 0, parallel: false, exclusions_file: nil, checks: Cane.default_checks }.merge(Cane.default_checks.inject({}) {|a, check| a.merge(defaults(check)) }) end |
.defaults(check) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/cane/cli/options.rb', line 6 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 |