Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Ruby 1.9 compat: silence a warning about regexp languages
[#2050 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
samgranieri authored and jeremy committed Feb 25, 2009
1 parent 1cfc39e commit 0a8c003
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion actionpack/lib/action_controller/routing/segments.rb
Expand Up @@ -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
Expand Down

0 comments on commit 0a8c003

Please sign in to comment.