aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-04-20 17:52:21 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-04-20 19:56:01 -0700
commit549c81db4a9ca941ea65ae2edafb0f34784f12f2 (patch)
tree79de15ba2ae898be4f335e9180697f9fe2da4dfa /activesupport/lib/active_support/core_ext/string.rb
parent2b69840e5efba885c8ec6281d5b8a56fcabff283 (diff)
downloadrails-549c81db4a9ca941ea65ae2edafb0f34784f12f2.tar.gz
rails-549c81db4a9ca941ea65ae2edafb0f34784f12f2.tar.bz2
rails-549c81db4a9ca941ea65ae2edafb0f34784f12f2.zip
Ruby 1.8.7 compat: String#start_with? and #end_with?
Diffstat (limited to 'activesupport/lib/active_support/core_ext/string.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/string.rb13
1 files changed, 3 insertions, 10 deletions
diff --git a/activesupport/lib/active_support/core_ext/string.rb b/activesupport/lib/active_support/core_ext/string.rb
index a83474f278..25386af70a 100644
--- a/activesupport/lib/active_support/core_ext/string.rb
+++ b/activesupport/lib/active_support/core_ext/string.rb
@@ -2,7 +2,7 @@ require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/string/conversions'
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/iterators'
require 'active_support/core_ext/string/unicode'
require 'active_support/core_ext/string/xchar'
require 'active_support/core_ext/string/filters'
@@ -12,14 +12,7 @@ class String #:nodoc:
include ActiveSupport::CoreExtensions::String::Conversions
include ActiveSupport::CoreExtensions::String::Filters
include ActiveSupport::CoreExtensions::String::Inflections
- if RUBY_VERSION < '1.9'
- include ActiveSupport::CoreExtensions::String::StartsEndsWith
- else
- alias starts_with? start_with?
- alias ends_with? end_with?
- end
- if defined? ActiveSupport::CoreExtensions::String::Iterators
- include ActiveSupport::CoreExtensions::String::Iterators
- end
+ include ActiveSupport::CoreExtensions::String::StartsEndsWith
+ include ActiveSupport::CoreExtensions::String::Iterators
include ActiveSupport::CoreExtensions::String::Unicode
end