diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-05 09:34:00 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-05 09:34:00 -0800 |
commit | 691407375f2d3bdc09f8d0f76d04feb6ed54263e (patch) | |
tree | f0d983d580e2af7e4592f63685468e78d6631897 /lib | |
parent | 99b46899732b32d5ab08b82bcba03f276a281f4f (diff) | |
download | psych-691407375f2d3bdc09f8d0f76d04feb6ed54263e.zip |
* ext/psych/lib/psych/core_ext.rb: only extend Kernel if IRB is loaded
in order to stop method pollution. fixes #50
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psych/core_ext.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/psych/core_ext.rb b/lib/psych/core_ext.rb index 2ad75e1..4a04c2d 100644 --- a/lib/psych/core_ext.rb +++ b/lib/psych/core_ext.rb @@ -30,6 +30,7 @@ class Module 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 @@ module Kernel alias y psych_y private :y end +end |