Target Ruby 2.4 syntax in RuboCop scans (#7583)
Merge pull request 7583
This commit is contained in:
parent
f4ee82650e
commit
c8fe609f8f
|
@ -8,7 +8,7 @@ Jekyll/NoPutsAllowed:
|
||||||
- rake/*.rake
|
- rake/*.rake
|
||||||
|
|
||||||
AllCops:
|
AllCops:
|
||||||
TargetRubyVersion: 2.3
|
TargetRubyVersion: 2.4
|
||||||
Include:
|
Include:
|
||||||
- lib/**/*.rb
|
- lib/**/*.rb
|
||||||
- test/**/*.rb
|
- test/**/*.rb
|
||||||
|
|
|
@ -29,15 +29,15 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
def inline?
|
def inline?
|
||||||
@response["Content-Disposition"] =~ %r!^inline!
|
@response["Content-Disposition"].to_s.start_with?("inline")
|
||||||
end
|
end
|
||||||
|
|
||||||
def bad_browser?
|
def bad_browser?
|
||||||
BAD_USER_AGENTS.any? { |pattern| @request["User-Agent"] =~ pattern }
|
BAD_USER_AGENTS.any? { |pattern| pattern.match?(@request["User-Agent"]) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def html?
|
def html?
|
||||||
@response["Content-Type"] =~ %r!text/html!
|
@response["Content-Type"].to_s.include?("text/html")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ module Jekyll
|
||||||
key = res.header.keys.grep(%r!content-type!i).first
|
key = res.header.keys.grep(%r!content-type!i).first
|
||||||
typ = res.header[key]
|
typ = res.header[key]
|
||||||
|
|
||||||
unless typ =~ %r!;\s*charset=!
|
unless %r!;\s*charset=!.match?(typ)
|
||||||
res.header[key] = "#{typ}; charset=#{@jekyll_opts["encoding"]}"
|
res.header[key] = "#{typ}; charset=#{@jekyll_opts["encoding"]}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,7 +46,7 @@ module Jekyll
|
||||||
# WebSockets requests will have a Connection: Upgrade header
|
# WebSockets requests will have a Connection: Upgrade header
|
||||||
if parser.http_method != "GET" || parser.upgrade?
|
if parser.http_method != "GET" || parser.upgrade?
|
||||||
super
|
super
|
||||||
elsif parser.request_url =~ %r!^\/livereload.js!
|
elsif parser.request_url.start_with?("/livereload.js")
|
||||||
headers = [
|
headers = [
|
||||||
"HTTP/1.1 200 OK",
|
"HTTP/1.1 200 OK",
|
||||||
"Content-Type: application/javascript",
|
"Content-Type: application/javascript",
|
||||||
|
|
|
@ -69,7 +69,7 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_params
|
def validate_params
|
||||||
unless @params =~ FULL_VALID_SYNTAX
|
unless FULL_VALID_SYNTAX.match?(@params)
|
||||||
raise ArgumentError, <<~MSG
|
raise ArgumentError, <<~MSG
|
||||||
Invalid syntax for include tag:
|
Invalid syntax for include tag:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue