rubygems-update 1.8.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubygems-update might be problematic. Click here for more details.

data.tar.gz.sig CHANGED
Binary file
@@ -1,4 +1,17 @@
1
- === 1.8.0 / 2011-04-34
1
+ === 1.8.1 / 2011-05-05
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Added Gem::Requirement#specific? and Gem::Dependency#specific?
6
+
7
+ * 4 bug fixes:
8
+
9
+ * Typo on Indexer rendered it useless on Windows
10
+ * gem dep can fetch remote dependencies for non-latest gems again.
11
+ * gem uninstall with multiple versions no longer crashes with ArgumentError
12
+ * Always use binary mode for File.open to keep Windows happy
13
+
14
+ === 1.8.0 / 2011-04-34
2
15
 
3
16
  This release focused on properly encapsulating functionality. Most of this
4
17
  work focused on moving functionality out of Gem::SourceIndex and
@@ -120,7 +120,7 @@ require "rubygems/deprecate"
120
120
  # -The RubyGems Team
121
121
 
122
122
  module Gem
123
- VERSION = '1.8.0'
123
+ VERSION = '1.8.1'
124
124
 
125
125
  ##
126
126
  # Raised when RubyGems is unable to load or activate a gem. Contains the
@@ -855,7 +855,7 @@ module Gem
855
855
  def self.required_location(gemname, libfile, *requirements)
856
856
  requirements = Gem::Requirement.default if requirements.empty?
857
857
 
858
- matches = Gem.source_index.find_name gemname, requirements
858
+ matches = Gem::Specification.find_all_by_name gemname, *requirements
859
859
 
860
860
  return nil if matches.empty?
861
861
 
@@ -43,6 +43,11 @@ class Gem::Commands::DependencyCommand < Gem::Command
43
43
  end
44
44
 
45
45
  def execute
46
+ if options[:reverse_dependencies] and remote? and not local? then
47
+ alert_error 'Only reverse dependencies for local gems are supported.'
48
+ terminate_interaction 1
49
+ end
50
+
46
51
  options[:args] << '' if options[:args].empty?
47
52
 
48
53
  pattern = if options[:args].length == 1 and
@@ -59,11 +64,6 @@ class Gem::Commands::DependencyCommand < Gem::Command
59
64
  }
60
65
  dependency.prerelease = options[:prerelease]
61
66
 
62
- if options[:reverse_dependencies] and remote? and not local? then
63
- alert_error 'Only reverse dependencies for local gems are supported.'
64
- terminate_interaction 1
65
- end
66
-
67
67
  specs = []
68
68
 
69
69
  specs.concat dependency.matching_specs if local?
@@ -72,7 +72,8 @@ class Gem::Commands::DependencyCommand < Gem::Command
72
72
  fetcher = Gem::SpecFetcher.fetcher
73
73
 
74
74
  # REFACTOR: fetcher.find_specs_matching => specs
75
- specs_and_sources = fetcher.find_matching(dependency, false, true,
75
+ specs_and_sources = fetcher.find_matching(dependency,
76
+ dependency.specific?, true,
76
77
  dependency.prerelease?)
77
78
 
78
79
  specs.concat specs_and_sources.map { |spec_tuple, source_uri|
@@ -227,6 +227,13 @@ class Gem::Dependency
227
227
  matches = matches.sort_by { |s| s.sort_obj } # HACK: shouldn't be needed
228
228
  end
229
229
 
230
+ ##
231
+ # True if the dependency will not always match the latest version.
232
+
233
+ def specific?
234
+ @requirement.specific?
235
+ end
236
+
230
237
  def to_specs
231
238
  matches = matching_specs true
232
239
 
@@ -80,7 +80,7 @@ class Gem::Indexer
80
80
  @master_index = File.join @directory, 'yaml'
81
81
  @marshal_index = File.join @directory, marshal_name
82
82
 
83
- @quick_dir = File.join, @directory, 'quick'
83
+ @quick_dir = File.join @directory, 'quick'
84
84
  @quick_marshal_dir = File.join @quick_dir, marshal_name
85
85
  @quick_marshal_dir_base = File.join "quick", marshal_name # FIX: UGH
86
86
 
@@ -31,6 +31,8 @@ module Gem::Package
31
31
 
32
32
  class TarInvalidError < Error; end
33
33
 
34
+ # FIX: zenspider said: does it really take an IO?
35
+ # passed to a method called open?!? that seems stupid.
34
36
  def self.open(io, mode = "r", signer = nil, &block)
35
37
  tar_type = case mode
36
38
  when 'r' then TarInput
@@ -138,6 +138,15 @@ class Gem::Requirement
138
138
  alias :=== :satisfied_by?
139
139
  alias :=~ :satisfied_by?
140
140
 
141
+ ##
142
+ # True if the requirement will not always match the latest version.
143
+
144
+ def specific?
145
+ return true if @requirements.length > 1 # GIGO, > 1, > 2 is silly
146
+
147
+ not %w[> >=].include? @requirements.first.first # grab the operator
148
+ end
149
+
141
150
  def to_s # :nodoc:
142
151
  as_list.join ", "
143
152
  end
@@ -73,7 +73,7 @@ class Gem::Uninstaller
73
73
  raise Gem::InstallError, "cannot uninstall, check `gem list -d #{@gem}`"
74
74
 
75
75
  elsif list.size > 1 and @force_all then
76
- remove_all list.dup
76
+ remove_all list
77
77
 
78
78
  elsif list.size > 1 then
79
79
  gem_names = list.collect {|gem| gem.full_name} + ["All versions"]
@@ -82,9 +82,9 @@ class Gem::Uninstaller
82
82
  _, index = choose_from_list "Select gem to uninstall:", gem_names
83
83
 
84
84
  if index == list.size then
85
- remove_all list.dup
85
+ remove_all list
86
86
  elsif index >= 0 && index < list.size then
87
- uninstall_gem list[index], list.dup
87
+ uninstall_gem list[index]
88
88
  else
89
89
  say "Error: must enter a number [1-#{list.size+1}]"
90
90
  end
@@ -171,7 +171,7 @@ class Gem::Uninstaller
171
171
  # NOTE: removes uninstalled gems from +list+.
172
172
 
173
173
  def remove_all(list)
174
- list.dup.each { |spec| uninstall_gem spec, list }
174
+ list.each { |spec| uninstall_gem spec }
175
175
  end
176
176
 
177
177
  ##
@@ -38,7 +38,7 @@ class TestGemBuilder < Gem::TestCase
38
38
  spec = Dir.chdir @tempdir do
39
39
  FileUtils.mkdir 'lib'
40
40
  File.open('lib/code.rb', 'w') { |f| f << "something" }
41
- Gem::Package.open(File.open(builder.build)) { |x| x.metadata }
41
+ Gem::Package.open(File.open(builder.build, 'rb')) { |x| x.metadata }
42
42
  end
43
43
  end
44
44
  end
@@ -185,6 +185,24 @@ ERROR: Only reverse dependencies for local gems are supported.
185
185
  assert_equal '', @ui.error
186
186
  end
187
187
 
188
+ def test_execute_remote_version
189
+ @fetcher = Gem::FakeFetcher.new
190
+ Gem::RemoteFetcher.fetcher = @fetcher
191
+
192
+ util_setup_spec_fetcher @a1, @a2
193
+
194
+ @cmd.options[:args] = %w[a]
195
+ @cmd.options[:domain] = :remote
196
+ @cmd.options[:version] = req '= 1'
197
+
198
+ use_ui @ui do
199
+ @cmd.execute
200
+ end
201
+
202
+ assert_equal "Gem a-1\n\n", @ui.output
203
+ assert_equal '', @ui.error
204
+ end
205
+
188
206
  def test_execute_prerelease
189
207
  @fetcher = Gem::FakeFetcher.new
190
208
  Gem::RemoteFetcher.fetcher = @fetcher
@@ -166,5 +166,12 @@ class TestGemDependency < Gem::TestCase
166
166
 
167
167
  assert d.prerelease?
168
168
  end
169
+
170
+ def test_specific
171
+ refute dep('a', '> 1').specific?
172
+
173
+ assert dep('a', '= 1').specific?
174
+ end
175
+
169
176
  end
170
177
 
@@ -250,6 +250,19 @@ class TestGemRequirement < Gem::TestCase
250
250
  refute_satisfied_by "2.0", "~> 1.4.4"
251
251
  end
252
252
 
253
+ def test_specific
254
+ refute req('> 1') .specific?
255
+ refute req('>= 1').specific?
256
+
257
+ assert req('!= 1').specific?
258
+ assert req('< 1') .specific?
259
+ assert req('<= 1').specific?
260
+ assert req('= 1') .specific?
261
+ assert req('~> 1').specific?
262
+
263
+ assert req('> 1', '> 2').specific? # GIGO
264
+ end
265
+
253
266
  def test_bad
254
267
  refute_satisfied_by "", "> 0.1"
255
268
  refute_satisfied_by "1.2.3", "!= 1.2.3"
@@ -27,6 +27,18 @@ class TestGemUninstaller < Gem::InstallerTestCase
27
27
  assert_match %r|/foo/bar$|, uninstaller.instance_variable_get(:@gem_home)
28
28
  end
29
29
 
30
+ def test_remove_all
31
+ uninstaller = Gem::Uninstaller.new nil
32
+
33
+ ui = Gem::MockGemUi.new "y\n"
34
+
35
+ use_ui ui do
36
+ uninstaller.remove_all [@spec]
37
+ end
38
+
39
+ refute_path_exists @spec.gem_dir
40
+ end
41
+
30
42
  def test_remove_executables_force_keep
31
43
  uninstaller = Gem::Uninstaller.new nil, :executables => false
32
44
 
@@ -195,4 +207,19 @@ class TestGemUninstaller < Gem::InstallerTestCase
195
207
  assert_same uninstaller, @pre_uninstall_hook_arg
196
208
  assert_same uninstaller, @post_uninstall_hook_arg
197
209
  end
210
+
211
+ def test_uninstall_selection_greater_than_one
212
+ util_make_gems
213
+
214
+ list = Gem::Specification.find_all_by_name('a')
215
+
216
+ uninstaller = Gem::Uninstaller.new('a')
217
+
218
+ use_ui Gem::MockGemUi.new("2\n") do
219
+ uninstaller.uninstall
220
+ end
221
+
222
+ updated_list = Gem::Specification.find_all_by_name('a')
223
+ assert_equal list.length - 1, updated_list.length
224
+ end
198
225
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- hash: 55
4
+ hash: 53
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 8
9
- - 0
10
- version: 1.8.0
9
+ - 1
10
+ version: 1.8.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jim Weirich
@@ -38,7 +38,7 @@ cert_chain:
38
38
  x52qPcexcYZR7w==
39
39
  -----END CERTIFICATE-----
40
40
 
41
- date: 2011-05-04 00:00:00 Z
41
+ date: 2011-05-06 00:00:00 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: minitest
@@ -406,7 +406,7 @@ post_install_message:
406
406
  rdoc_options:
407
407
  - --main
408
408
  - README.rdoc
409
- - --title=RubyGems 1.8.0 Documentation
409
+ - --title=RubyGems 1.8.1 Documentation
410
410
  require_paths:
411
411
  - hide_lib_for_update
412
412
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -432,7 +432,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
432
432
  requirements: []
433
433
 
434
434
  rubyforge_project: rubygems
435
- rubygems_version: 1.7.2
435
+ rubygems_version: 1.8.0
436
436
  signing_key:
437
437
  specification_version: 3
438
438
  summary: RubyGems is a package management framework for Ruby
metadata.gz.sig CHANGED
Binary file