Skip to content

Commit 3c23ebb

Browse files
committed
Active Support is not an runtime dependency of the gem
1 parent c00c3c3 commit 3c23ebb

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

lib/spring/binstub.rb

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,6 @@
11
command = File.basename($0)
22
bin_path = File.expand_path("../../../bin/spring", __FILE__)
33

4-
# When we run a command which does not go through Spring (e.g. DISABLE_SPRING
5-
# is used, or we just call 'rails' or something) then we get this warning from
6-
# Rubygems:
7-
#
8-
# WARN: Unresolved specs during Gem::Specification.reset: activesupport (<= 5.1, >= 4.2)
9-
# WARN: Clearing out unresolved specs.
10-
# Please report a bug if this causes problems.
11-
#
12-
# This happens due to our dependency on activesupport, when Bundler.setup gets
13-
# called. We don't actually *use* the dependency; it is purely there to
14-
# restrict the Rails version that we're compatible with.
15-
#
16-
# When the warning is shown, Rubygems just does the below.
17-
# Therefore, by doing it ourselves here, we can avoid the warning.
18-
if Gem::Specification.respond_to?(:unresolved_deps)
19-
Gem::Specification.unresolved_deps.clear
20-
else
21-
Gem.unresolved_deps.clear
22-
end
23-
244
if command == "spring"
255
load bin_path
266
else

spring.gemspec

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ Gem::Specification.new do |gem|
1313
gem.files = Dir["LICENSE.txt", "README.md", "lib/**/*", "bin/*"]
1414
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
1515

16-
# We don't directly use Active Support (Spring needs to be able to run
17-
# without gem dependencies), but this will ensure that this version of
18-
# Spring can't be installed alongside an incompatible Rails version.
19-
gem.add_dependency 'activesupport', '>= 4.2'
20-
2116
gem.add_development_dependency 'rake'
2217
gem.add_development_dependency 'bump'
18+
gem.add_development_dependency 'activesupport'
2319
end

0 commit comments

Comments
 (0)