Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed warning about shadowing outer local variable.

This commit removes below warnings.

* "warning: shadowing outer local variable"
  • Loading branch information...
commit f70b46b8910693142772b65aac1b0864022a7f7e 1 parent f6734b0
@kachick kachick authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/addressable/uri.rb
View
8 lib/addressable/uri.rb
@@ -367,8 +367,8 @@ def self.encode_component(component, character_class=
(sequence.unpack('C*').map { |c| "%" + ("%02x" % c).upcase }).join
end
if upcase_encoded.length > 0
- component.gsub!(/%(#{upcase_encoded.chars.map do |c|
- c.unpack('C*').map { |c| '%02x' % c }.join
+ component.gsub!(/%(#{upcase_encoded.chars.map do |char|
+ char.unpack('C*').map { |c| '%02x' % c }.join
end.join('|')})/i) { |s| s.upcase }
end
return component
@@ -497,8 +497,8 @@ def self.normalize_component(component, character_class=
leave_re = if leave_encoded.length > 0
character_class << '%'
- "|%(?!#{leave_encoded.chars.map do |c|
- seq = c.unpack('C*').map { |c| '%02x' % c }.join
+ "|%(?!#{leave_encoded.chars.map do |char|
+ seq = char.unpack('C*').map { |c| '%02x' % c }.join
[seq.upcase, seq.downcase]
end.flatten.join('|')})"
end
Please sign in to comment.
Something went wrong with that request. Please try again.