Skip to content

Commit cc05031

Browse files
committed
[build] Remove early JRuby/rubygems backward compat code
1 parent 67e0ace commit cc05031

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

Rakefile

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,7 @@ desc "Unpack the rack gem"
5252
task :unpack_gem => "target" do |t|
5353
target = File.expand_path(t.prerequisites.first)
5454
spec = Gem.loaded_specs['rack']
55-
# JRuby <= 1.7.20 does not handle respond_to? with method_missing right
56-
# ... issue with Bundler::StubSpecification wrapping (in bundler 1.10.x)
57-
unless ( gem_file = spec.cache_file rescue nil )
58-
#if defined?(::Bundler) && ::Bundler.const_defined?(:StubSpecification) # since Bundler 1.10.1
59-
# spec = spec.to_spec if spec.is_a?(::Bundler::StubSpecification)
60-
#else
61-
# spec = spec.to_spec if spec.respond_to?(:to_spec)
62-
#end
63-
gem_file = File.join(spec.base_dir, 'cache', spec.file_name)
64-
end
55+
gem_file = spec.respond_to?(:cache_file) ? spec.cache_file : File.join(spec.base_dir, 'cache', spec.file_name)
6556
unless uptodate?("#{target}/vendor/rack.rb", [__FILE__, gem_file])
6657
mkdir_p "target/vendor"
6758
require 'rubygems/installer'
@@ -187,9 +178,9 @@ task :gem => [target_jar, target_jruby_rack, target_jruby_rack_version] do
187178
gem.homepage = %q{http://jruby.org}
188179
gem.required_ruby_version = '>= 3.1.0' # JRuby >= 9.4
189180
end
190-
defined?(Gem::Builder) ? Gem::Builder.new(gemspec).build : begin
191-
require 'rubygems/package'; Gem::Package.build(gemspec)
192-
end
181+
182+
require 'rubygems/package'
183+
Gem::Package.build(gemspec)
193184
File.open('jruby-rack.gemspec', 'w') { |f| f << gemspec.to_ruby }
194185
mv FileList['*.gem'], '..'
195186
end

0 commit comments

Comments
 (0)