diff options
author | Cirdes Henrique <cirdes@gmail.com> | 2016-01-28 17:26:37 -0300 |
---|---|---|
committer | Cirdes Henrique <cirdes@gmail.com> | 2016-01-29 08:05:14 -0300 |
commit | 9096ca93afe111bd0a6feb0d6ebac7de72e422b6 (patch) | |
tree | 01d3815fbdd85c8b4330173e3378a799f0903a78 /lib/bundler/cli/outdated.rb | |
parent | a2d40cdde33186ab3bdd42c5080321ae89218a7b (diff) | |
download | bundler-9096ca93afe111bd0a6feb0d6ebac7de72e422b6.tar.gz |
bundle outdated with major and minor options
This feature adds the ability to specify on outdated command to
show only the gems with a major or minor updates
Diffstat (limited to 'lib/bundler/cli/outdated.rb')
-rw-r--r-- | lib/bundler/cli/outdated.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index 53813145..179635b8 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -46,6 +46,18 @@ module Bundler active_spec = active_spec.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? } end active_spec = active_spec.last + + if options[:major] + current_major = current_spec.version.segments.first + active_major = active_spec.version.segments.first + active_spec = nil unless active_major > current_major + end + + if options[:minor] + current_minor = current_spec.version.segments[0, 2].compact.join(".") + active_minor = active_spec.version.segments[0, 2].compact.join(".") + active_spec = nil unless active_minor > current_minor + end end next if active_spec.nil? |