diff options
Diffstat (limited to 'activesupport/lib')
6 files changed, 18 insertions, 3 deletions
diff --git a/activesupport/lib/active_support.rb b/activesupport/lib/active_support.rb index 33ed840aa7..e7117e22be 100644 --- a/activesupport/lib/active_support.rb +++ b/activesupport/lib/active_support.rb @@ -24,6 +24,8 @@ $:.unshift(File.dirname(__FILE__)) $:.unshift(File.dirname(__FILE__) + "/active_support/vendor") +require 'rubygems' + require 'active_support/basic_object' require 'active_support/inflector' diff --git a/activesupport/lib/active_support/basic_object.rb b/activesupport/lib/active_support/basic_object.rb index 7a3d1a9ed0..1464f9d9b7 100644 --- a/activesupport/lib/active_support/basic_object.rb +++ b/activesupport/lib/active_support/basic_object.rb @@ -1,6 +1,5 @@ -# Ruby 1.9 introduces BasicObject. Use Builder's BlankSlate before then. +# Ruby 1.9 introduces BasicObject. Use Builder's BlankSlate until then. unless defined? BasicObject - require 'rubygems' - require 'builder' + require 'builder/blankslate' BasicObject = Builder::BlankSlate end diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb index 8205843a2b..89a4499369 100644 --- a/activesupport/lib/active_support/core_ext/array/conversions.rb +++ b/activesupport/lib/active_support/core_ext/array/conversions.rb @@ -1,3 +1,5 @@ +require 'builder' + module ActiveSupport #:nodoc: module CoreExtensions #:nodoc: module Array #:nodoc: diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb index 97b4301bdd..6ac913e5b9 100644 --- a/activesupport/lib/active_support/core_ext/hash/conversions.rb +++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb @@ -2,6 +2,7 @@ require 'date' require 'xml_simple' require 'cgi' require 'base64' +require 'builder' # Extensions needed for Hash#to_query class Object diff --git a/activesupport/lib/active_support/core_ext/string.rb b/activesupport/lib/active_support/core_ext/string.rb index 724b2af2ee..b3e1b1189a 100644 --- a/activesupport/lib/active_support/core_ext/string.rb +++ b/activesupport/lib/active_support/core_ext/string.rb @@ -4,6 +4,7 @@ require 'active_support/core_ext/string/access' require 'active_support/core_ext/string/starts_ends_with' require 'active_support/core_ext/string/iterators' unless 'test'.respond_to?(:each_char) require 'active_support/core_ext/string/unicode' +require 'active_support/core_ext/string/xchar' class String #:nodoc: include ActiveSupport::CoreExtensions::String::Access diff --git a/activesupport/lib/active_support/core_ext/string/xchar.rb b/activesupport/lib/active_support/core_ext/string/xchar.rb new file mode 100644 index 0000000000..d6aa4aa036 --- /dev/null +++ b/activesupport/lib/active_support/core_ext/string/xchar.rb @@ -0,0 +1,10 @@ +begin + require 'fast_xs' + + class String + alias_method :original_xs, :to_xs if method_defined?(:to_xs) + alias_method :to_xs, :fast_xs + end +rescue LoadError + # fast_xs extension unavailable. +end |