Skip to content
Browse files

Merge pull request #101 from kachick/improve-remove_warnings

Fixed some warnings
  • Loading branch information...
2 parents 72bf6c0 + f70b46b commit 229a1185398243256e0999005cb2a89a8549780a @sporkmonger committed Jan 22, 2013
Showing with 8 additions and 8 deletions.
  1. +4 −4 lib/addressable/template.rb
  2. +4 −4 lib/addressable/uri.rb
View
8 lib/addressable/template.rb
@@ -515,11 +515,11 @@ def variable_defaults
private
def ordered_variable_defaults
@ordered_variable_defaults ||= (
- expansions, expansion_regexp = parse_template_pattern(pattern)
+ expansions, _ = parse_template_pattern(pattern)
expansions.map do |capture|
- _, operator, varlist = *capture.match(EXPRESSION)
+ _, _, varlist = *capture.match(EXPRESSION)
varlist.split(',').map do |varspec|
- name = varspec[VARSPEC, 1]
+ varspec[VARSPEC, 1]
end
end.flatten
)
@@ -553,7 +553,7 @@ def transform_partial_capture(mapping, capture, processor = nil)
_, operator, varlist = *capture.match(EXPRESSION)
is_first = true
varlist.split(',').inject('') do |acc, varspec|
- _, name, modifier = *varspec.match(VARSPEC)
+ _, name, _ = *varspec.match(VARSPEC)
value = mapping[name]
if value
operator = '&' if !is_first && operator == '?'
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

0 comments on commit 229a118

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