Class: Guard::Spin::Runner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Runner

Returns a new instance of Runner.



11
12
13
14
# File 'lib/guard/spin/runner.rb', line 11

def initialize(options = {})
  @options = {:run_all => true}.merge(options)
  UI.info "Guard::Spin Initialized"
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/guard/spin/runner.rb', line 9

def options
  @options
end

Instance Method Details

#kill_spinObject



21
22
23
# File 'lib/guard/spin/runner.rb', line 21

def kill_spin
  stop_spin
end

#launch_spin(action) ⇒ Object



16
17
18
19
# File 'lib/guard/spin/runner.rb', line 16

def launch_spin(action)
  UI.info "#{action}ing Spin", :reset => true
  spawn_spin spin_serve_command, spin_serve_options
end

#run(paths) ⇒ Object



25
26
27
# File 'lib/guard/spin/runner.rb', line 25

def run(paths)
  run_command spin_push_command(paths), spin_push_options
end

#run_allObject



29
30
31
32
33
34
35
36
# File 'lib/guard/spin/runner.rb', line 29

def run_all
  return unless options[:run_all]
  if rspec?
    run(['spec'])
  elsif test_unit?
    run(Dir['test/**/*_test.rb']+Dir['test/**/test_*.rb'])
  end
end