lib/guard/reek/runner.rb in guard-reek-1.0.2 vs lib/guard/reek/runner.rb in guard-reek-1.1.0
- old
+ new
@@ -1,30 +1,34 @@
# coding: utf-8
module Guard
class Reek
- # This class runs `rubocop` command, retrieves result and notifies.
- # An instance of this class is intended to invoke `rubocop` only once in its lifetime.
+ # This class runs `reek` command, retrieves result and notifies.
+ # An instance of this class is intended to invoke `reek` only once in its lifetime.
class Runner
attr_reader :notifier, :ui, :result
def initialize(options)
- @options = options
+ @cli = options[:cli]
@notifier = options[:notifier] || Notifier
@ui = options[:ui] || UI
end
def run(paths = [])
paths = [] if paths.include?('.reek')
ui_message(paths)
- command = ['reek'].concat(paths)
- @result = system(*command)
+ command = reek_cmd.concat(paths)
+ @result = Kernel.system(*command)
notify_about_result
end
private
+
+ def reek_cmd
+ ['reek', @cli].compact
+ end
def ui_message(paths)
if paths.empty?
ui.info('Guard::Reek running on all')
else