Class: Ruboclean::Runner::Options
- Inherits:
-
Object
- Object
- Ruboclean::Runner::Options
- Defined in:
- lib/ruboclean/runner/options.rb,
lib/ruboclean/runner/options/input.rb,
lib/ruboclean/runner/options/output.rb
Overview
Consolidates cli_arguments with “smart” defaults
Defined Under Namespace
Instance Method Summary collapse
-
#initialize(cli_arguments:) ⇒ Options
constructor
A new instance of Options.
- #input_path ⇒ Object
- #input_stream ⇒ Object
- #output_stream ⇒ Object
- #preserve_comments? ⇒ Boolean
- #preserve_paths? ⇒ Boolean
- #silent? ⇒ Boolean
- #verbose? ⇒ Boolean
- #verify? ⇒ Boolean
Constructor Details
#initialize(cli_arguments:) ⇒ Options
Returns a new instance of Options.
7 8 9 |
# File 'lib/ruboclean/runner/options.rb', line 7 def initialize(cli_arguments:) @cli_arguments = cli_arguments end |
Instance Method Details
#input_path ⇒ Object
15 16 17 |
# File 'lib/ruboclean/runner/options.rb', line 15 def input_path input.input_path end |
#input_stream ⇒ Object
11 12 13 |
# File 'lib/ruboclean/runner/options.rb', line 11 def input_stream input.stream end |
#output_stream ⇒ Object
19 20 21 |
# File 'lib/ruboclean/runner/options.rb', line 19 def output_stream output.stream end |
#preserve_comments? ⇒ Boolean
31 32 33 |
# File 'lib/ruboclean/runner/options.rb', line 31 def preserve_comments? cli_arguments.preserve_comments? end |
#preserve_paths? ⇒ Boolean
35 36 37 |
# File 'lib/ruboclean/runner/options.rb', line 35 def preserve_paths? cli_arguments.preserve_paths? end |
#silent? ⇒ Boolean
27 28 29 |
# File 'lib/ruboclean/runner/options.rb', line 27 def silent? cli_arguments.silent? || output.stdout? end |
#verbose? ⇒ Boolean
23 24 25 |
# File 'lib/ruboclean/runner/options.rb', line 23 def verbose? !silent? end |
#verify? ⇒ Boolean
39 40 41 |
# File 'lib/ruboclean/runner/options.rb', line 39 def verify? cli_arguments.verify? end |