rubygems-update 1.8.18 → 1.8.19

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.

@@ -1,5 +1,13 @@
1
1
  # coding: UTF-8
2
2
 
3
+ === 1.8.19 / 2012-03-14
4
+
5
+ * 3 bug fixes:
6
+
7
+ * Handle loading psych vs syck properly. Fixes #298
8
+ * Make sure Date objects don't leak in via Marshal
9
+ * Perform Date => Time coercion on yaml loading. Fixes #266
10
+
3
11
  === 1.8.18 / 2012-03-11
4
12
 
5
13
  * 4 bug fixes:
@@ -120,7 +120,7 @@ require "rubygems/deprecate"
120
120
  # -The RubyGems Team
121
121
 
122
122
  module Gem
123
- VERSION = '1.8.18'
123
+ VERSION = '1.8.19'
124
124
 
125
125
  ##
126
126
  # Raised when RubyGems is unable to load or activate a gem. Contains the
@@ -649,22 +649,39 @@ module Gem
649
649
  def self.load_yaml
650
650
  return if @yaml_loaded
651
651
 
652
- begin
653
- gem 'psych', '~> 1.2', '>= 1.2.1' unless ENV['TEST_SYCK']
654
- rescue Gem::LoadError
655
- # It's OK if the user does not have the psych gem installed. We will
656
- # attempt to require the stdlib version
657
- end
652
+ test_syck = ENV['TEST_SYCK']
658
653
 
659
- begin
660
- # Try requiring the gem version *or* stdlib version of psych.
661
- require 'psych' unless ENV['TEST_SYCK']
662
- rescue ::LoadError
663
- ensure
664
- require 'yaml'
654
+ unless test_syck
655
+ begin
656
+ gem 'psych', '~> 1.2', '>= 1.2.1'
657
+ rescue Gem::LoadError
658
+ # It's OK if the user does not have the psych gem installed. We will
659
+ # attempt to require the stdlib version
660
+ end
661
+
662
+ begin
663
+ # Try requiring the gem version *or* stdlib version of psych.
664
+ require 'psych'
665
+ rescue ::LoadError
666
+ # If we can't load psych, thats fine, go on.
667
+ else
668
+ # If 'yaml' has already been required, then we have to
669
+ # be sure to switch it over to the newly loaded psych.
670
+ if defined?(YAML::ENGINE) && YAML::ENGINE.yamler != "psych"
671
+ YAML::ENGINE.yamler = "psych"
672
+ end
673
+
674
+ require 'rubygems/psych_tree'
675
+ end
665
676
  end
666
677
 
667
- require 'rubygems/psych_tree'
678
+ require 'yaml'
679
+
680
+ # If we're supposed to be using syck, then we may have to force
681
+ # activate it via the YAML::ENGINE API.
682
+ if test_syck and defined?(YAML::ENGINE)
683
+ YAML::ENGINE.yamler = "syck" unless YAML::ENGINE.syck?
684
+ end
668
685
 
669
686
  # Now that we're sure some kind of yaml library is loaded, pull
670
687
  # in our hack to deal with Syck's DefaultKey ugliness.
@@ -61,9 +61,9 @@ class Gem::Commands::FetchCommand < Gem::Command
61
61
  file = "#{spec.full_name}.gem"
62
62
  remote_path = source_uri + "gems/#{file}"
63
63
 
64
- f = Gem::RemoteFetcher.fetcher
64
+ fetch = Gem::RemoteFetcher.fetcher
65
65
 
66
- gem = f.fetch_path remote_path
66
+ gem = fetch.fetch_path remote_path
67
67
 
68
68
  File.open file, "wb" do |f|
69
69
  f.write gem
@@ -1,5 +1,5 @@
1
1
  module Gem
2
- if defined? ::Psych
2
+ if defined? ::Psych::Visitors
3
3
  class NoAliasYAMLTree < Psych::Visitors::YAMLTree
4
4
  def visit_String(str)
5
5
  return super unless str == '=' # or whatever you want
@@ -670,7 +670,7 @@ class Gem::Specification
670
670
  # spec version
671
671
  spec.instance_variable_set :@name, array[2]
672
672
  spec.instance_variable_set :@version, array[3]
673
- spec.instance_variable_set :@date, array[4]
673
+ spec.date = array[4]
674
674
  spec.instance_variable_set :@summary, array[5]
675
675
  spec.instance_variable_set :@required_ruby_version, array[6]
676
676
  spec.instance_variable_set :@required_rubygems_version, array[7]
@@ -1923,6 +1923,13 @@ class Gem::Specification
1923
1923
 
1924
1924
  def to_yaml(opts = {}) # :nodoc:
1925
1925
  if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck? then
1926
+ # Because the user can switch the YAML engine behind our
1927
+ # back, we have to check again here to make sure that our
1928
+ # psych code was properly loaded, and load it if not.
1929
+ unless Gem.const_defined?(:NoAliasYAMLTree)
1930
+ require 'rubygems/psych_tree'
1931
+ end
1932
+
1926
1933
  builder = Gem::NoAliasYAMLTree.new({})
1927
1934
  builder << self
1928
1935
  ast = builder.tree
@@ -2116,7 +2123,13 @@ class Gem::Specification
2116
2123
  # FIX: have this handle the platform/new_platform/original_platform bullshit
2117
2124
  def yaml_initialize(tag, vals) # :nodoc:
2118
2125
  vals.each do |ivar, val|
2119
- instance_variable_set "@#{ivar}", val
2126
+ case ivar
2127
+ when "date"
2128
+ # Force Date to go through the extra coerce logic in date=
2129
+ self.date = val.untaint
2130
+ else
2131
+ instance_variable_set "@#{ivar}", val.untaint
2132
+ end
2120
2133
  end
2121
2134
 
2122
2135
  @original_platform = @platform # for backwards compatibility
@@ -233,6 +233,57 @@ bindir:
233
233
  refute_match %r%DefaultKey%, new_spec.to_ruby
234
234
  end
235
235
 
236
+ def test_self_from_yaml_cleans_up_Date_objects
237
+ yaml = <<-YAML
238
+ --- !ruby/object:Gem::Specification
239
+ rubygems_version: 0.8.1
240
+ specification_version: 1
241
+ name: diff-lcs
242
+ version: !ruby/object:Gem::Version
243
+ version: 1.1.2
244
+ date: 2004-10-20
245
+ summary: Provides a list of changes that represent the difference between two sequenced collections.
246
+ require_paths:
247
+ - lib
248
+ author: Austin Ziegler
249
+ email: diff-lcs@halostatue.ca
250
+ homepage: http://rubyforge.org/projects/ruwiki/
251
+ rubyforge_project: ruwiki
252
+ description: "Test"
253
+ bindir: bin
254
+ has_rdoc: true
255
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
256
+ requirements:
257
+ -
258
+ - ">="
259
+ - !ruby/object:Gem::Version
260
+ version: 1.8.1
261
+ version:
262
+ platform: ruby
263
+ files:
264
+ - tests/00test.rb
265
+ rdoc_options:
266
+ - "--title"
267
+ - "Diff::LCS -- A Diff Algorithm"
268
+ - "--main"
269
+ - README
270
+ - "--line-numbers"
271
+ extra_rdoc_files:
272
+ - README
273
+ - ChangeLog
274
+ - Install
275
+ executables:
276
+ - ldiff
277
+ - htmldiff
278
+ extensions: []
279
+ requirements: []
280
+ dependencies: []
281
+ YAML
282
+
283
+ new_spec = Gem::Specification.from_yaml yaml
284
+
285
+ assert_kind_of Time, new_spec.date
286
+ end
236
287
 
237
288
  def test_self_load
238
289
  full_path = @a2.spec_file
@@ -1491,6 +1542,15 @@ end
1491
1542
  assert_equal Gem::Version.new('1'), @a1.version
1492
1543
  end
1493
1544
 
1545
+ def test__load_fixes_Date_objects
1546
+ spec = new_spec "a", 1
1547
+ spec.instance_variable_set :@date, Date.today
1548
+
1549
+ spec = Marshal.load Marshal.dump(spec)
1550
+
1551
+ assert_kind_of Time, spec.date
1552
+ end
1553
+
1494
1554
  def test_load_errors_contain_filename
1495
1555
  specfile = Tempfile.new(self.class.name.downcase)
1496
1556
  specfile.write "raise 'boom'"
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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 8
9
- - 18
10
- version: 1.8.18
9
+ - 19
10
+ version: 1.8.19
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jim Weirich
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-03-12 00:00:00 Z
20
+ date: 2012-03-14 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: minitest
@@ -25,13 +25,14 @@ dependencies:
25
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
28
- - - ~>
28
+ - - ">="
29
29
  - !ruby/object:Gem::Version
30
- hash: 21
30
+ hash: 37
31
31
  segments:
32
32
  - 2
33
33
  - 11
34
- version: "2.11"
34
+ - 3
35
+ version: 2.11.3
35
36
  type: :development
36
37
  version_requirements: *id001
37
38
  - !ruby/object:Gem::Dependency
@@ -133,11 +134,11 @@ dependencies:
133
134
  requirements:
134
135
  - - ~>
135
136
  - !ruby/object:Gem::Version
136
- hash: 31
137
+ hash: 35
137
138
  segments:
138
139
  - 2
139
- - 14
140
- version: "2.14"
140
+ - 16
141
+ version: "2.16"
141
142
  type: :development
142
143
  version_requirements: *id008
143
144
  description: |-
@@ -384,7 +385,7 @@ post_install_message:
384
385
  rdoc_options:
385
386
  - --main
386
387
  - README.rdoc
387
- - --title=RubyGems 1.8.18 Documentation
388
+ - --title=RubyGems 1.8.19 Documentation
388
389
  require_paths:
389
390
  - hide_lib_for_update
390
391
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -410,7 +411,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
411
  requirements: []
411
412
 
412
413
  rubyforge_project: rubygems
413
- rubygems_version: 1.8.15
414
+ rubygems_version: 1.8.18
414
415
  signing_key:
415
416
  specification_version: 3
416
417
  summary: RubyGems is a package management framework for Ruby