Class: Ruboclean::Runner
- Inherits:
-
Object
- Object
- Ruboclean::Runner
- Defined in:
- lib/ruboclean/runner.rb,
lib/ruboclean/runner/options.rb,
lib/ruboclean/runner/options/input.rb,
lib/ruboclean/runner/options/output.rb
Overview
Entry point for processing
Defined Under Namespace
Classes: Options
Instance Method Summary collapse
- #changed?(target_yaml) ⇒ Boolean
-
#initialize(command_line_arguments = []) ⇒ Runner
constructor
A new instance of Runner.
- #input_path ⇒ Object
- #run! ⇒ Object
- #verbose? ⇒ Boolean
- #verify? ⇒ Boolean
Constructor Details
#initialize(command_line_arguments = []) ⇒ Runner
Returns a new instance of Runner.
9 10 11 12 |
# File 'lib/ruboclean/runner.rb', line 9 def initialize(command_line_arguments = []) cli_arguments = CliArguments.new(command_line_arguments) @options = Runner::Options.new(cli_arguments: cli_arguments) end |
Instance Method Details
#changed?(target_yaml) ⇒ Boolean
24 25 26 |
# File 'lib/ruboclean/runner.rb', line 24 def changed?(target_yaml) target_yaml != source_yaml end |
#input_path ⇒ Object
36 37 38 |
# File 'lib/ruboclean/runner.rb', line 36 def input_path .input_path end |
#run! ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/ruboclean/runner.rb', line 14 def run! return if source_yaml.empty? parse_yaml.then(&method(:order)) .then(&method(:cleanup_paths)) .then(&method(:convert_to_yaml)) .then(&method(:write_stream!)) .then(&method(:changed?)) end |
#verbose? ⇒ Boolean
28 29 30 |
# File 'lib/ruboclean/runner.rb', line 28 def verbose? .verbose? end |
#verify? ⇒ Boolean
32 33 34 |
# File 'lib/ruboclean/runner.rb', line 32 def verify? .verify? end |