diff options
author | Sam Granieri <sam@samgranieri.com> | 2009-02-22 21:24:53 -0600 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-02-25 09:38:26 -0800 |
commit | 0a8c003b1e0459b5bcfa47f49cc74f7a6b3851f8 (patch) | |
tree | 643cf9ab9eea26ea2cd20b089162a8a4f468ad72 /actionpack/lib/action_controller | |
parent | 1cfc39e7e7ab72db1f797fbf21cdd149edfadd22 (diff) | |
download | rails-0a8c003b1e0459b5bcfa47f49cc74f7a6b3851f8.tar.gz rails-0a8c003b1e0459b5bcfa47f49cc74f7a6b3851f8.tar.bz2 rails-0a8c003b1e0459b5bcfa47f49cc74f7a6b3851f8.zip |
Ruby 1.9 compat: silence a warning about regexp languages
[#2050 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/routing/segments.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing/segments.rb b/actionpack/lib/action_controller/routing/segments.rb index 129e87c139..cbb1a9c09a 100644 --- a/actionpack/lib/action_controller/routing/segments.rb +++ b/actionpack/lib/action_controller/routing/segments.rb @@ -3,7 +3,11 @@ module ActionController class Segment #:nodoc: RESERVED_PCHAR = ':@&=+$,;' SAFE_PCHAR = "#{URI::REGEXP::PATTERN::UNRESERVED}#{RESERVED_PCHAR}" - UNSAFE_PCHAR = Regexp.new("[^#{SAFE_PCHAR}]", false, 'N').freeze + if RUBY_VERSION >= '1.9' + UNSAFE_PCHAR = Regexp.new("[^#{SAFE_PCHAR}]", false).freeze + else + UNSAFE_PCHAR = Regexp.new("[^#{SAFE_PCHAR}]", false, 'N').freeze + end # TODO: Convert :is_optional accessor to read only attr_accessor :is_optional |