Skip to content

Commit 2693ff3

Browse files
committed
work-around respond_to_missing? bug in JRuby 1.7.20
... (this is relevant since Bundler >= 1.10.1)
1 parent ee6f164 commit 2693ff3

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Rakefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@ desc "Unpack the rack gem"
5555
task :unpack_gem => "target" do |t|
5656
target = File.expand_path(t.prerequisites.first)
5757
spec = Gem.loaded_specs['rack']
58-
if spec.respond_to?(:cache_file)
59-
gem_file = spec.cache_file
60-
else
58+
# JRuby <= 1.7.20 does not handle respond_to? with method_missing right
59+
# ... issue with Bundler::StubSpecification wrapping (in bundler 1.10.x)
60+
unless ( gem_file = spec.cache_file rescue nil )
61+
#if defined?(::Bundler) && ::Bundler.const_defined?(:StubSpecification) # since Bundler 1.10.1
62+
# spec = spec.to_spec if spec.is_a?(::Bundler::StubSpecification)
63+
#else
64+
# spec = spec.to_spec if spec.respond_to?(:to_spec)
65+
#end
6166
gem_file = File.join(spec.base_dir, 'cache', spec.file_name)
6267
end
6368
unless uptodate?("#{target}/vendor/rack.rb", [__FILE__, gem_file])

0 commit comments

Comments
 (0)