Use Ameba on Travis CI (#520)

This commit is contained in:
Sijawusz Pur Rahnama 2019-06-13 13:31:45 +02:00 committed by Serdar Dogruyol
parent c646aad482
commit 06665e81bc
5 changed files with 9 additions and 3 deletions

View File

@ -7,6 +7,7 @@ script:
- crystal spec
- crystal spec --release --no-debug
- crystal tool format --check
- bin/ameba src
matrix:
allow_failures:

View File

@ -15,6 +15,11 @@ dependencies:
github: crystal-loot/exception_page
version: ~> 0.1.1
development_dependencies:
ameba:
github: veelenga/ameba
version: ~> 0.9.0
crystal: 0.27.2
license: MIT

View File

@ -14,7 +14,7 @@ module Kemal
log("Exception: #{ex.inspect_with_backtrace}")
return call_exception_with_status_code(context, ex, 500) if Kemal.config.error_handlers.has_key?(500)
verbosity = Kemal.config.env == "production" ? false : true
return render_500(context, ex, verbosity)
render_500(context, ex, verbosity)
end
private def call_exception_with_status_code(context : HTTP::Server::Context, exception : Exception, status_code : Int32)

View File

@ -1,7 +1,7 @@
class HTTP::Server::Response
class Output
def close
unless response.wrote_headers? && !response.headers.has_key?("Content-Range")
if !response.wrote_headers? && response.headers.has_key?("Content-Range")
response.content_length = @out_count
end

View File

@ -52,7 +52,7 @@ module Kemal
context.response.content_type = "text/html"
directory_listing(context.response, request_path, file_path)
else
return call_next(context)
call_next(context)
end
elsif File.exists?(file_path)
last_modified = modification_time(file_path)