diff options
author | Xavier Noria <fxn@hashref.com> | 2010-04-05 12:15:08 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-04-05 12:15:08 -0700 |
commit | 89978f10afbad3f856e2959a811bed1982715408 (patch) | |
tree | 9913b04ec5a63e4e88dd70de023dc50029c43690 /activesupport/lib/active_support/core_ext | |
parent | c140aca361506a3a759fbe03fad8adc748c807bb (diff) | |
download | rails-89978f10afbad3f856e2959a811bed1982715408.tar.gz rails-89978f10afbad3f856e2959a811bed1982715408.tar.bz2 rails-89978f10afbad3f856e2959a811bed1982715408.zip |
moves Object#singleton_class to Kernel#singleton_class to match Ruby also there, same for #class_eval to simplify, and adds coverage for class_eval
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/attribute.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/delegating_attributes.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/kernel.rb | 1 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/kernel/singleton_class.rb (renamed from activesupport/lib/active_support/core_ext/object/singleton_class.rb) | 6 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/object.rb | 1 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/output_safety.rb | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/attribute.rb b/activesupport/lib/active_support/core_ext/class/attribute.rb index 577d5cbf45..725acad43a 100644 --- a/activesupport/lib/active_support/core_ext/class/attribute.rb +++ b/activesupport/lib/active_support/core_ext/class/attribute.rb @@ -1,4 +1,4 @@ -require 'active_support/core_ext/object/singleton_class' +require 'active_support/core_ext/kernel/singleton_class' require 'active_support/core_ext/module/delegation' require 'active_support/core_ext/module/remove_method' diff --git a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb index 12caa76c98..29bf7c0f3d 100644 --- a/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +++ b/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb @@ -1,6 +1,6 @@ require 'active_support/core_ext/object/blank' require 'active_support/core_ext/array/extract_options' -require 'active_support/core_ext/object/singleton_class' +require 'active_support/core_ext/kernel/singleton_class' require 'active_support/core_ext/module/remove_method' class Class diff --git a/activesupport/lib/active_support/core_ext/kernel.rb b/activesupport/lib/active_support/core_ext/kernel.rb index c3bed14f63..01cfe7fc10 100644 --- a/activesupport/lib/active_support/core_ext/kernel.rb +++ b/activesupport/lib/active_support/core_ext/kernel.rb @@ -2,3 +2,4 @@ require 'active_support/core_ext/kernel/reporting' require 'active_support/core_ext/kernel/agnostics' require 'active_support/core_ext/kernel/requires' require 'active_support/core_ext/kernel/debugger' +require 'active_support/core_ext/kernel/singleton_class' diff --git a/activesupport/lib/active_support/core_ext/object/singleton_class.rb b/activesupport/lib/active_support/core_ext/kernel/singleton_class.rb index 8dee54e71b..33612155fb 100644 --- a/activesupport/lib/active_support/core_ext/object/singleton_class.rb +++ b/activesupport/lib/active_support/core_ext/kernel/singleton_class.rb @@ -1,12 +1,12 @@ -class Object +module Kernel # Returns the object's singleton class. def singleton_class class << self self end - end unless respond_to?(:singleton_class) + end unless respond_to?(:singleton_class) # exists in 1.9.2 - # class_eval on an object acts like singleton_class_eval. + # class_eval on an object acts like singleton_class.class_eval. def class_eval(*args, &block) singleton_class.class_eval(*args, &block) end diff --git a/activesupport/lib/active_support/core_ext/object.rb b/activesupport/lib/active_support/core_ext/object.rb index 4f86d9d605..3a6100f776 100644 --- a/activesupport/lib/active_support/core_ext/object.rb +++ b/activesupport/lib/active_support/core_ext/object.rb @@ -5,7 +5,6 @@ require 'active_support/core_ext/object/try' require 'active_support/core_ext/object/conversions' require 'active_support/core_ext/object/instance_variables' -require 'active_support/core_ext/object/singleton_class' require 'active_support/core_ext/object/misc' require 'active_support/core_ext/object/extending' diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index 3ee5bcaab4..b53929c2a3 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -1,5 +1,5 @@ require 'erb' -require 'active_support/core_ext/object/singleton_class' +require 'active_support/core_ext/kernel/singleton_class' class ERB module Util |