Class: Qspec::Helper

Inherits:
Object
  • Object
show all
Includes:
SporkHelper
Defined in:
lib/qspec/helper.rb

Instance Method Summary collapse

Methods included from SporkHelper

#connect_spork, #create_port_file, #remove_port_file, #runnning_ports, #start_spork_workers

Constructor Details

#initialize(argv) ⇒ Helper

Returns a new instance of Helper.



5
6
7
# File 'lib/qspec/helper.rb', line 5

def initialize(argv)
  @argv   = argv
end

Instance Method Details

#serveObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/qspec/helper.rb', line 9

def serve
  case @argv.last
  when 'init'
    puts "Creating template"
    Config.create_template
  when 'spork'
    @config = Config.new
    puts "Start #{@config['workers']} sporks"
    start_spork_workers(@config['workers'])
  end
end