Class: Guard::Reek::Runner
- Inherits:
-
Object
- Object
- Guard::Reek::Runner
- Defined in:
- lib/guard/reek/runner.rb
Overview
This class runs ‘rubocop` command, retrieves result and notifies. An instance of this class is intended to invoke `rubocop` only once in its lifetime.
Instance Attribute Summary collapse
-
#notifier ⇒ Object
readonly
Returns the value of attribute notifier.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#ui ⇒ Object
readonly
Returns the value of attribute ui.
Instance Method Summary collapse
-
#initialize(options) ⇒ Runner
constructor
A new instance of Runner.
- #run(paths = []) ⇒ Object
Constructor Details
#initialize(options) ⇒ Runner
Returns a new instance of Runner.
10 11 12 13 14 |
# File 'lib/guard/reek/runner.rb', line 10 def initialize() @options = @notifier = [:notifier] || Notifier @ui = [:ui] || UI end |
Instance Attribute Details
#notifier ⇒ Object (readonly)
Returns the value of attribute notifier.
8 9 10 |
# File 'lib/guard/reek/runner.rb', line 8 def notifier @notifier end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
8 9 10 |
# File 'lib/guard/reek/runner.rb', line 8 def result @result end |
#ui ⇒ Object (readonly)
Returns the value of attribute ui.
8 9 10 |
# File 'lib/guard/reek/runner.rb', line 8 def ui @ui end |
Instance Method Details
#run(paths = []) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/guard/reek/runner.rb', line 16 def run(paths = []) paths = [] if paths.include?('.reek') (paths) command = ['reek'].concat(paths) @result = system(*command) notify_about_result end |