Class: Ruboclean::Runner
- Inherits:
-
Object
- Object
- Ruboclean::Runner
- Defined in:
- lib/ruboclean/runner.rb
Overview
Entry point for processing
Instance Method Summary collapse
- #changed?(target_yaml) ⇒ Boolean
-
#initialize(args = []) ⇒ Runner
constructor
A new instance of Runner.
- #path ⇒ Object
- #run! ⇒ Object
- #verbose? ⇒ Boolean
- #verify? ⇒ Boolean
Constructor Details
#initialize(args = []) ⇒ Runner
Returns a new instance of Runner.
9 10 11 |
# File 'lib/ruboclean/runner.rb', line 9 def initialize(args = []) @cli_arguments = CliArguments.new(args) end |
Instance Method Details
#changed?(target_yaml) ⇒ Boolean
23 24 25 |
# File 'lib/ruboclean/runner.rb', line 23 def changed?(target_yaml) target_yaml != source_yaml end |
#path ⇒ Object
35 36 37 |
# File 'lib/ruboclean/runner.rb', line 35 def path cli_arguments.path end |
#run! ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/ruboclean/runner.rb', line 13 def run! return if source_file_pathname.empty? load_file.then(&method(:order)) .then(&method(:cleanup_paths)) .then(&method(:convert_to_yaml)) .then(&method(:write_file!)) .then(&method(:changed?)) end |
#verbose? ⇒ Boolean
27 28 29 |
# File 'lib/ruboclean/runner.rb', line 27 def verbose? cli_arguments.verbose? end |
#verify? ⇒ Boolean
31 32 33 |
# File 'lib/ruboclean/runner.rb', line 31 def verify? cli_arguments.verify? end |