diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-08 12:25:02 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-08 12:25:02 +0200 |
commit | ad129639c7e72c3ba686db6202a4bff2cb2cfbfe (patch) | |
tree | b07191933aef9bac3e2159fc98683f20aa3388fb /activesupport | |
parent | 67c3469e6ff1b63b091594d6dba7f871023df553 (diff) | |
download | rails-ad129639c7e72c3ba686db6202a4bff2cb2cfbfe.tar.gz rails-ad129639c7e72c3ba686db6202a4bff2cb2cfbfe.tar.bz2 rails-ad129639c7e72c3ba686db6202a4bff2cb2cfbfe.zip |
Fix failing xml mini test.
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/xml_mini.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb index dff8a8f4c4..d8f40ab8b1 100644 --- a/activesupport/lib/active_support/xml_mini.rb +++ b/activesupport/lib/active_support/xml_mini.rb @@ -139,7 +139,10 @@ module ActiveSupport protected def _dasherize(key) - key.gsub(/(?!^[_]*)_(?![_]*$)/, '-') + left = key.strip.rpartition(/^_*/) + right = left.pop.partition(/_*$/) + right.first.tr!('_ ', '--') + left.concat(right).join end # TODO: Add support for other encodings |