summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2013-08-31 18:56:43 -0700
committerAndre Arko <andre@arko.net>2013-08-31 19:03:42 -0700
commitb89e304cab8c92c969b0a700e5e66c114f23e58d (patch)
tree2b0ed10c3d25fa6330b3e8ecb887a9e624d8aa4f
parent0ab0cd9058d39a7c8ead6a796fa319ec877c53e5 (diff)
downloadbundler-b89e304cab8c92c969b0a700e5e66c114f23e58d.tar.gz
extract Bundler.locked_gems
-rw-r--r--lib/bundler.rb7
-rw-r--r--lib/bundler/cli.rb3
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 883917cb3a..2db880eca5 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -152,6 +152,13 @@ module Bundler
end
end
+ def locked_gems
+ @locked_gems ||= begin
+ lock = Bundler.read_file(Bundler.default_lockfile)
+ LockfileParser.new(lock)
+ end
+ end
+
def ruby_scope
"#{Bundler.rubygems.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}"
end
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index af0a7fb618..60f996700c 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -311,8 +311,7 @@ module Bundler
Bundler.definition(true)
else
# cycle through the requested gems, just to make sure they exist
- lock = Bundler.read_file(Bundler.default_lockfile)
- names = LockfileParser.new(lock).specs.map{ |s| s.name }
+ names = Bundler.locked_gems.specs.map{ |s| s.name }
gems.each do |g|
next if names.include?(g)
raise GemNotFound, not_found_message(g, names)