Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to crystal 0.28 #1282

Merged
merged 10 commits into from May 9, 2019
6 changes: 6 additions & 0 deletions .dependabot/config.yml
Expand Up @@ -461,3 +461,9 @@ update_configs:
directory: "/rust/iron"
default_labels:
- docker

- package_manager: "docker"
update_schedule: "daily"
directory: "/crystal/kemal"
default_labels:
- docker
36 changes: 18 additions & 18 deletions FRAMEWORKS.yml
Expand Up @@ -171,40 +171,40 @@ php:
crystal:
kemal:
website: kemalcr.com
version: "0.25"
language: "0.27"
version: 0.25
language: 0.28
athena:
github: blacksmoke16/athena
version: "0.6"
language: "0.28"
version: 0.6
language: 0.28
router.cr:
github: tbrand/router.cr
version: "0.2"
language: "0.27"
version: 0.2
language: 0.28
amber:
website: amberframework.org
version: "0.11"
language: "0.27"
version: 0.28
language: 0.28
lucky:
website: luckyframework.org
version: "0.11"
language: "0.27"
version: 0.14
language: 0.28
spider-gazelle:
website: spider-gazelle.net
version: "1.4"
language: "0.27"
version: 1.4
language: 0.28
onyx:
website: onyxframework.org
version: "0.3"
language: "0.27"
version: 0.4
language: 0.28
orion:
github: obsidian/orion
version: "1.6"
language: "0.27"
version: 1.7
language: 0.28
raze:
website: razecr.com
version: "0.3"
language: "0.27"
version: 0.3
language: 0.28
nim:
jester:
github: dom96/jester
Expand Down
2 changes: 1 addition & 1 deletion crystal/amber/Dockerfile
@@ -1,4 +1,4 @@
FROM crystallang/crystal:0.27.2
FROM crystallang/crystal:0.28.0

WORKDIR /usr/src/app

Expand Down
4 changes: 2 additions & 2 deletions crystal/amber/shard.yml
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0
authors:
- Marwan Rabbâa <waghanza@gmail.com>

crystal: 0.27.0
crystal: 0.28.0

license: MIT

Expand All @@ -16,4 +16,4 @@ targets:
dependencies:
amber:
github: amberframework/amber
version: ~> 0.11.0
version: ~> 0.28.0
1 change: 0 additions & 1 deletion crystal/amber/src/controllers/application_controller.cr
@@ -1,5 +1,4 @@
class ApplicationController < Amber::Controller::Base

def index
end

Expand Down
2 changes: 1 addition & 1 deletion crystal/kemal/Dockerfile
@@ -1,4 +1,4 @@
FROM crystallang/crystal:0.27.2
FROM crystallang/crystal:0.28.0

WORKDIR /usr/src/app

Expand Down
2 changes: 1 addition & 1 deletion crystal/kemal/shard.yml
Expand Up @@ -13,6 +13,6 @@ dependencies:
github: kemalcr/kemal
kemal: ~> 0.25.0

crystal: 0.27.0
crystal: 0.28.0

license: MIT
4 changes: 2 additions & 2 deletions crystal/kemal/src/server.cr
@@ -1,8 +1,8 @@
require "kemal"

Kemal.config do |cfg|
cfg.serve_static = false
cfg.logging = false
cfg.serve_static = false
cfg.logging = false
end

get "/" do |env|
Expand Down
2 changes: 1 addition & 1 deletion crystal/lucky/Dockerfile
@@ -1,4 +1,4 @@
FROM crystallang/crystal:0.27.2
FROM crystallang/crystal:0.28.0

WORKDIR /usr/src/app

Expand Down
3 changes: 0 additions & 3 deletions crystal/lucky/config/log_handler.cr

This file was deleted.

15 changes: 15 additions & 0 deletions crystal/lucky/config/logger.cr
@@ -0,0 +1,15 @@
require "file_utils"

logger =
Dexter::Logger.new(
io: STDOUT,
level: Logger::Severity::INFO
)

Lucky.configure do |settings|
settings.logger = logger
end

Avram::Repo.configure do |settings|
settings.logger = logger
end
4 changes: 2 additions & 2 deletions crystal/lucky/shard.yml
Expand Up @@ -8,11 +8,11 @@ targets:
server:
main: src/benchmark_lucky.cr

crystal: 0.27.0
crystal: 0.28.0

license: MIT

dependencies:
lucky:
github: luckyframework/lucky
version: ~> 0.12.0
version: ~> 0.14.0
6 changes: 4 additions & 2 deletions crystal/onyx/Dockerfile
@@ -1,11 +1,13 @@
FROM crystallang/crystal:0.27.2
FROM crystallang/crystal:0.28.0

WORKDIR /usr/src/app

COPY shard.yml ./
COPY src src

RUN env BENCHMARK=true shards build --release --no-debug
ENV BENCHMARK true

RUN shards build --release --no-debug

EXPOSE 3000
CMD bin/server
6 changes: 3 additions & 3 deletions crystal/onyx/shard.yml
Expand Up @@ -11,11 +11,11 @@ targets:
dependencies:
onyx:
github: onyxframework/onyx
tag: v0.3.1-rc.1
version: ~> 0.4.0
onyx-http:
github: onyxframework/http
version: ~> 0.7.0
version: ~> 0.8.0

crystal: 0.27.0
crystal: 0.28.0

license: MIT
21 changes: 16 additions & 5 deletions crystal/onyx/src/server.cr
@@ -1,5 +1,13 @@
require "onyx/http"

struct EmptyEndpoint
include Onyx::HTTP::Endpoint

def call
context.response << String.new
end
end

struct IDEndpoint
include Onyx::HTTP::Endpoint

Expand All @@ -14,14 +22,17 @@ struct IDEndpoint
end
end

Onyx.get "/" { }
Onyx.get "/user/:id", IDEndpoint
Onyx.post "/user" { }
Onyx::HTTP.get "/", EmptyEndpoint

Onyx::HTTP.on "/user" do |r|
r.get "/:id", IDEndpoint
r.post "/", EmptyEndpoint
end

(System.cpu_count - 1).times do |i|
Process.fork do
Onyx.listen("0.0.0.0", 3000, reuse_port: true)
Onyx::HTTP.listen("0.0.0.0", 3000, reuse_port: true)
end
end

Onyx.listen("0.0.0.0", 3000, reuse_port: true)
Onyx::HTTP.listen("0.0.0.0", 3000, reuse_port: true)
2 changes: 1 addition & 1 deletion crystal/orion/Dockerfile
@@ -1,4 +1,4 @@
FROM crystallang/crystal:0.27.2
FROM crystallang/crystal:0.28.0

WORKDIR /usr/src/app

Expand Down
4 changes: 2 additions & 2 deletions crystal/orion/shard.yml
Expand Up @@ -11,8 +11,8 @@ targets:
dependencies:
orion:
github: obsidian/orion
version: ~> 1.6.0
version: ~> 1.7.0

crystal: 0.26.1
crystal: 0.28.0

license: MIT
2 changes: 1 addition & 1 deletion crystal/raze/Dockerfile
@@ -1,4 +1,4 @@
FROM crystallang/crystal:0.27.2
FROM crystallang/crystal:0.28.0

WORKDIR /usr/src/app

Expand Down
2 changes: 1 addition & 1 deletion crystal/raze/src/server.cr
Expand Up @@ -15,4 +15,4 @@ end
Raze.config.logging = false
Raze.config.port = 3000
Raze.config.env = "production"
Raze.run
Raze.run
2 changes: 1 addition & 1 deletion crystal/router.cr/Dockerfile
@@ -1,4 +1,4 @@
FROM crystallang/crystal:0.27.2
FROM crystallang/crystal:0.28.0

WORKDIR /usr/src/app

Expand Down
2 changes: 1 addition & 1 deletion crystal/router.cr/shard.yml
Expand Up @@ -13,6 +13,6 @@ dependencies:
github: tbrand/router.cr
version: ~> 0.2.7

crystal: 0.27.0
crystal: 0.28.0

license: MIT
2 changes: 1 addition & 1 deletion crystal/spider-gazelle/Dockerfile
@@ -1,4 +1,4 @@
FROM crystallang/crystal:0.27.2
FROM crystallang/crystal:0.28.0

WORKDIR /usr/src/app

Expand Down
4 changes: 2 additions & 2 deletions crystal/spider-gazelle/shard.yml
Expand Up @@ -4,10 +4,10 @@ version: 1.0.0
dependencies:
action-controller:
github: spider-gazelle/action-controller
version: ~> 1.2.1
version: ~> 1.4.6

targets:
app:
main: src/app.cr

crystal: 0.26.1
crystal: 0.28.0
2 changes: 1 addition & 1 deletion crystal/spider-gazelle/src/config.cr
Expand Up @@ -10,7 +10,7 @@ require "action-controller/server"

# Configure session cookies
# NOTE:: Change these from defaults
ActionController::Session.configure do
ActionController::Session.configure do |settings|
settings.key = ENV["COOKIE_SESSION_KEY"]? || "_spider_gazelle_"
settings.secret = ENV["COOKIE_SESSION_SECRET"]? || "4f74c0b358d5bab4000dd3c75465dc2c"
end
Expand Down