spring 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/spring +2 -0
- data/lib/spring/client/run.rb +3 -0
- data/lib/spring/configuration.rb +3 -1
- data/lib/spring/test/acceptance_test.rb +25 -1
- data/lib/spring/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe523c65977f4083feea0970165a082eb667e6be
|
4
|
+
data.tar.gz: 288444858518c627ddedaa356e1c620300221770
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57b35faa126834bd1a3f714efb236984c3795288bbd8620a96e3824c1cbd65e1f0bf7049bba288637fa01f86e9ba926ec35bf08aa13a408c6ada4b1b13752841
|
7
|
+
data.tar.gz: 00186aa81a271f2d384c4e10c0c2e18e9b33e2910e6e4dd955194a42abdefe90f4561b4c60c68a21975b10a5fae207376acd5a756ac6edb53fa9559cac633cef
|
data/bin/spring
CHANGED
@@ -46,4 +46,6 @@ end
|
|
46
46
|
lib = File.expand_path("../../lib", __FILE__)
|
47
47
|
$LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib) # enable local development
|
48
48
|
require 'spring/client'
|
49
|
+
# if the user knows that spring is called, do not show running spring
|
50
|
+
Spring.quiet = true if $0.include? 'spring'
|
49
51
|
Spring::Client.run(ARGV)
|
data/lib/spring/client/run.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "spring/commands"
|
1
2
|
require "rbconfig"
|
2
3
|
require "socket"
|
3
4
|
require "bundler"
|
@@ -138,6 +139,8 @@ ERROR
|
|
138
139
|
if pid && !pid.empty?
|
139
140
|
log "got pid: #{pid}"
|
140
141
|
|
142
|
+
puts "Running via Spring preloader in process #{pid}" unless Spring.quiet
|
143
|
+
|
141
144
|
forward_signals(pid.to_i)
|
142
145
|
status = application.read.to_i
|
143
146
|
|
data/lib/spring/configuration.rb
CHANGED
@@ -2,7 +2,7 @@ require "spring/errors"
|
|
2
2
|
|
3
3
|
module Spring
|
4
4
|
class << self
|
5
|
-
attr_accessor :application_root
|
5
|
+
attr_accessor :application_root, :quiet
|
6
6
|
|
7
7
|
def gemfile
|
8
8
|
ENV['BUNDLE_GEMFILE'] || "Gemfile"
|
@@ -49,4 +49,6 @@ module Spring
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
|
+
|
53
|
+
self.quiet = false
|
52
54
|
end
|
@@ -47,6 +47,14 @@ module Spring
|
|
47
47
|
assert_output artifacts, expected_output if expected_output
|
48
48
|
end
|
49
49
|
|
50
|
+
def refute_output_includes(command, not_expected)
|
51
|
+
artifacts = app.run(*Array(command))
|
52
|
+
not_expected.each do |stream, output|
|
53
|
+
assert !artifacts[stream].include?(output),
|
54
|
+
"expected #{stream} to not include '#{output}'.\n\n#{app.debug(artifacts)}"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
50
58
|
def assert_speedup(ratio = DEFAULT_SPEEDUP)
|
51
59
|
if ENV['CI']
|
52
60
|
yield
|
@@ -94,6 +102,22 @@ module Spring
|
|
94
102
|
refute app.spring_env.server_running?
|
95
103
|
end
|
96
104
|
|
105
|
+
test "tells the user that spring is being used when used automatically via binstubs" do
|
106
|
+
assert_success "bin/rails runner ''", stdout: "Running via Spring preloader in process"
|
107
|
+
assert_success app.spring_test_command, stdout: "Running via Spring preloader in process"
|
108
|
+
end
|
109
|
+
|
110
|
+
test "does not tell the user that spring is being used when the user used spring manually" do
|
111
|
+
refute_output_includes "spring rails runner ''", stdout: "Running via Spring preloader in process"
|
112
|
+
refute_output_includes "spring rake test", stdout: "Running via Spring preloader in process"
|
113
|
+
end
|
114
|
+
|
115
|
+
test "does not tell the user that spring is being used when used automatically via binstubs but quiet is enabled" do
|
116
|
+
File.write("#{app.user_home}/.spring.rb", "Spring.quiet = true")
|
117
|
+
assert_success "bin/rails runner ''"
|
118
|
+
refute_output_includes "bin/rails runner ''", stdout: 'Running via Spring preloader in process'
|
119
|
+
end
|
120
|
+
|
97
121
|
test "test changes are picked up" do
|
98
122
|
assert_speedup do
|
99
123
|
assert_success app.spring_test_command, stdout: "0 failures"
|
@@ -447,7 +471,7 @@ module Spring
|
|
447
471
|
system(#{app.env.inspect}, "bundle install")
|
448
472
|
end
|
449
473
|
output = `\#{Rails.root.join('bin/rails')} runner 'require "devise"; puts "done";'`
|
450
|
-
exit output
|
474
|
+
exit output.include? "done\n"
|
451
475
|
RUBY
|
452
476
|
|
453
477
|
assert_success [%(bin/rails runner 'load Rails.root.join("script.rb")'), timeout: 60]
|
data/lib/spring/version.rb
CHANGED
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.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Leighton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|