Skip to content

Commit b30de6b

Browse files
authored
Merge pull request #275 from webmachine/rubocop
Rubocop: resolve CI breaking issues
2 parents 01a5b0a + 4a6ba14 commit b30de6b

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

.rubocop.yml

+2
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,6 @@ Style/GlobalVars:
5151
- "lib/webmachine/decision/conneg.rb"
5252

5353
AllCops:
54+
NewCops: disable
5455
SuggestExtensions: false
56+
TargetRubyVersion: 2.6

lib/webmachine/dispatcher/route.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def self.rfc3986_percent_decode(value)
3737
result << if encoded_val.nil?
3838
s.getch
3939
else
40-
[encoded_val[1..-1]].pack('H*')
40+
[encoded_val[1..]].pack('H*')
4141
end
4242
end
4343
result
@@ -154,8 +154,8 @@ def bind(tokens, bindings)
154154
else
155155
return false
156156
end
157-
spec = spec[1..-1]
158-
tokens = tokens[1..-1]
157+
spec = spec[1..]
158+
tokens = tokens[1..]
159159
depth += 1
160160
end
161161
end

lib/webmachine/headers.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ def self.[](*args)
3737

3838
# Fetch a header
3939
def [](key)
40-
super transform_key(key)
40+
super(transform_key(key))
4141
end
4242

4343
# Set a header
4444
def []=(key, value)
45-
super transform_key(key), value
45+
super(transform_key(key), value)
4646
end
4747

4848
# Returns the value for the given key. If the key can't be found,
@@ -70,7 +70,7 @@ def fetch(*args, &block)
7070

7171
# Delete a header
7272
def delete(key)
73-
super transform_key(key)
73+
super(transform_key(key))
7474
end
7575

7676
# Select matching headers

lib/webmachine/quoted_string.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def quote(str)
2828

2929
# Escapes quotes within a quoted string.
3030
def escape_quotes(str)
31-
str.gsub(/"/, '\\"')
31+
str.gsub('"', '\\"')
3232
end
3333

3434
# Unescapes quotes within a quoted string

lib/webmachine/resource/authentication.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module Authentication
2424
# @yieldparam [String] password the passed password
2525
# @yieldreturn [true,false] whether the username/password is correct
2626
def basic_auth(header, realm = 'Webmachine')
27-
if header =~ BASIC_HEADER && yield(*$1.unpack1('m*').split(/:/, 2))
27+
if header =~ BASIC_HEADER && yield(*$1.unpack1('m*').split(':', 2))
2828
true
2929
else
3030
%(Basic realm="#{realm}")

0 commit comments

Comments
 (0)