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

ruby-changes:22865

From: tenderlove <ko1@a...>
Date: Tue, 6 Mar 2012 02:33:06 +0900 (JST)
Subject: [ruby-changes:22865] tenderlove:r34914 (trunk): * ext/psych/lib/psych/core_ext.rb: only extend Kernel if IRB is loaded

tenderlove	2012-03-06 02:32:53 +0900 (Tue, 06 Mar 2012)

  New Revision: 34914

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

  Log:
    * ext/psych/lib/psych/core_ext.rb: only extend Kernel if IRB is loaded
      in order to stop method pollution.

  Modified files:
    trunk/ChangeLog
    trunk/ext/psych/lib/psych/core_ext.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34913)
+++ ChangeLog	(revision 34914)
@@ -1,3 +1,8 @@
+Tue Mar  6 02:31:20 2012  Aaron Patterson <aaron@t...>
+
+	* ext/psych/lib/psych/core_ext.rb: only extend Kernel if IRB is loaded
+	  in order to stop method pollution.
+
 Tue Mar  6 01:34:19 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (block_call): rules for block_call after block_call.
Index: ext/psych/lib/psych/core_ext.rb
===================================================================
--- ext/psych/lib/psych/core_ext.rb	(revision 34913)
+++ ext/psych/lib/psych/core_ext.rb	(revision 34914)
@@ -30,6 +30,7 @@
   alias :yaml_as :psych_yaml_as
 end
 
+if defined?(::IRB)
 module Kernel
   def psych_y *objects
     puts Psych.dump_stream(*objects)
@@ -38,3 +39,4 @@
   alias y psych_y
   private :y
 end
+end

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

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