summaryrefslogtreecommitdiff
path: root/lib/bundler.rb
diff options
context:
space:
mode:
authorjoyicecloud <joyicecloud@gmail.com>2013-09-03 15:37:56 -0700
committerjoyicecloud <joyicecloud@gmail.com>2013-09-18 14:24:17 -0700
commit43732e9c1b3a7510d0592d2a2f357855abab18d7 (patch)
tree7e8de92c9e2c2b10dfdd4b11e420727f0a3890fc /lib/bundler.rb
parent7bd82641de44de6601a03ae455ce9277bcdf04b0 (diff)
downloadbundler-43732e9c1b3a7510d0592d2a2f357855abab18d7.tar.gz
Displays the previous version of the gem when run bundle update
Change code in the 3 source files to display the method locked_gems in lib/bundler.rb Add 3 Rspec test in the update directory for each source: rubygems, git, path.
Diffstat (limited to 'lib/bundler.rb')
-rw-r--r--lib/bundler.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index f6e75dd7c0..311409bdfc 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -153,9 +153,12 @@ module Bundler
end
def locked_gems
- @locked_gems ||= begin
+ return @locked_gems if defined?(@locked_gems)
+ if Bundler.default_lockfile.exist?
lock = Bundler.read_file(Bundler.default_lockfile)
- LockfileParser.new(lock)
+ @lock_gems = LockfileParser.new(lock)
+ else
+ @locked_gems = nil
end
end