Class: Guard::Reek::Runner
- Inherits:
-
Object
- Object
- Guard::Reek::Runner
- Defined in:
- lib/guard/reek/runner.rb
Overview
This class runs ‘reek` command, retrieves result and notifies. An instance of this class is intended to invoke `reek` only once in its lifetime.
Defined Under Namespace
Classes: Paths
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 15 |
# File 'lib/guard/reek/runner.rb', line 10 def initialize() @cli = [:cli] @all = [:all] || '*' @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
38 39 40 41 42 43 44 45 46 |
# File 'lib/guard/reek/runner.rb', line 38 def run(paths = []) result = run_reek_cmd(paths) if result notifier.notify('Reek Results', title: 'Passed', image: :success) else notifier.notify('Reek Results', title: 'Failed', image: :failed) end end |