spring 1.7.1 → 1.7.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d14dc08475fd37c9118d173aea5ec37900657430
4
- data.tar.gz: d6fbda6c06dfe77c7bdaa27f6a5cc45019ca5266
3
+ metadata.gz: 85d4ab3b84aa6f12fb90e262bcd8adf394cb94ef
4
+ data.tar.gz: 69c83b9fe81004f4c25b9a429bd1222316e1d25e
5
5
  SHA512:
6
- metadata.gz: bb7c61300a47f81d7ca46c5bf6bb50f679c665bb076b7d05fcacf923d8dc06a8b03b85313ea3f1f465e83fedb4f9ff38641270f9185439156261b03232a58201
7
- data.tar.gz: e5bf9351f6bd9af0150cd0cdba8a04b556445a5cf485e69d89d2b6c3007cd91800a9f19c45732cae1e315805153cbab18911f6191d3c7508efc74c516170ad55
6
+ metadata.gz: 491bc17d5c922c974ebe995469c5ebaa099c95351067eab312dad022426feecc006e6dd2211955e390eabb2371392a99e8cdfa39f07dc5b6938f5de73a30d1a7
7
+ data.tar.gz: 61f6d055f6b22aa94858dbd82227c0c4edbbdd6631a933a8bd5b2ebb0499c3d9c8cff27f1d41c6dca115a084cb0ddbffedef133345385069c87df69673e44ed5
@@ -306,7 +306,7 @@ module Spring
306
306
  @mutex.synchronize { @waiting << pid }
307
307
 
308
308
  # Wait in a separate thread so we can run multiple commands at once
309
- Thread.new {
309
+ Spring.failsafe_thread {
310
310
  begin
311
311
  _, status = Process.wait2 pid
312
312
  log "#{pid} exited with #{status.exitstatus}"
@@ -320,7 +320,7 @@ module Spring
320
320
  end
321
321
  }
322
322
 
323
- Thread.new {
323
+ Spring.failsafe_thread {
324
324
  while signal = client.gets.chomp
325
325
  begin
326
326
  Process.kill(signal, -Process.getpgid(pid))
@@ -116,7 +116,7 @@ module Spring
116
116
  def start_wait_thread(pid, child)
117
117
  Process.detach(pid)
118
118
 
119
- Thread.new {
119
+ Spring.failsafe_thread {
120
120
  # The recv can raise an ECONNRESET, killing the thread, but that's ok
121
121
  # as if it does we're no longer interested in the child
122
122
  loop do
@@ -6,3 +6,5 @@ require "spring/env"
6
6
  require "spring/process_title_updater"
7
7
  require "spring/json"
8
8
  require "spring/watcher"
9
+ require "spring/failsafe_thread"
10
+
@@ -7,7 +7,7 @@ module Spring
7
7
  class Run < Command
8
8
  FORWARDED_SIGNALS = %w(INT QUIT USR1 USR2 INFO WINCH) & Signal.list.keys
9
9
  CONNECT_TIMEOUT = 1
10
- BOOT_TIMEOUT = 10
10
+ BOOT_TIMEOUT = 20
11
11
 
12
12
  attr_reader :server
13
13
 
@@ -0,0 +1,14 @@
1
+ require 'thread'
2
+
3
+ module Spring
4
+ class << self
5
+ def failsafe_thread
6
+ Thread.new {
7
+ begin
8
+ yield
9
+ rescue
10
+ end
11
+ }
12
+ end
13
+ end
14
+ end
@@ -10,7 +10,7 @@ module Spring
10
10
  def self.run(&block)
11
11
  updater = new(&block)
12
12
 
13
- Thread.new {
13
+ Spring.failsafe_thread {
14
14
  $0 = updater.value
15
15
  loop { $0 = updater.next }
16
16
  }
@@ -106,7 +106,7 @@ module Spring
106
106
  end
107
107
  end
108
108
 
109
- @applications.values.map { |a| Thread.new { a.stop } }.map(&:join)
109
+ @applications.values.map { |a| Spring.failsafe_thread { a.stop } }.map(&:join)
110
110
  end
111
111
 
112
112
  def write_pidfile
@@ -465,11 +465,11 @@ module Spring
465
465
  test "changing the Gemfile works when spring calls into itself" do
466
466
  File.write(app.path("script.rb"), <<-RUBY.strip_heredoc)
467
467
  gemfile = Rails.root.join("Gemfile")
468
- File.write(gemfile, "\#{gemfile.read}gem 'devise'\\n")
468
+ File.write(gemfile, "\#{gemfile.read}gem 'text'\\n")
469
469
  Bundler.with_clean_env do
470
470
  system(#{app.env.inspect}, "bundle install")
471
471
  end
472
- output = `\#{Rails.root.join('bin/rails')} runner 'require "devise"; puts "done";'`
472
+ output = `\#{Rails.root.join('bin/rails')} runner 'require "text"; puts "done";'`
473
473
  exit output.include? "done\n"
474
474
  RUBY
475
475
 
@@ -516,10 +516,10 @@ module Spring
516
516
  test "booting a foreground server" do
517
517
  FileUtils.cd(app.root) do
518
518
  assert !spring_env.server_running?
519
- app.run "spring server &"
519
+ assert_success "bin/spring server &"
520
520
 
521
- Timeout.timeout(1) do
522
- sleep 0.1 until spring_env.server_running?
521
+ Timeout.timeout(10) do
522
+ sleep 0.1 until spring_env.server_running? && spring_env.socket_path.exist?
523
523
  end
524
524
 
525
525
  assert_success app.spring_test_command
@@ -10,6 +10,7 @@ module Spring
10
10
  def initialize(root)
11
11
  @root = Pathname.new(root)
12
12
  @spring_env = Spring::Env.new(root: root)
13
+ @times = nil
13
14
  end
14
15
 
15
16
  def exists?
@@ -120,7 +121,7 @@ module Spring
120
121
  @times << (Time.now - start_time) if @times
121
122
 
122
123
  output.merge(status: status, command: command)
123
- rescue Timeout::Error => e
124
+ rescue Timeout::Error
124
125
  raise Timeout::Error, "While running command:\n\n#{dump_streams(command, read_streams)}"
125
126
  end
126
127
 
@@ -8,6 +8,7 @@ module Spring
8
8
  @version = RailsVersion.new(version_constraint.split(' ').last)
9
9
  @application = Application.new(root)
10
10
  @bundled = false
11
+ @installed = false
11
12
  end
12
13
 
13
14
  def test_root
@@ -1,3 +1,3 @@
1
1
  module Spring
2
- VERSION = "1.7.1"
2
+ VERSION = "1.7.2"
3
3
  end
@@ -1,5 +1,3 @@
1
- require "spring/watcher"
2
-
3
1
  module Spring
4
2
  module Watcher
5
3
  class Polling < Abstract
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spring
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Leighton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-11 00:00:00.000000000 Z
11
+ date: 2016-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -86,6 +86,7 @@ files:
86
86
  - lib/spring/configuration.rb
87
87
  - lib/spring/env.rb
88
88
  - lib/spring/errors.rb
89
+ - lib/spring/failsafe_thread.rb
89
90
  - lib/spring/json.rb
90
91
  - lib/spring/process_title_updater.rb
91
92
  - lib/spring/server.rb