@@ -52,16 +52,7 @@ desc "Unpack the rack gem"
5252task :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