Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit b6ad4bd0a23f4fcb7201b512445fdb0da33a73bd 1 parent 763effc
@samgranieri samgranieri authored jeremy committed
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
Please sign in to comment.
Something went wrong with that request. Please try again.