aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-11-24 11:05:07 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2008-11-24 11:05:07 -0800
commite06c5bef7f73e05e6867343ec0bf3091b8eb0a92 (patch)
treeaa2915c5aa7fbca29d2f9354901b3758bc525e89 /activesupport
parent1cbdd53bd383e7d1dc34cad50c22ff5a330bbf91 (diff)
downloadrails-e06c5bef7f73e05e6867343ec0bf3091b8eb0a92.tar.gz
rails-e06c5bef7f73e05e6867343ec0bf3091b8eb0a92.tar.bz2
rails-e06c5bef7f73e05e6867343ec0bf3091b8eb0a92.zip
Revert "Hack builder to look for fast_xs instead of insisting on its own String#to_xs"
This reverts commit 5d3712a81e502f46b2745d238d9bb76fcdb31f5b.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb4
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb1
2 files changed, 2 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb b/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb
index a1990be37a..8bdbd05899 100644
--- a/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb
+++ b/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb
@@ -18,6 +18,7 @@ module Builder
end
if ! defined?(Builder::XChar)
+ Builder.check_for_name_collision(String, "to_xs")
Builder.check_for_name_collision(Fixnum, "xchr")
end
@@ -104,12 +105,11 @@ end
# Enhance the String class with a XML escaped character version of
# to_s.
#
-require 'active_support/core_ext/string/xchar'
class String
# XML escaped version of to_s
def to_xs
unpack('U*').map {|n| n.xchr}.join # ASCII, UTF-8
rescue
unpack('C*').map {|n| n.xchr}.join # ISO-8859-1, WIN-1252
- end unless method_defined?(:to_xs)
+ end
end
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 30cbba26b0..1e5cd25527 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -1,5 +1,4 @@
require 'abstract_unit'
-require 'builder'
class HashExtTest < Test::Unit::TestCase
def setup