[前][次][番号順一覧][スレッド一覧]

ruby-changes:16685

From: tenderlove <ko1@a...>
Date: Mon, 19 Jul 2010 13:56:15 +0900 (JST)
Subject: [ruby-changes:16685] Ruby:r28681 (trunk): * ext/syck/lib/syck.rb: fixing unused variable warnings

tenderlove	2010-07-19 13:54:06 +0900 (Mon, 19 Jul 2010)

  New Revision: 28681

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28681

  Log:
    * ext/syck/lib/syck.rb: fixing unused variable warnings
    * ext/syck/lib/syck/basenode.rb: ditto
    * ext/syck/lib/syck/rubytypes.rb: ditto

  Modified files:
    trunk/ext/syck/lib/syck/basenode.rb
    trunk/ext/syck/lib/syck/rubytypes.rb
    trunk/ext/syck/lib/syck.rb

Index: ext/syck/lib/syck/basenode.rb
===================================================================
--- ext/syck/lib/syck/basenode.rb	(revision 28680)
+++ ext/syck/lib/syck/basenode.rb	(revision 28681)
@@ -83,7 +83,6 @@
         def match_path( ypath_str )
             warn "#{caller[0]}: match_path is deprecated" if $VERBOSE
             require 'syck/ypath'
-            depth = 0
             matches = []
             YPath.each_path( ypath_str ) do |ypath|
                 seg = match_segment( ypath, 0 )
Index: ext/syck/lib/syck/rubytypes.rb
===================================================================
--- ext/syck/lib/syck/rubytypes.rb	(revision 28680)
+++ ext/syck/lib/syck/rubytypes.rb	(revision 28681)
@@ -61,7 +61,7 @@
             props = {}
             val.delete_if { |k,v| props[k] = v if k =~ /^@/ }
             begin
-                struct_name, struct_type = YAML.read_type_class( tag, Struct )
+                struct_type = YAML.read_type_class( tag, Struct ).last
             rescue NameError
             end
             if not struct_type
Index: ext/syck/lib/syck.rb
===================================================================
--- ext/syck/lib/syck.rb	(revision 28680)
+++ ext/syck/lib/syck.rb	(revision 28681)
@@ -132,7 +132,7 @@
     #      #=> :locked
     #
     def self.load( io )
-        yp = parser.load( io )
+        parser.load( io )
     end
 
     #
@@ -175,7 +175,7 @@
     #            @value=":locked", @kind=:scalar>
     #
     def self.parse( io )
-        yp = generic_parser.load( io )
+        generic_parser.load( io )
     end
 
     #
@@ -217,7 +217,7 @@
     #
     def self.each_document( io, &block )
         warn "#{caller[0]}: YAML.each_document is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
-        yp = parser.load_documents( io, &block )
+        parser.load_documents( io, &block )
     end
 
     #
@@ -232,7 +232,7 @@
     #   end
     #
     def self.load_documents( io, &doc_proc )
-        yp = parser.load_documents( io, &doc_proc )
+        parser.load_documents( io, &doc_proc )
     end
 
     #
@@ -248,7 +248,7 @@
     #
     def self.each_node( io, &doc_proc )
         warn "#{caller[0]}: YAML.each_node is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
-        yp = generic_parser.load_documents( io, &doc_proc )
+        generic_parser.load_documents( io, &doc_proc )
     end
 
     #
@@ -366,7 +366,7 @@
     #
     def self.read_type_class( type, obj_class )
         warn "#{caller[0]}: YAML.read_type_class is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
-        scheme, domain, type, tclass = type.split( ':', 4 )
+        type, tclass = type.split( ':', 4 ).last(2)
         tclass.split( "::" ).each { |c| obj_class = obj_class.const_get( c ) } if tclass
         return [ type, obj_class ]
     end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]