Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
diff --git a/src/org/jruby/RubyYAML.java b/src/org/jruby/RubyYAML.java index e464f0f..3a8c803 100644 --- a/src/org/jruby/RubyYAML.java +++ b/src/org/jruby/RubyYAML.java @@ -432,8 +432,10 @@ public class RubyYAML { } @JRubyMethod(name = "to_yaml", rest = true) public static IRubyObject obj_to_yaml(IRubyObject self, IRubyObject[] args) { - ThreadContext context = self.getRuntime().getCurrentContext(); - return self.getRuntime().fastGetModule("YAML").callMethod(context,"dump", self); + IRubyObject[] newArgs = new IRubyObject[args.length + 1]; + newArgs[0] = self; + System.arraycopy(args, 0, newArgs, 1, args.length); + return dump(self.getRuntime().fastGetModule("YAML"), newArgs); } @JRubyMethod(name = "taguri") public static IRubyObject obj_taguri(IRubyObject self) {
This paste will be private.
From the Design Piracy series on my blog: