Class: Guard::Spinoff::Runner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Runner

Returns a new instance of Runner.



12
13
14
15
16
17
# File 'lib/guard/spinoff/runner.rb', line 12

def initialize(options = {})
  Thread.abort_on_exception = true
  @options = options
  @config = init_config(@options)
  UI.info 'Guard::Spinoff Initialized'
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/guard/spinoff/runner.rb', line 10

def options
  @options
end

Instance Method Details

#killObject



24
25
26
# File 'lib/guard/spinoff/runner.rb', line 24

def kill
  @server.kill if @server
end

#launch(action) ⇒ Object



19
20
21
22
# File 'lib/guard/spinoff/runner.rb', line 19

def launch(action)
  UI.info "#{action}ing Spinoff", :reset => true
  start_server
end

#run(paths) ⇒ Object



28
29
30
# File 'lib/guard/spinoff/runner.rb', line 28

def run(paths)
  ::Spinoff::Client.start(Array(paths))
end

#run_allObject



32
33
34
35
36
37
38
# File 'lib/guard/spinoff/runner.rb', line 32

def run_all
  if rspec?
    run(options[:test_paths] || 'spec')
  elsif test_unit?
    run(options[:test_paths] || 'test')
  end
end