Skip to content

Commit

Permalink
rubocop (1.54.2) fix required with latest version (#893)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieujobin authored Jul 14, 2023
1 parent 61ae61d commit 291fd84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions lib/apipie/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,10 @@ def get_resource_id(klass)
version_prefix = version_prefix(klass)
path = klass.controller_path

path =
if version_prefix == '/'
path
else
unless version_prefix == '/'
path =
path.gsub(version_prefix, '')
end
end

path.gsub('/', '-')
elsif klass.respond_to?(:controller_name)
Expand Down
2 changes: 1 addition & 1 deletion lib/apipie/static_dispatcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def match?(path)
# Replace all null bytes
path = ::Rack::Utils.unescape(path || '')
.encode(Encoding::UTF_8, invalid: :replace, replace: '')
.gsub(/\x0/, '')
.gsub("\x0", '')

full_path = path.empty? ? @root : File.join(@root, path)
paths = "#{full_path}#{ext}"
Expand Down

0 comments on commit 291fd84

Please sign in to comment.