https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112010-12-16T09:21:44ZRuby Issue Tracking SystemRuby master - Bug #4163: RubyGems uses deprecated API: YAML.quick_emit.https://redmine.ruby-lang.org/issues/4163?journal_id=146872010-12-16T09:21:44Ztenderlovemaking (Aaron Patterson)tenderlove@ruby-lang.org
<ul></ul><p>=begin<br>
On Thu, Dec 16, 2010 at 04:46:33AM +0900, Yui NARUSE wrote:</p>
<blockquote>
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: RubyGems uses deprecated API: YAML.quick_emit. (Closed)" href="https://redmine.ruby-lang.org/issues/4163">#4163</a>: RubyGems uses deprecated API: YAML.quick_emit.<br>
<a href="http://redmine.ruby-lang.org/issues/show/4163" class="external">http://redmine.ruby-lang.org/issues/show/4163</a></p>
<p>Author: Yui NARUSE<br>
Status: Assigned, Priority: Normal<br>
Assigned to: Eric Hodel, Category: lib, Target version: 1.9.3<br>
ruby -v: ruby 1.9.3dev (2010-12-15 trunk 30218) [x86_64-freebsd8.1]</p>
<p>RubyGems::Specification#to_yaml uses depcrecated API: YAML.quick_emit,<br>
and it show many warnings on make test-all.<br>
/usr/home/chkbuild/build/ruby-trunk//ruby/lib/rubygems/specification.rb:706:in `to_yaml': YAML.quick_emit is deprecated</p>
</blockquote>
<p>Hi Naruse,</p>
<p>How are you running the tests? <code>make test-all TESTS=rubygems</code> doesn't<br>
add the -w flag for me. I'm unsure how to run the tests with warnings<br>
turned on. :-(</p>
<p>--<br>
Aaron Patterson<br>
<a href="http://tenderlovemaking.com/" class="external">http://tenderlovemaking.com/</a></p>
<p>Attachment: (unnamed)<br>
=end</p> Ruby master - Bug #4163: RubyGems uses deprecated API: YAML.quick_emit.https://redmine.ruby-lang.org/issues/4163?journal_id=146882010-12-16T10:06:49Znaruse (Yui NARUSE)naruse@airemix.jp
<ul></ul><p>=begin<br>
Hi Aaron,</p>
<p>2010/12/16 Aaron Patterson <a href="mailto:aaron@tenderlovemaking.com" class="email">aaron@tenderlovemaking.com</a>:</p>
<blockquote>
<p>How are you running the tests? <code>make test-all TESTS=rubygems</code> doesn't<br>
add the -w flag for me. I'm unsure how to run the tests with warnings<br>
turned on. :-(</p>
</blockquote>
<p>To give -w flag to ruby, you can use RUBYOPT environment variable.<br>
So for make test-all, it will be<br>
make RUBYOPT=-w TESTS=rubygems test-all</p>
<p>FYI, I run test as following:<br>
make RUBYOPT=-w TESTS='-v' TMPDIR=/tmp/test-all test-all|&tee t.log</p>
<p>To show each test name, I specify -v.<br>
To make easy to clean tempfiles when ruby crashs and remain tempfiles,<br>
I specify TMPDIR.<br>
To keep the log, I use |& of zsh.</p>
<p>You may know following options for TESTS are also useful:<br>
-n, --name PATTERN Filter test names on pattern.<br>
-x, --exclude PATTERN Exclude test files on pattern.</p>
<p>--<br>
NARUSE, Yui<br>
<a href="mailto:naruse@airemix.jp" class="email">naruse@airemix.jp</a></p>
<p>=end</p> Ruby master - Bug #4163: RubyGems uses deprecated API: YAML.quick_emit.https://redmine.ruby-lang.org/issues/4163?journal_id=146892010-12-16T11:13:08Ztenderlovemaking (Aaron Patterson)tenderlove@ruby-lang.org
<ul></ul><p>=begin<br>
On Thu, Dec 16, 2010 at 10:06:08AM +0900, NARUSE, Yui wrote:</p>
<blockquote>
<p>Hi Aaron,</p>
<p>2010/12/16 Aaron Patterson <a href="mailto:aaron@tenderlovemaking.com" class="email">aaron@tenderlovemaking.com</a>:</p>
<blockquote>
<p>How are you running the tests? <code>make test-all TESTS=rubygems</code> doesn't<br>
add the -w flag for me. I'm unsure how to run the tests with warnings<br>
turned on. :-(</p>
</blockquote>
<p>To give -w flag to ruby, you can use RUBYOPT environment variable.<br>
So for make test-all, it will be<br>
make RUBYOPT=-w TESTS=rubygems test-all</p>
<p>FYI, I run test as following:<br>
make RUBYOPT=-w TESTS='-v' TMPDIR=/tmp/test-all test-all|&tee t.log</p>
</blockquote>
<p>Excellent. I didn't know RUBYOPT would be honored while running<br>
everything through make. Thank you.</p>
<p>--<br>
Aaron Patterson<br>
<a href="http://tenderlovemaking.com/" class="external">http://tenderlovemaking.com/</a></p>
<p>Attachment: (unnamed)<br>
=end</p> Ruby master - Bug #4163: RubyGems uses deprecated API: YAML.quick_emit.https://redmine.ruby-lang.org/issues/4163?journal_id=146902010-12-16T11:15:02Ztenderlovemaking (Aaron Patterson)tenderlove@ruby-lang.org
<ul></ul><p>=begin<br>
On Thu, Dec 16, 2010 at 04:46:33AM +0900, Yui NARUSE wrote:</p>
<blockquote>
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: RubyGems uses deprecated API: YAML.quick_emit. (Closed)" href="https://redmine.ruby-lang.org/issues/4163">#4163</a>: RubyGems uses deprecated API: YAML.quick_emit.<br>
<a href="http://redmine.ruby-lang.org/issues/show/4163" class="external">http://redmine.ruby-lang.org/issues/show/4163</a></p>
<p>Author: Yui NARUSE<br>
Status: Assigned, Priority: Normal<br>
Assigned to: Eric Hodel, Category: lib, Target version: 1.9.3<br>
ruby -v: ruby 1.9.3dev (2010-12-15 trunk 30218) [x86_64-freebsd8.1]</p>
<p>RubyGems::Specification#to_yaml uses depcrecated API: YAML.quick_emit,<br>
and it show many warnings on make test-all.<br>
/usr/home/chkbuild/build/ruby-trunk//ruby/lib/rubygems/specification.rb:706:in `to_yaml': YAML.quick_emit is deprecated</p>
</blockquote>
<p>The following patch eliminates the deprecated calls and is backwards compatible<br>
with Ruby 1.8. I will submit a patch against the Rubygems repository<br>
and bug tracker.</p>
<p>diff --git a/lib/rubygems/builder.rb b/lib/rubygems/builder.rb<br>
index 2bcd4b0..ff6d922 100644<br>
--- a/lib/rubygems/builder.rb<br>
+++ b/lib/rubygems/builder.rb<br>
@@ -20,6 +20,11 @@ class Gem::Builder<br>
# spec:: [Gem::Specification] The specification instance</p>
<pre><code>def initialize(spec)
</code></pre>
<ul>
<li>begin</li>
<li>
<pre><code> require 'psych'
</code></pre>
</li>
<li>rescue LoadError</li>
<li>end</li>
<li>require "yaml"<br>
require "rubygems/package"<br>
require "rubygems/security"<br>
@@ -72,7 +77,8 @@ EOM<br>
def write_package<br>
open @spec.file_name, 'wb' do |gem_io|<br>
Gem::Package.open gem_io, 'w', @signer do |pkg|</li>
</ul>
<ul>
<li>
<pre><code> pkg.metadata = @spec.to_yaml
</code></pre>
</li>
</ul>
<ul>
<li>
<pre><code> yaml = defined?(Psych) ? Psych.dump(@spec) : YAML.dump(@spec)
</code></pre>
</li>
<li>
<pre><code> pkg.metadata = yaml
@spec.files.each do |file|
next if File.directory? file
</code></pre>
</li>
</ul>
<p>--<br>
Aaron Patterson<br>
<a href="http://tenderlovemaking.com/" class="external">http://tenderlovemaking.com/</a></p>
<p>Attachment: (unnamed)<br>
=end</p> Ruby master - Bug #4163: RubyGems uses deprecated API: YAML.quick_emit.https://redmine.ruby-lang.org/issues/4163?journal_id=156552011-02-03T10:40:50Zdrbrain (Eric Hodel)drbrain@segment7.net
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>=begin<br>
Fixed by import of RubyGems 1.5<br>
=end</p> Ruby master - Bug #4163: RubyGems uses deprecated API: YAML.quick_emit.https://redmine.ruby-lang.org/issues/4163?journal_id=284192012-07-25T15:13:47Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/28419/diff?detail_id=21026">diff</a>)</li><li><strong>Status</strong> changed from <i>Closed</i> to <i>Assigned</i></li><li><strong>Target version</strong> changed from <i>1.9.3</i> to <i>2.0.0</i></li></ul><p>drbrain (Eric Hodel) wrote:</p>
<blockquote>
<p>Fixed by import of RubyGems 1.5</p>
</blockquote>
<p>lib/rubygems/specification.rb still uses YAML.quick_emit.</p> Ruby master - Bug #4163: RubyGems uses deprecated API: YAML.quick_emit.https://redmine.ruby-lang.org/issues/4163?journal_id=285592012-07-31T09:55:26Zdrbrain (Eric Hodel)drbrain@segment7.net
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>Only if psych is not available, so it is OK.</p>