Class: Guard::Ronn::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/ronn/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Runner

Returns a new instance of Runner.



7
8
9
10
# File 'lib/guard/ronn/runner.rb', line 7

def initialize(options = {})
  @options  = options
  @notifier = Notifier.new
end

Instance Attribute Details

#notifierObject (readonly)

Returns the value of attribute notifier.



5
6
7
# File 'lib/guard/ronn/runner.rb', line 5

def notifier
  @notifier
end

Instance Method Details

#run(paths, options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/guard/ronn/runner.rb', line 12

def run(paths, options = {})
  return false if paths.empty?

  options = @options.merge(options)
  message = options[:message] || "Running: #{paths.join(' ')}"

  Compat::UI.info(message, reset: true)

  result = system(ronn_command(paths, options))

  @notifier.notify(result)
end