rubygems-update 0.8.10 → 0.8.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (51) hide show
  1. data/ChangeLog +66 -0
  2. data/README +17 -3
  3. data/Rakefile +29 -11
  4. data/bin/gem_mirror +67 -0
  5. data/examples/application/an-app.gemspec +2 -0
  6. data/lib/rubygems.rb +18 -3
  7. data/lib/rubygems/builder.rb +14 -1
  8. data/lib/rubygems/cmd_manager.rb +2 -0
  9. data/lib/rubygems/command.rb +26 -2
  10. data/lib/rubygems/custom_require.rb +30 -21
  11. data/lib/rubygems/format.rb +4 -4
  12. data/lib/rubygems/gem_commands.rb +161 -9
  13. data/lib/rubygems/gem_openssl.rb +34 -0
  14. data/lib/rubygems/gem_runner.rb +5 -1
  15. data/lib/rubygems/installer.rb +117 -38
  16. data/lib/rubygems/package.rb +135 -25
  17. data/lib/rubygems/remote_installer.rb +59 -29
  18. data/lib/rubygems/rubygems_version.rb +1 -1
  19. data/lib/rubygems/security.rb +478 -0
  20. data/lib/rubygems/specification.rb +48 -28
  21. data/post-install.rb +2 -1
  22. data/scripts/gemdoc.rb +2 -2
  23. data/scripts/specdoc.rb +25 -24
  24. data/scripts/upload_gemdoc.rb +134 -0
  25. data/setup.rb +1 -1
  26. data/test/data/a-0.0.1.gem +0 -0
  27. data/test/data/a-0.0.2.gem +0 -0
  28. data/test/data/b-0.0.2.gem +0 -0
  29. data/test/data/c-1.2.gem +0 -0
  30. data/test/data/gemhome/cache/a-0.0.1.gem +0 -0
  31. data/test/data/gemhome/cache/a-0.0.2.gem +0 -0
  32. data/test/data/gemhome/cache/b-0.0.2.gem +0 -0
  33. data/test/data/gemhome/cache/c-1.2.gem +0 -0
  34. data/test/data/gemhome/specifications/a-0.0.1.gemspec +1 -1
  35. data/test/data/gemhome/specifications/a-0.0.2.gemspec +1 -1
  36. data/test/data/gemhome/specifications/b-0.0.2.gemspec +1 -1
  37. data/test/data/gemhome/specifications/c-1.2.gemspec +1 -1
  38. data/test/data/one/one-0.0.1.gem +0 -0
  39. data/test/fake_certlib/openssl.rb +1 -0
  40. data/test/functional.rb +49 -14
  41. data/test/gemutilities.rb +69 -5
  42. data/test/test_cached_fetcher.rb +5 -7
  43. data/test/test_file_list.rb +96 -0
  44. data/test/test_gempaths.rb +36 -34
  45. data/test/test_installer.rb +214 -0
  46. data/test/test_local_cache.rb +45 -102
  47. data/test/test_parse_commands.rb +3 -1
  48. data/test/test_remote_installer.rb +24 -5
  49. data/test/test_specific_extras.rb +40 -0
  50. data/test/test_specification.rb +106 -16
  51. metadata +14 -3
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'test/unit'
4
+ require 'rubygems/cmd_manager'
5
+ require 'rubygems/user_interaction'
6
+ require 'test/mockgemui'
7
+
8
+ class TestSpecificExtras < Test::Unit::TestCase
9
+ include Gem::DefaultUserInteraction
10
+
11
+ def setup
12
+ @cm = Gem::CommandManager.new
13
+ @cmd = @cm['rdoc']
14
+ end
15
+
16
+
17
+ def test_add_extra_args
18
+ added_args = ["--all"]
19
+ command = "rdoc"
20
+ Gem::Command.add_specific_extra_args command, added_args
21
+
22
+ assert_equal(added_args, Gem::Command.specific_extra_args(command))
23
+
24
+ Gem::Command.instance_eval "public :add_extra_args"
25
+ h = @cmd.add_extra_args([])
26
+ assert_equal(added_args,h)
27
+ end
28
+
29
+ def test_add_extra_args_unknown
30
+ added_args = ["--definitely_not_there"]
31
+ command = "rdoc"
32
+ Gem::Command.add_specific_extra_args command, added_args
33
+
34
+ assert_equal(added_args, Gem::Command.specific_extra_args(command))
35
+
36
+ Gem::Command.instance_eval "public :add_extra_args"
37
+ h = @cmd.add_extra_args([])
38
+ assert_equal([],h)
39
+ end
40
+ end
@@ -1,4 +1,5 @@
1
1
  require 'test/unit'
2
+ require 'test/gemutilities'
2
3
  require 'rubygems'
3
4
  Gem::manage_gems
4
5
 
@@ -105,7 +106,7 @@ class TestSimpleSpecification < Test::Unit::TestCase
105
106
  require_paths authors email homepage rubyforge_project description
106
107
  autorequire default_executable bindir has_rdoc required_ruby_version
107
108
  platform files test_files rdoc_options extra_rdoc_files
108
- executables extensions requirements dependencies
109
+ executables extensions requirements dependencies signing_key cert_chain
109
110
  }.sort
110
111
  actual_value = Gem::Specification.attribute_names.map { |a| a.to_s }.sort
111
112
  assert_equal expected_value, actual_value
@@ -157,6 +158,107 @@ class TestSimpleSpecification < Test::Unit::TestCase
157
158
  end
158
159
  end # class TestSimpleSpecification
159
160
 
161
+ class TestSpecification < RubyGemTestCase
162
+
163
+ def setup
164
+ super
165
+ @spec = quick_gem "TestSpecification"
166
+ end
167
+
168
+ def test_autorequire_array
169
+ name = "AutorequireArray"
170
+ files = %w(a.rb b.rb)
171
+ gem = quick_gem(name) do |s|
172
+ s.files = files.map { |f| File.join("lib", f) }
173
+ s.autorequire = files
174
+ end
175
+
176
+ fullname = gem.full_name
177
+
178
+ write_file("gems/#{fullname}/lib/a.rb") do |io|
179
+ io.puts "$LOADED_A = true"
180
+ end
181
+
182
+ write_file("gems/#{fullname}/lib/b.rb") do |io|
183
+ io.puts "$LOADED_B = true"
184
+ end
185
+
186
+ old_loaded = $".dup
187
+ require_gem name
188
+ new_loaded = $".dup
189
+
190
+ assert_equal(files, (new_loaded - old_loaded))
191
+ assert(defined? $LOADED_A)
192
+ assert(defined? $LOADED_B)
193
+ end
194
+
195
+ def test_autorequire_string
196
+ name = "AutorequireString"
197
+ file = "c.rb"
198
+ gem = quick_gem(name) do |s|
199
+ s.files = File.join("lib", file)
200
+ s.autorequire = file
201
+ end
202
+
203
+ fullname = gem.full_name
204
+
205
+ write_file("gems/#{fullname}/lib/c.rb") do |io|
206
+ io.puts "$LOADED_C = true"
207
+ end
208
+
209
+ old_loaded = $".dup
210
+ require_gem name
211
+ new_loaded = $".dup
212
+
213
+ assert_equal(Array(file), (new_loaded - old_loaded))
214
+ assert(defined? $LOADED_C)
215
+ end
216
+
217
+ def test_date_equals_date
218
+ @spec.date = Date.new(2003, 9, 17)
219
+ assert_equal Time.local(2003, 9, 17, 0,0,0), @spec.date
220
+ end
221
+
222
+ def test_date_equals_string
223
+ @spec.date = '2003-09-17'
224
+ assert_equal Time.local(2003, 9, 17, 0,0,0), @spec.date
225
+ end
226
+
227
+ def test_date_equals_time
228
+ @spec.date = Time.local(2003, 9, 17, 0,0,0)
229
+ assert_equal Time.local(2003, 9, 17, 0,0,0), @spec.date
230
+ end
231
+
232
+ def test_date_equals_time_local
233
+ # HACK PDT
234
+ @spec.date = Time.local(2003, 9, 17, 19,50,0)
235
+ assert_equal Time.local(2003, 9, 17, 0,0,0), @spec.date
236
+ end
237
+
238
+ def test_date_equals_time_utc
239
+ # HACK PDT
240
+ @spec.date = Time.local(2003, 9, 17, 19,50,0)
241
+ assert_equal Time.local(2003, 9, 17, 0,0,0), @spec.date
242
+ end
243
+
244
+ def test_to_ruby
245
+ today = Time.now.strftime("%Y-%m-%d")
246
+ ruby = "Gem::Specification.new do |s|
247
+ s.name = %q{TestSpecification}
248
+ s.version = \"0.0.2\"
249
+ s.date = %q{#{today}}
250
+ s.summary = %q{this is a summary}
251
+ s.email = %q{example@example.com}
252
+ s.homepage = %q{http://example.com}
253
+ s.description = %q{This is a test description}
254
+ s.has_rdoc = true
255
+ s.authors = [\"A User\"]
256
+ end
257
+ "
258
+ assert_equal ruby, @spec.to_ruby
259
+ end
260
+
261
+ end
160
262
 
161
263
  class TestComplexSpecification < Test::Unit::TestCase
162
264
 
@@ -191,7 +293,7 @@ class TestComplexSpecification < Test::Unit::TestCase
191
293
  assert_equal 'rfoo', @spec.name
192
294
  assert_equal '0.1', @spec.version.to_s
193
295
  assert_equal Gem::Platform::RUBY, @spec.platform
194
- assert_equal Date.today, @spec.date
296
+ assert_equal Time.today, @spec.date
195
297
  assert_equal summary_value, @spec.summary
196
298
  assert_equal summary_value, @spec.description
197
299
  assert_equal "The RubyGems Team", @spec.author
@@ -228,30 +330,19 @@ class TestComplexSpecification < Test::Unit::TestCase
228
330
  assert_equal @spec, same_spec
229
331
  end
230
332
 
231
- # Test different mechanisms for setting the gem's date: String, Time, and
232
- # Date. It should always come out as a Date.
233
- def test_date_settings
234
- @spec.date = '2003-09-17'
235
- assert_equal Date.new(2003, 9, 17), @spec.date
236
- @spec.date = Time.local(2003, 9, 17)
237
- assert_equal Date.new(2003, 9, 17), @spec.date
238
- @spec.date = Date.new(2003, 9, 17)
239
- assert_equal Date.new(2003, 9, 17), @spec.date
240
- end
241
333
  end # class TestComplexSpecification
242
334
 
243
-
244
335
  class TestLegacyRubySpecification < Test::Unit::TestCase
245
336
  def setup
246
337
  @ruby_spec = File.read(LEGACY_GEM_SPEC_FILE)
247
338
  end
248
339
 
249
- def test_eval
340
+ def test_load_legacy
250
341
  s = gemspec = eval(@ruby_spec)
251
342
  assert_equal 'keyedlist', s.name
252
343
  assert_equal '0.4.0', s.version.to_s
253
344
  assert_equal true, s.has_rdoc?
254
- assert_equal Date.today, s.date
345
+ assert_equal Time.today, s.date
255
346
  assert s.required_ruby_version.satisfied_by?(Gem::Version.new('0.0.1'))
256
347
  assert_equal false, s.has_unit_tests?
257
348
  end
@@ -264,7 +355,6 @@ class TestLegacyRubySpecification < Test::Unit::TestCase
264
355
  end
265
356
  end # class TestLegacyRubySpecification
266
357
 
267
-
268
358
  class TestLegacyYamlSpecification < Test::Unit::TestCase
269
359
  def setup
270
360
  @yaml_spec = File.read(LEGACY_GEM_YAML_FILE)
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.9.2
2
+ rubygems_version: 0.8.10.99
3
3
  specification_version: 1
4
4
  name: rubygems-update
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.8.10
7
- date: 2005-03-25
6
+ version: 0.8.11
7
+ date: 2005-07-13 00:00:00 -04:00
8
8
  summary: RubyGems Update GEM
9
9
  require_paths:
10
10
  - lib
@@ -24,6 +24,8 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
24
24
  version: 0.0.0
25
25
  version:
26
26
  platform: ruby
27
+ signing_key:
28
+ cert_chain:
27
29
  authors:
28
30
  - RubyGems Team
29
31
  files:
@@ -39,6 +41,7 @@ files:
39
41
  - bin/gem_server
40
42
  - bin/generate_yaml_index.rb
41
43
  - bin/update_rubygems
44
+ - bin/gem_mirror
42
45
  - doc/doc.css
43
46
  - doc/makedoc.rb
44
47
  - examples/application
@@ -85,6 +88,8 @@ files:
85
88
  - lib/rubygems/version.rb
86
89
  - lib/rubygems/gem_commands.rb
87
90
  - lib/rubygems/dependency_list.rb
91
+ - lib/rubygems/security.rb
92
+ - lib/rubygems/gem_openssl.rb
88
93
  - pkgs/sources
89
94
  - pkgs/sources/lib
90
95
  - pkgs/sources/sources.gemspec
@@ -94,6 +99,7 @@ files:
94
99
  - scripts/gemdoc.rb
95
100
  - scripts/runtest.rb
96
101
  - scripts/specdoc.rb
102
+ - scripts/upload_gemdoc.rb
97
103
  - test/data
98
104
  - test/mock
99
105
  - test/bogussources.rb
@@ -128,7 +134,11 @@ files:
128
134
  - test/yaml_data.rb
129
135
  - test/test_dependency_list.rb
130
136
  - test/test_deployment.rb
137
+ - test/fake_certlib
131
138
  - test/test_require_gem.rb
139
+ - test/test_installer.rb
140
+ - test/test_file_list.rb
141
+ - test/test_specific_extras.rb
132
142
  - test/data/gems
133
143
  - test/data/one
134
144
  - test/data/legacy
@@ -180,6 +190,7 @@ files:
180
190
  - test/mock/gems/gems/sources-0.0.1/lib
181
191
  - test/mock/gems/gems/sources-0.0.1/lib/sources.rb
182
192
  - test/mock/gems/specifications/sources-0.0.1.gemspec
193
+ - test/fake_certlib/openssl.rb
183
194
  test_files: []
184
195
  rdoc_options: []
185
196
  extra_rdoc_files: []