Class: Rubysmith::Extensions::Rubocop
- Inherits:
-
Object
- Object
- Rubysmith::Extensions::Rubocop
- Defined in:
- lib/rubysmith/extensions/rubocop.rb
Overview
Ensures project skeleton adheres to style guide.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(configuration, client: ::RuboCop::CLI.new) ⇒ Rubocop
constructor
A new instance of Rubocop.
Constructor Details
#initialize(configuration, client: ::RuboCop::CLI.new) ⇒ Rubocop
Returns a new instance of Rubocop.
16 17 18 19 |
# File 'lib/rubysmith/extensions/rubocop.rb', line 16 def initialize configuration, client: ::RuboCop::CLI.new @configuration = configuration @client = client end |
Class Method Details
.call ⇒ Object
14 |
# File 'lib/rubysmith/extensions/rubocop.rb', line 14 def self.call(...) = new(...).call |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/rubysmith/extensions/rubocop.rb', line 21 def call project_root = configuration.project_root project_root.change_dir do STDOUT.squelch { client.run ["--autocorrect-all", project_root.to_s] } end configuration end |