spin 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/spin +11 -7
  2. metadata +2 -2
data/bin/spin CHANGED
@@ -97,11 +97,15 @@ def serve(force_rspec, force_testunit, time, push_results)
97
97
 
98
98
  loop do
99
99
 
100
- # Trap SIGQUIT (Ctrl+\) and re-run the last files that were pushed.
101
- trap('QUIT') do
102
- fork_and_run(@last_files_ran, push_results, test_framework)
103
- # See WAIT below
104
- Process.wait
100
+ # If we're not going to push the results,
101
+ # Trap SIGQUIT (Ctrl+\) and re-run the last files that were
102
+ # pushed.
103
+ if !push_results
104
+ trap('QUIT') do
105
+ fork_and_run(@last_files_ran, push_results, test_framework, nil)
106
+ # See WAIT below
107
+ Process.wait
108
+ end
105
109
  end
106
110
 
107
111
  # Since `spin push` reconnects each time it has new files for us we just
@@ -119,7 +123,7 @@ def serve(force_rspec, force_testunit, time, push_results)
119
123
  # it immediately.
120
124
  disconnect(conn) unless push_results
121
125
 
122
- fork_and_run(files, push_results, test_framework)
126
+ fork_and_run(files, push_results, test_framework, conn)
123
127
 
124
128
  # WAIT: We don't want the parent process handling multiple test runs at the same
125
129
  # time because then we'd need to deal with multiple test databases, and
@@ -141,7 +145,7 @@ def serve(force_rspec, force_testunit, time, push_results)
141
145
  end
142
146
  end
143
147
 
144
- def fork_and_run(files, push_results, test_framework)
148
+ def fork_and_run(files, push_results, test_framework, conn)
145
149
  # We fork(2) before loading the file so that our pristine preloaded
146
150
  # environment is untouched. The child process will load whatever code it
147
151
  # needs to, then it exits and we're back to the baseline preloaded app.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-13 00:00:00.000000000 Z
12
+ date: 2011-12-15 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'Spin preloads your Rails environment to speed up your autotest(ish)
15
15
  workflow.