Skip to content
Browse files

Ruby 1.9 compat: silence a warning about regexp languages

[#2050 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
1 parent 1cfc39e commit 0a8c003b1e0459b5bcfa47f49cc74f7a6b3851f8 @samgranieri samgranieri committed with jeremy Feb 22, 2009
Showing with 5 additions and 1 deletion.
  1. +5 −1 actionpack/lib/action_controller/routing/segments.rb
View
6 actionpack/lib/action_controller/routing/segments.rb
@@ -3,7 +3,11 @@ module Routing
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

0 comments on commit 0a8c003

Please sign in to comment.
Something went wrong with that request. Please try again.