spork 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,12 +10,13 @@
10
10
 
11
11
  Spork is Tim Harper's implementation of test server (similar to the script/spec_server provided by rspec-rails), except rather than using the Rails constant unloading to reload your files, it forks a copy of the server each time you run your tests. The result? Spork runs more solid: it doesn't get corrupted over time, and it properly handles modules and any voo-doo meta programming you may have put in your app.
12
12
 
13
- Because Spork uses Kernel.fork, it only works on POSIX systems. This means Windows users are not invited to this party. Sorry :(
13
+ Spork runs on POSIX systems using fork. It also runs on windows by pre-populating a pool of ready processes (referred to here as the "magazine" strategy).
14
14
 
15
15
  == Supported Testing Frameworks
16
16
 
17
17
  * Rspec
18
18
  * Cucumber
19
+ * Test::Unit (via 'gem install spork-testunit')
19
20
 
20
21
  And more to come! Vote for your favorite at http://github.com/timcharper/spork/issues
21
22
 
@@ -9,7 +9,7 @@ end
9
9
  inst = Gem::DependencyInstaller.new
10
10
  begin
11
11
  inst.install "rake"
12
- inst.install "win32-process", "~> 0.6.1" if RUBY_PLATFORM =~ /mswin|mingw/
12
+ inst.install "win32-process", "~> 0.6.1" if RUBY_PLATFORM =~ /mswin|mingw/ and RUBY_VERSION < '1.9.1'
13
13
  rescue
14
14
  exit(1)
15
15
  end
@@ -3,7 +3,7 @@
3
3
  # as they come in
4
4
  require 'drb'
5
5
  require 'rinda/ring'
6
- require 'win32/process' if RUBY_PLATFORM =~ /mswin|mingw/
6
+ require 'win32/process' if RUBY_PLATFORM =~ /mswin|mingw/ and RUBY_VERSION < '1.9.1'
7
7
 
8
8
  $:.unshift(File.dirname(__FILE__))
9
9
  require 'magazine/magazine_slave'
@@ -34,7 +34,7 @@ class Spork::RunStrategy::Magazine < Spork::RunStrategy
34
34
 
35
35
  def start_Rinda_ringserver
36
36
  app_name = 'ruby ring_server.rb'
37
- Process.create( :app_name => app_name, :cwd => @path ).process_id
37
+ spawn_process(app_name)
38
38
  end
39
39
 
40
40
  def fill_slave_pool
@@ -49,10 +49,17 @@ class Spork::RunStrategy::Magazine < Spork::RunStrategy
49
49
 
50
50
  def start_slave(id)
51
51
  app_pwd = Dir.pwd # path running app in
52
- app = "ruby magazine_slave_provider.rb #{id} #{app_pwd} #{@test_framework.short_name}"
53
- @pids[id] = Process.create( :app_name => app, :cwd => @path ).process_id
52
+ app = "ruby magazine_slave_provider.rb #{id} '#{app_pwd}' #{@test_framework.short_name}"
53
+ @pids[id] = spawn_process(app)
54
54
  end
55
55
 
56
+ def spawn_process(app)
57
+ if RUBY_VERSION < '1.9.1'
58
+ Process.create( :app_name => app, :cwd => @path ).process_id
59
+ else
60
+ Process.spawn( app, :chdir => @path )
61
+ end
62
+ end
56
63
 
57
64
  def self.available?
58
65
  true
@@ -81,13 +88,13 @@ class Spork::RunStrategy::Magazine < Spork::RunStrategy
81
88
 
82
89
  def restart_slave(id)
83
90
  pid = @pids[id]
84
- Process.kill(4, pid)
91
+ Process.kill(9, pid)
85
92
  start_slave(id)
86
93
  end
87
94
 
88
95
  def kill_all_processes
89
96
 
90
- @pids.each {|pid| Process.kill(4, pid)}
97
+ @pids.each {|pid| Process.kill(9, pid)}
91
98
  puts "\nKilling processes."; $stdout.flush
92
99
  end
93
100
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Harper
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-03-08 00:00:00 -07:00
13
+ date: 2010-03-25 00:00:00 -06:00
14
14
  default_executable: spork
15
15
  dependencies: []
16
16