diff options
author | Guillermo Guerrero <wolf.fox1985@gmail.com> | 2019-04-12 18:59:35 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-03 09:29:59 +0900 |
commit | e1ccaa8782fa722b842ba59c955a212697afde9c (patch) | |
tree | 3d1051344299a2ef5e22529ec7790d456a016e3d /lib | |
parent | 759930dd11aedfd563d11bdef4b0a562b0f00ad9 (diff) | |
download | ruby-e1ccaa8782fa722b842ba59c955a212697afde9c.tar.gz |
[bundler/bundler] Extract a `print_gems` method
https://github.com/bundler/bundler/commit/0d8c8d207e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/cli/outdated.rb | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index e583010d4b..6389f909e1 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -133,24 +133,10 @@ module Bundler end end - gems.each do |gem| - print_gem( - gem[:current_spec], - gem[:active_spec], - gem[:dependency], - groups, - ) - end + print_gems(gems) end else - outdated_gems_list.each do |gem| - print_gem( - gem[:current_spec], - gem[:active_spec], - gem[:dependency], - gem[:groups], - ) - end + print_gems(outdated_gems_list) end exit 1 @@ -193,6 +179,17 @@ module Bundler end end + def print_gems(gems_list) + gems_list.each do |gem| + print_gem( + gem[:current_spec], + gem[:active_spec], + gem[:dependency], + gem[:groups], + ) + end + end + def print_gem(current_spec, active_spec, dependency, groups) spec_version = "#{active_spec.version}#{active_spec.git_version}" spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from |