Permalink
Browse files

Merge branch 'master' of https://github.com/rubygems/rubygems

  • Loading branch information...
2 parents 72e5dc4 + 8ef9ca9 commit b71afeb75b52e93279cf1bd3cb48f58514a4dd15 @aef committed Feb 8, 2011
View
@@ -11,7 +11,9 @@
if Socket.gethostname =~ /cibuilder.pivotallabs.com/
# explicitly enable dev list notification only for interpreters which should be green
interpreters_with_enabled_notification = [
- '1.8.7-p302'
+ '1.8.7-p330',
+ '1.9.1-p378',
+ '1.9.2-p136'
]
if interpreters_with_enabled_notification.include?(interpreter)
project.email_notifier.emails = ['rubygems-developers@rubyforge.org']
@@ -536,8 +536,8 @@ def self.load file
def self.normalize_yaml_input(input)
result = input.respond_to?(:read) ? input.read : input
- result = "--- " + result unless result =~ /^--- /
- result
+ result = "--- " + result unless result =~ /\A--- /
+ result.gsub(/ !!null \n/, " \n")
end
##
@@ -720,11 +720,13 @@ def encode_with coder # :nodoc:
end
def to_yaml(opts = {}) # :nodoc:
- return super if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck?
-
- YAML.quick_emit object_id, opts do |out|
- out.map taguri, to_yaml_style do |map|
- encode_with map
+ if YAML.const_defined?(:ENGINE) && !YAML::ENGINE.syck? then
+ super.gsub(/ !!null \n/, " \n")
+ else
+ YAML.quick_emit object_id, opts do |out|
+ out.map taguri, to_yaml_style do |map|
+ encode_with map
+ end
end
end
end
@@ -829,6 +831,7 @@ def to_ruby
# checks..
def validate
+ require 'rubygems/user_interaction'
extend Gem::UserInteraction
normalize
@@ -533,7 +533,7 @@ def initialize
begin
reader = File.open('/dev/null', 'r')
writer = File.open('/dev/null', 'w')
- rescue Errno::ENOENT => e
+ rescue Errno::ENOENT
reader = File.open('nul', 'r')
writer = File.open('nul', 'w')
end
@@ -88,7 +88,6 @@ def test_choose_from_list
end
def test_progress_reporter
- value = nil
out, err = capture_io do
use_ui @sui do
@sui.progress_reporter 10, 'hi'
@@ -100,7 +99,6 @@ def test_progress_reporter
end
def test_download_reporter
- value = nil
out, err = capture_io do
use_ui @sui do
@sui.download_reporter.fetch 'a.gem', 1024
@@ -161,6 +161,13 @@ def test_self_normalize_yaml_input_with_non_183_io
Gem::Specification.normalize_yaml_input(StringIO.new(input))
end
+ def test_self_normalize_yaml_input_with_192_yaml
+ input = "--- !ruby/object:Gem::Specification \nblah: !!null \n"
+ expected = "--- !ruby/object:Gem::Specification \nblah: \n"
+
+ assert_equal expected, Gem::Specification.normalize_yaml_input(input)
+ end
+
def test_initialize
spec = Gem::Specification.new do |s|
s.name = "blah"
@@ -878,6 +885,9 @@ def test_to_ruby_platform
def test_to_yaml
yaml_str = @a1.to_yaml
+
+ refute_match '!!null', yaml_str
+
same_spec = YAML.load(yaml_str)
assert_equal @a1, same_spec

0 comments on commit b71afeb

Please sign in to comment.