spring 1.1.0.beta3 → 1.1.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ec57b11dfce83e9e7ca74433cd0e18e0e4b499f3
4
- data.tar.gz: 61e4462c800903ab2d66710ccc92544a2a5f251b
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YTc2OTBiOGJlOWQ1ODNlMDVhY2NkNWMwNjhiMzA4ZGQxNjQ1MzA3ZA==
5
+ data.tar.gz: !binary |-
6
+ ZTk3ZGJlNGVhODM1YmIxNTkwOTgzYmI4YzQ5ZGEzOWVhN2M0ZTAwYg==
5
7
  SHA512:
6
- metadata.gz: 38741e9b52477feee7d28b28ea299438f46174f89e64ca16a5a34a9b673d723fd9b4830d9a216c958f3b5e2b8f66bc8bea2ca536fcfb498fb8c524ef508771ce
7
- data.tar.gz: d0c5bdfcaacf59dae01f4701c2d974675a624485d10efbe6aab155055e773b696d332fc54ba4e24a285ce1127bc16a11f3323f6328d771c34e9fe0cb57898314
8
+ metadata.gz: !binary |-
9
+ Mzk0MDdkMTAwNTc1MjNkY2UwZjZiNTIxNDJhMmJmMjkwNGU3NWU2NTQxN2Ez
10
+ ZTM5ZmUzNjdiMzk3ZjFmYTc0MTQyYjFhYzUxYmVmYjkyMTBlZjllZjAwNTA3
11
+ NGZiOWY1MGZhNGEyOTQ0MTkzMTdmZDA5ODY2YWJiMDUxNjk3NGE=
12
+ data.tar.gz: !binary |-
13
+ MjJmYmYxMmNkNWZiNzgwMGJhMThkOTcxNWU1OTkwNDdmMWIyMjQwNWE3Mzhl
14
+ Njk1MWE2NjMxMTg3Njk0ZTJmNDZmODE4NDg3YzliY2IxYzFlMzA1MTJhYzU1
15
+ NTAxODJlOWFlZGQ5MTYzMTc5N2U5MTJiYWQ3MjQ3ZmY2OTFhZjI=
data/bin/spring CHANGED
@@ -21,6 +21,7 @@ if defined?(Gem)
21
21
 
22
22
  if unstubbed.any?
23
23
  warn "Warning: Running `gem pristine --all` to regenerate your installed gemspecs " \
24
+ "(and deleting then reinstalling your bundle if you use bundle --path) " \
24
25
  "will improve the startup performance of Spring."
25
26
  end
26
27
  end
@@ -5,6 +5,7 @@ app = Spring::Application.new(
5
5
  Spring::JSON.load(ENV.delete("SPRING_ORIGINAL_ENV").dup)
6
6
  )
7
7
  Signal.trap("TERM") { app.terminate }
8
+ Signal.trap("TTOU", "IGNORE")
8
9
 
9
10
  app.preload if ENV.delete("SPRING_PRELOAD") == "1"
10
11
  app.run
@@ -6,6 +6,7 @@ module Spring
6
6
  @app_env = app_env
7
7
  @spring_env = Env.new
8
8
  @mutex = Mutex.new
9
+ @state = :running
9
10
  end
10
11
 
11
12
  def log(message)
@@ -26,6 +27,7 @@ module Spring
26
27
  end
27
28
 
28
29
  def restart
30
+ return if @state == :stopping
29
31
  start_child(true)
30
32
  end
31
33
 
@@ -74,7 +76,12 @@ module Spring
74
76
  end
75
77
 
76
78
  def stop
77
- Process.kill('TERM', pid) if pid
79
+ @state = :stopping
80
+
81
+ if pid
82
+ Process.kill('TERM', pid)
83
+ Process.wait(pid)
84
+ end
78
85
  end
79
86
 
80
87
  private
@@ -1,10 +1,6 @@
1
1
  require "socket"
2
2
  require "thread"
3
3
 
4
- # readline must be required before we setpgid, otherwise the require may hang,
5
- # if readline has been built against libedit. See issue #70.
6
- require "readline"
7
-
8
4
  require "spring/configuration"
9
5
  require "spring/env"
10
6
  require "spring/process_title_updater"
@@ -92,13 +92,13 @@ module Spring
92
92
  end
93
93
 
94
94
  def shutdown
95
- @applications.values.each(&:stop)
96
-
97
95
  [env.socket_path, env.pidfile_path].each do |path|
98
96
  if path.exist?
99
97
  path.unlink rescue nil
100
98
  end
101
99
  end
100
+
101
+ @applications.values.map { |a| Thread.new { a.stop } }.map(&:join)
102
102
  end
103
103
 
104
104
  def write_pidfile
@@ -1,3 +1,3 @@
1
1
  module Spring
2
- VERSION = "1.1.0.beta3"
2
+ VERSION = "1.1.0.beta4"
3
3
  end
@@ -57,16 +57,8 @@ module Spring
57
57
  @stderr ||= IO.pipe
58
58
  end
59
59
 
60
- def log_file_path
61
- path("tmp/spring.log")
62
- end
63
-
64
60
  def log_file
65
- @log_file ||= begin
66
- tmp = path("tmp")
67
- tmp.mkdir unless tmp.exist?
68
- tmp.join("spring.log").open("w+")
69
- end
61
+ @log_file ||= path("tmp/spring.log").open("w+")
70
62
  end
71
63
 
72
64
  def env
@@ -265,7 +257,7 @@ module Spring
265
257
  if ENV["SPRING_DEBUG"]
266
258
  puts "$ #{command}\n"
267
259
  else
268
- command = "#{command} > /dev/null"
260
+ command = "(#{command}) > /dev/null"
269
261
  end
270
262
 
271
263
  Kernel.system(command) or raise "command failed: #{command}"
@@ -329,8 +321,8 @@ module Spring
329
321
  end
330
322
 
331
323
  def copy_to(path)
332
- FileUtils.rm_rf(path.to_s)
333
- FileUtils.cp_r(application.root.to_s, path.to_s)
324
+ system("rm -rf #{path}")
325
+ system("cp -r #{application.root} #{path}")
334
326
  end
335
327
  end
336
328
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spring
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.beta3
4
+ version: 1.1.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Leighton
@@ -14,28 +14,28 @@ dependencies:
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Rails application preloader
@@ -104,17 +104,17 @@ require_paths:
104
104
  - lib
105
105
  required_ruby_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - '>='
107
+ - - ! '>='
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  requirements:
112
- - - '>'
112
+ - - ! '>'
113
113
  - !ruby/object:Gem::Version
114
114
  version: 1.3.1
115
115
  requirements: []
116
116
  rubyforge_project:
117
- rubygems_version: 2.1.9
117
+ rubygems_version: 2.2.1
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Rails application preloader
@@ -128,4 +128,3 @@ test_files:
128
128
  - test/unit/commands_test.rb
129
129
  - test/unit/process_title_updater_test.rb
130
130
  - test/unit/watcher_test.rb
131
- has_rdoc: