diff options
author | joyicecloud <joyicecloud@gmail.com> | 2013-09-03 15:37:56 -0700 |
---|---|---|
committer | joyicecloud <joyicecloud@gmail.com> | 2013-09-18 14:24:17 -0700 |
commit | 43732e9c1b3a7510d0592d2a2f357855abab18d7 (patch) | |
tree | 7e8de92c9e2c2b10dfdd4b11e420727f0a3890fc /lib/bundler/source.rb | |
parent | 7bd82641de44de6601a03ae455ce9277bcdf04b0 (diff) | |
download | bundler-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/source.rb')
-rw-r--r-- | lib/bundler/source.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index c75599f4..2a7f0944 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -1,7 +1,17 @@ module Bundler - module Source + class Source autoload :Rubygems, 'bundler/source/rubygems' autoload :Path, 'bundler/source/path' autoload :Git, 'bundler/source/git' + + def version_message(spec) + locked_spec = Bundler.locked_gems.specs.find { |s| s.name == spec.name } if Bundler.locked_gems + locked_spec_version = locked_spec.version if locked_spec + message = "#{spec.name} (#{spec.version})" + old_version = " was (#{locked_spec_version})" + message << old_version if locked_spec_version && spec.version != locked_spec_version + message + end + end end |