[macruby-changes] [2163] MacRuby/branches/experimental

source_changes at macosforge.org source_changes at macosforge.org
Mon Aug 3 10:45:34 PDT 2009


Revision: 2163
          http://trac.macosforge.org/projects/ruby/changeset/2163
Author:   pthomson at apple.com
Date:     2009-08-03 10:45:34 -0700 (Mon, 03 Aug 2009)
Log Message:
-----------
Made yaml.rb simply load 'libyaml'. Ugly hack, but it'll work for now.

Modified Paths:
--------------
    MacRuby/branches/experimental/ext/libyaml/rubyext.c
    MacRuby/branches/experimental/lib/yaml.rb

Modified: MacRuby/branches/experimental/ext/libyaml/rubyext.c
===================================================================
--- MacRuby/branches/experimental/ext/libyaml/rubyext.c	2009-08-03 17:45:32 UTC (rev 2162)
+++ MacRuby/branches/experimental/ext/libyaml/rubyext.c	2009-08-03 17:45:34 UTC (rev 2163)
@@ -161,6 +161,15 @@
 {
 	VALUE parser = rb_yaml_parser_alloc(rb_cParser, 0);
 	VALUE ary = rb_yaml_parser_load(parser, 0, input);
+	if (RARRAY_LEN(ary) == 1)
+	{
+		VALUE unit = RARRAY_AT(ary, 0);
+		if (TYPE(unit) == T_ARRAY)
+		{
+			return unit;
+		}
+	}
+	return ary;
 }
 
 static VALUE

Modified: MacRuby/branches/experimental/lib/yaml.rb
===================================================================
--- MacRuby/branches/experimental/lib/yaml.rb	2009-08-03 17:45:32 UTC (rev 2162)
+++ MacRuby/branches/experimental/lib/yaml.rb	2009-08-03 17:45:34 UTC (rev 2163)
@@ -6,6 +6,10 @@
 # Author:: why the lucky stiff
 # 
 
+require 'libyaml'
+
+=begin
+
 require 'stringio'
 require 'yaml/error'
 require 'yaml/syck'
@@ -437,4 +441,4 @@
     private :y
 end
 
-
+=end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090803/3b1739ff/attachment-0001.html>


More information about the macruby-changes mailing list