gem-prune 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,8 +19,12 @@ class Gem::Commands::KeepCommand < Gem::Command
19
19
  keep_gem = get_one_gem_name
20
20
  load_configuration
21
21
  entry = gems_to_keep.detect { |(gem, versions)| gem == keep_gem }
22
- entry[1] << options[:version]
23
- entry[1] = entry[1].uniq.compact
22
+ if entry
23
+ entry[1] << options[:version]
24
+ entry[1] = entry[1].uniq.compact
25
+ else
26
+ gems_to_keep << [keep_gem, [options[:version]].compact]
27
+ end
24
28
  save_configuration
25
29
  end
26
30
 
@@ -18,7 +18,7 @@ module Gem; module Prune; module Util
18
18
 
19
19
  def save_configuration
20
20
  File.open(settings_filename, "w") do |file|
21
- formatted = @configuration.map do |gem, versions|
21
+ formatted = @configuration.sort_by(&:first).map do |gem, versions|
22
22
  version_string = versions.length.zero? ? "" : " (%s)" % versions.join(", ")
23
23
  "#{gem}#{version_string}"
24
24
  end.join("\n")
data/lib/gem_prune.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module GemPrune
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-prune
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
- - 0
10
- version: 2.1.0
9
+ - 1
10
+ version: 2.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - |
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-10-02 00:00:00 -04:00
20
+ date: 2010-11-04 00:00:00 -07:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency