diff options
author | Andre Arko <andre@arko.net> | 2013-12-18 16:03:35 -0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2013-12-18 16:03:35 -0800 |
commit | 89235d86ec81006f5647fcd383af981690b3264c (patch) | |
tree | f37103bfd02a1792272022390803ae128829c551 /lib/bundler/source.rb | |
parent | 3c5446a3b700d0da44cb990a68aa73e199d7b2a1 (diff) | |
parent | f02f0fcc218b89e35b59c704c488c185aa23aca0 (diff) | |
download | bundler-89235d86ec81006f5647fcd383af981690b3264c.tar.gz |
Merge pull request #2639 from joyicecloud/show-version-of-gem-updated
Displays the previous version of the gem when run bundle update
Conflicts:
lib/bundler/source.rb
lib/bundler/source/git/git_proxy.rb
lib/bundler/source/rubygems.rb
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 4ab7a8e4..a42bfde7 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -1,5 +1,5 @@ module Bundler - module Source + class Source autoload :Rubygems, 'bundler/source/rubygems' autoload :Path, 'bundler/source/path' autoload :Git, 'bundler/source/git' @@ -14,5 +14,15 @@ module Bundler mirrors[normalized_key] || uri end + 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}" + if locked_spec_version && spec.version != locked_spec_version + message << " (was #{locked_spec_version})" + end + message + end + end end |