Compare commits
No commits in common. "6af6569b0f3e4c35feda0f977037e4a4525bf525" and "65ff5b9b2b683788c2b8c6e9cd8ac75c14a157f5" have entirely different histories.
6af6569b0f
...
65ff5b9b2b
8 changed files with 27 additions and 61 deletions
41
.github/workflows/ci.yml
vendored
41
.github/workflows/ci.yml
vendored
|
@ -1,41 +0,0 @@
|
||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 3 * * 1" # Every monday at 3 AM
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, macos-latest]
|
|
||||||
crystal: [latest, nightly]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Install Crystal
|
|
||||||
uses: oprypin/install-crystal@v1
|
|
||||||
with:
|
|
||||||
crystal: ${{ matrix.crystal }}
|
|
||||||
|
|
||||||
- name: Download source
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: shards install
|
|
||||||
env:
|
|
||||||
SHARDS_OPTS: --ignore-crystal-version
|
|
||||||
|
|
||||||
- name: Run specs
|
|
||||||
run: |
|
|
||||||
crystal spec
|
|
||||||
crystal spec --release --no-debug
|
|
||||||
|
|
||||||
- name: Check formatting
|
|
||||||
run: crystal tool format --check
|
|
||||||
|
|
||||||
- name: Run ameba linter
|
|
||||||
run: bin/ameba
|
|
14
.travis.yml
Normal file
14
.travis.yml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
language: crystal
|
||||||
|
crystal:
|
||||||
|
- latest
|
||||||
|
- nightly
|
||||||
|
|
||||||
|
script:
|
||||||
|
- crystal spec
|
||||||
|
- crystal spec --release --no-debug
|
||||||
|
- crystal tool format --check
|
||||||
|
- bin/ameba src
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
allow_failures:
|
||||||
|
- crystal: nightly
|
|
@ -1,10 +1,3 @@
|
||||||
# 1.0.0 (??-03-2021)
|
|
||||||
|
|
||||||
- Crystal 1.0.0 support :tada:
|
|
||||||
- Update Radix to use latest 0.4.0 [#596](https://github.com/kemalcr/kemal/pull/596). Thanks @luislavena :pray:
|
|
||||||
- Use latest version of Ameba dependency (dev) [#597](https://github.com/kemalcr/kemal/pull/597). Thanks @luislavena :pray:
|
|
||||||
- Fix StaticFileHandler failing spec [#599](https://github.com/kemalcr/kemal/pull/599). Thanks @jinn999 :pray:
|
|
||||||
|
|
||||||
# 0.27.0 (28-11-2020)
|
# 0.27.0 (28-11-2020)
|
||||||
|
|
||||||
- Crystal 0.35.x support :tada: Thanks @bcardiff :pray:
|
- Crystal 0.35.x support :tada: Thanks @bcardiff :pray:
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
Lightning Fast, Super Simple web framework.
|
Lightning Fast, Super Simple web framework.
|
||||||
|
|
||||||
[](https://github.com/kemalcr/kemal/actions/workflows/ci.yml)
|
[](https://travis-ci.org/kemalcr/kemal)
|
||||||
[](https://gitter.im/sdogruyol/kemal?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[](https://gitter.im/sdogruyol/kemal?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
|
|
||||||
# Super Simple ⚡️
|
# Super Simple ⚡️
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: kemal
|
name: kemal
|
||||||
version: 1.0.0
|
version: 0.27.0
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
- Serdar Dogruyol <dogruyolserdar@gmail.com>
|
- Serdar Dogruyol <dogruyolserdar@gmail.com>
|
||||||
|
@ -7,7 +7,7 @@ authors:
|
||||||
dependencies:
|
dependencies:
|
||||||
radix:
|
radix:
|
||||||
github: luislavena/radix
|
github: luislavena/radix
|
||||||
version: ~> 0.4.0
|
version: ~> 0.3.8
|
||||||
kilt:
|
kilt:
|
||||||
github: jeromegn/kilt
|
github: jeromegn/kilt
|
||||||
version: ~> 0.4.0
|
version: ~> 0.4.0
|
||||||
|
@ -18,8 +18,8 @@ dependencies:
|
||||||
development_dependencies:
|
development_dependencies:
|
||||||
ameba:
|
ameba:
|
||||||
github: crystal-ameba/ameba
|
github: crystal-ameba/ameba
|
||||||
version: ~> 0.14.0
|
version: ~> 0.12.0
|
||||||
|
|
||||||
crystal: ">= 0.36.0"
|
crystal: 0.35.0
|
||||||
|
|
||||||
license: MIT
|
license: MIT
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require "./spec_helper"
|
require "./spec_helper"
|
||||||
|
|
||||||
private def handle(request, fallthrough = true, decompress = true)
|
private def handle(request, fallthrough = true)
|
||||||
io = IO::Memory.new
|
io = IO::Memory.new
|
||||||
response = HTTP::Server::Response.new(io)
|
response = HTTP::Server::Response.new(io)
|
||||||
context = HTTP::Server::Context.new(request, response)
|
context = HTTP::Server::Context.new(request, response)
|
||||||
|
@ -8,7 +8,7 @@ private def handle(request, fallthrough = true, decompress = true)
|
||||||
handler.call context
|
handler.call context
|
||||||
response.close
|
response.close
|
||||||
io.rewind
|
io.rewind
|
||||||
HTTP::Client::Response.from_io(io, decompress: decompress)
|
HTTP::Client::Response.from_io(io)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe Kemal::StaticFileHandler do
|
describe Kemal::StaticFileHandler do
|
||||||
|
@ -51,7 +51,7 @@ describe Kemal::StaticFileHandler do
|
||||||
it "should gzip a file if config is true, headers accept gzip and file is > 880 bytes" do
|
it "should gzip a file if config is true, headers accept gzip and file is > 880 bytes" do
|
||||||
serve_static({"gzip" => true, "dir_listing" => true})
|
serve_static({"gzip" => true, "dir_listing" => true})
|
||||||
headers = HTTP::Headers{"Accept-Encoding" => "gzip, deflate, sdch, br"}
|
headers = HTTP::Headers{"Accept-Encoding" => "gzip, deflate, sdch, br"}
|
||||||
response = handle HTTP::Request.new("GET", "/dir/bigger.txt", headers), decompress: false
|
response = handle HTTP::Request.new("GET", "/dir/bigger.txt", headers)
|
||||||
response.status_code.should eq(200)
|
response.status_code.should eq(200)
|
||||||
response.headers["Content-Encoding"].should eq "gzip"
|
response.headers["Content-Encoding"].should eq "gzip"
|
||||||
end
|
end
|
||||||
|
@ -59,7 +59,7 @@ describe Kemal::StaticFileHandler do
|
||||||
it "should not gzip a file if config is true, headers accept gzip and file is < 880 bytes" do
|
it "should not gzip a file if config is true, headers accept gzip and file is < 880 bytes" do
|
||||||
serve_static({"gzip" => true, "dir_listing" => true})
|
serve_static({"gzip" => true, "dir_listing" => true})
|
||||||
headers = HTTP::Headers{"Accept-Encoding" => "gzip, deflate, sdch, br"}
|
headers = HTTP::Headers{"Accept-Encoding" => "gzip, deflate, sdch, br"}
|
||||||
response = handle HTTP::Request.new("GET", "/dir/test.txt", headers), decompress: false
|
response = handle HTTP::Request.new("GET", "/dir/test.txt", headers)
|
||||||
response.status_code.should eq(200)
|
response.status_code.should eq(200)
|
||||||
response.headers["Content-Encoding"]?.should be_nil
|
response.headers["Content-Encoding"]?.should be_nil
|
||||||
end
|
end
|
||||||
|
@ -67,7 +67,7 @@ describe Kemal::StaticFileHandler do
|
||||||
it "should not gzip a file if config is false, headers accept gzip and file is > 880 bytes" do
|
it "should not gzip a file if config is false, headers accept gzip and file is > 880 bytes" do
|
||||||
serve_static({"gzip" => false, "dir_listing" => true})
|
serve_static({"gzip" => false, "dir_listing" => true})
|
||||||
headers = HTTP::Headers{"Accept-Encoding" => "gzip, deflate, sdch, br"}
|
headers = HTTP::Headers{"Accept-Encoding" => "gzip, deflate, sdch, br"}
|
||||||
response = handle HTTP::Request.new("GET", "/dir/bigger.txt", headers), decompress: false
|
response = handle HTTP::Request.new("GET", "/dir/bigger.txt", headers)
|
||||||
response.status_code.should eq(200)
|
response.status_code.should eq(200)
|
||||||
response.headers["Content-Encoding"]?.should be_nil
|
response.headers["Content-Encoding"]?.should be_nil
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,8 +22,8 @@ describe "Kemal::WebSocketHandler" do
|
||||||
|
|
||||||
it "matches on given route" do
|
it "matches on given route" do
|
||||||
handler = Kemal::WebSocketHandler::INSTANCE
|
handler = Kemal::WebSocketHandler::INSTANCE
|
||||||
ws("/", &.send("Match"))
|
ws "/" { |socket| socket.send("Match") }
|
||||||
ws("/no_match", &.send("No Match"))
|
ws "/no_match" { |socket| socket.send "No Match" }
|
||||||
headers = HTTP::Headers{
|
headers = HTTP::Headers{
|
||||||
"Upgrade" => "websocket",
|
"Upgrade" => "websocket",
|
||||||
"Connection" => "Upgrade",
|
"Connection" => "Upgrade",
|
||||||
|
|
|
@ -66,7 +66,7 @@ module Kemal
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.display_startup_message(config, server)
|
def self.display_startup_message(config, server)
|
||||||
addresses = server.addresses.join ", " { |address| "#{config.scheme}://#{address}" }
|
addresses = server.addresses.map { |address| "#{config.scheme}://#{address}" }.join ", "
|
||||||
log "[#{config.env}] Kemal is ready to lead at #{addresses}"
|
log "[#{config.env}] Kemal is ready to lead at #{addresses}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue