From 715db1a7973dfc02466207a913bacc4702187dad Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 19 Apr 2008 16:06:30 -0700 Subject: Feature check :force_encoding instead of RUBY_VERSION --- activesupport/lib/active_support/core_ext/string/access.rb | 2 +- activesupport/lib/active_support/core_ext/string/unicode.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/string/access.rb b/activesupport/lib/active_support/core_ext/string/access.rb index 89999ff136..1a949c0b77 100644 --- a/activesupport/lib/active_support/core_ext/string/access.rb +++ b/activesupport/lib/active_support/core_ext/string/access.rb @@ -1,7 +1,7 @@ module ActiveSupport #:nodoc: module CoreExtensions #:nodoc: module String #:nodoc: - if RUBY_VERSION < '1.9' + unless '1.9'.respond_to?(:force_encoding) # Makes it easier to access parts of a string, such as specific characters and substrings. module Access # Returns the character at the +position+ treating the string as an array (where 0 is the first character). diff --git a/activesupport/lib/active_support/core_ext/string/unicode.rb b/activesupport/lib/active_support/core_ext/string/unicode.rb index 0e9770af25..963920d4a6 100644 --- a/activesupport/lib/active_support/core_ext/string/unicode.rb +++ b/activesupport/lib/active_support/core_ext/string/unicode.rb @@ -1,7 +1,7 @@ module ActiveSupport #:nodoc: module CoreExtensions #:nodoc: module String #:nodoc: - if RUBY_VERSION < '1.9' + unless '1.9'.respond_to?(:force_encoding) # Define methods for handling unicode data. module Unicode # +chars+ is a Unicode safe proxy for string methods. It creates and returns an instance of the -- cgit v1.2.3