Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1222 from tenderlove/specobj
Browse files Browse the repository at this point in the history
Stop LazySpec#method_missing from generating so many objects
  • Loading branch information
Andre Arko committed Jun 3, 2011
2 parents b7c96df + 50ebe24 commit 2235f98
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/bundler/lazy_specification.rb
Expand Up @@ -59,12 +59,11 @@ def to_s
private

def method_missing(method, *args, &blk)
if Gem::Specification.new.respond_to?(method)
raise "LazySpecification has not been materialized yet (calling :#{method} #{args.inspect})" unless @specification
@specification.send(method, *args, &blk)
else
super
end
raise "LazySpecification has not been materialized yet (calling :#{method} #{args.inspect})" unless @specification

return super unless respond_to?(method)

@specification.send(method, *args, &blk)
end

end
Expand Down

0 comments on commit 2235f98

Please sign in to comment.