From a350a39c979930cedaa165749e12abf12e98e689 Mon Sep 17 00:00:00 2001 From: drbrain Date: Mon, 24 Dec 2007 01:51:49 +0000 Subject: [PATCH] Fix Regexp warnings in lib/uri. Patch #16524 by Kornelius Kalnbach. [ruby-core:14302] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/uri/common.rb | 35 +++++++++++++++++------------------ lib/uri/mailto.rb | 2 +- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e78d1031b..925bc24ba7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Dec 24 10:49:04 2007 + + * lib/uri/mailto.rb, lib/uri/common.rb: Fix Regexp warnings. Patch + #16524 from Kornelius Kalnbach, [ruby-core:14302]. + Mon Dec 24 10:37:38 2007 Eric Hodel * gem_prelude.rb: Remove methods from Gem, not QuickLoader, to fix diff --git a/lib/uri/common.rb b/lib/uri/common.rb index af6aaf26fb..cf7d147cc4 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -186,31 +186,30 @@ module URI # for URI::split ABS_URI = Regexp.new('^' + PATTERN::X_ABS_URI + '$', #' - Regexp::EXTENDED, 'N').freeze + Regexp::EXTENDED).freeze REL_URI = Regexp.new('^' + PATTERN::X_REL_URI + '$', #' - Regexp::EXTENDED, 'N').freeze + Regexp::EXTENDED).freeze # for URI::extract - URI_REF = Regexp.new(PATTERN::URI_REF, false, 'N').freeze - ABS_URI_REF = Regexp.new(PATTERN::X_ABS_URI, Regexp::EXTENDED, 'N').freeze - REL_URI_REF = Regexp.new(PATTERN::X_REL_URI, Regexp::EXTENDED, 'N').freeze + URI_REF = Regexp.new(PATTERN::URI_REF).freeze + ABS_URI_REF = Regexp.new(PATTERN::X_ABS_URI, Regexp::EXTENDED).freeze + REL_URI_REF = Regexp.new(PATTERN::X_REL_URI, Regexp::EXTENDED).freeze # for URI::escape/unescape - ESCAPED = Regexp.new(PATTERN::ESCAPED, false, 'N').freeze - UNSAFE = Regexp.new("[^#{PATTERN::UNRESERVED}#{PATTERN::RESERVED}]", - false, 'N').freeze + ESCAPED = Regexp.new(PATTERN::ESCAPED).freeze + UNSAFE = Regexp.new("[^#{PATTERN::UNRESERVED}#{PATTERN::RESERVED}]").freeze # for Generic#initialize - SCHEME = Regexp.new("^#{PATTERN::SCHEME}$", false, 'N').freeze #" - USERINFO = Regexp.new("^#{PATTERN::USERINFO}$", false, 'N').freeze #" - HOST = Regexp.new("^#{PATTERN::HOST}$", false, 'N').freeze #" - PORT = Regexp.new("^#{PATTERN::PORT}$", false, 'N').freeze #" - OPAQUE = Regexp.new("^#{PATTERN::OPAQUE_PART}$", false, 'N').freeze #" - REGISTRY = Regexp.new("^#{PATTERN::REG_NAME}$", false, 'N').freeze #" - ABS_PATH = Regexp.new("^#{PATTERN::ABS_PATH}$", false, 'N').freeze #" - REL_PATH = Regexp.new("^#{PATTERN::REL_PATH}$", false, 'N').freeze #" - QUERY = Regexp.new("^#{PATTERN::QUERY}$", false, 'N').freeze #" - FRAGMENT = Regexp.new("^#{PATTERN::FRAGMENT}$", false, 'N').freeze #" + SCHEME = Regexp.new("^#{PATTERN::SCHEME}$").freeze #" + USERINFO = Regexp.new("^#{PATTERN::USERINFO}$").freeze #" + HOST = Regexp.new("^#{PATTERN::HOST}$").freeze #" + PORT = Regexp.new("^#{PATTERN::PORT}$").freeze #" + OPAQUE = Regexp.new("^#{PATTERN::OPAQUE_PART}$").freeze #" + REGISTRY = Regexp.new("^#{PATTERN::REG_NAME}$").freeze #" + ABS_PATH = Regexp.new("^#{PATTERN::ABS_PATH}$").freeze #" + REL_PATH = Regexp.new("^#{PATTERN::REL_PATH}$").freeze #" + QUERY = Regexp.new("^#{PATTERN::QUERY}$").freeze #" + FRAGMENT = Regexp.new("^#{PATTERN::FRAGMENT}$").freeze #" # :startdoc: end # REGEXP diff --git a/lib/uri/mailto.rb b/lib/uri/mailto.rb index 44f04f2dd5..3a9d15318f 100644 --- a/lib/uri/mailto.rb +++ b/lib/uri/mailto.rb @@ -55,7 +55,7 @@ module URI (#{PATTERN::FRAGMENT}) (?# 3: fragment) )? \\z - ", Regexp::EXTENDED, 'N').freeze + ", Regexp::EXTENDED).freeze # :startdoc: #