Skip to content

Commit

Permalink
Crystal 0.36.0 (#1250)
Browse files Browse the repository at this point in the history
* support crystal 0.36.0

* update mysql and sqlite drivers

* reformat code

* fix formatting issues
  • Loading branch information
drujensen authored Feb 22, 2021
1 parent 1b87e2a commit 7e6eb32
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM crystallang/crystal:0.35.1
FROM crystallang/crystal:0.36.1

# Install Dependencies
ARG DEBIAN_FRONTEND=noninteractive
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,20 @@ Use Amber badge
```markdown
[![Amber Framework](https://img.shields.io/badge/using-amber_framework-orange.svg)](https://amberframework.org/)
```
## Release Checklist

- Test and release all dependencies
- Test everything locally
- Run `crelease 0.36.0`
- repoint amber to master branch in `src/amber/cli/templates/app/shard.yml.ecr` template
- update release notes
- update homebrew version and sha
- update linux repositories
- build and deploy docker image:
- verify Dockerfile is using the latest crystal version
- `docker login`
- `docker build -t amberframework/amber:0.36.0`
- `docker push amberframework/amber:0.36.0`

## Contributing

Expand Down
8 changes: 4 additions & 4 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ dependencies:

micrate:
github: amberframework/micrate
version: ~> 0.9.0
version: ~> 0.10.0

pg:
github: will/crystal-pg
version: ~> 0.21.1
version: ~> 0.23.0

mysql:
github: crystal-lang/crystal-mysql
version: ~> 0.11.1
version: ~> 0.13.0

sqlite3:
github: crystal-lang/crystal-sqlite3
version: ~> 0.16.0
version: ~> 0.18.0

redis:
github: stefanwille/crystal-redis
Expand Down
6 changes: 3 additions & 3 deletions src/amber/cli/templates/app/config/routes.cr.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Amber::Server.configure do
end

routes :web do
<% unless @minimal%>
get "/", HomeController, :index
<% end %>
<% unless @minimal -%>
get "/", HomeController, :index
<% end -%>
end

routes :api do
Expand Down
8 changes: 4 additions & 4 deletions src/amber/cli/templates/app/shard.yml.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:

granite:
github: amberframework/granite
version: ~> 0.21.0
version: ~> 0.22.1

quartz_mailer:
github: amberframework/quartz-mailer
Expand All @@ -36,15 +36,15 @@ dependencies:
<% case @database when "pg" -%>
pg:
github: will/crystal-pg
version: ~> 0.21.1
version: ~> 0.23.0
<% when "mysql" -%>
mysql:
github: crystal-lang/crystal-mysql
version: ~> 0.11.1
version: ~> 0.13.0
<% when "sqlite" -%>
sqlite3:
github: crystal-lang/crystal-sqlite3
version: ~> 0.16.0
version: ~> 0.18.0
<% else -%>
<% end -%>

Expand Down
1 change: 0 additions & 1 deletion src/amber/cli/templates/app/spec/spec_helper.cr.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ require "garnet_spec"
require "../config/application"

# Micrate::DB.connection_url = ENV["DATABASE_URL"]? || Amber.settings.database_url

# Automatically run migrations on the test database
# Micrate::Cli.run_up
8 changes: 4 additions & 4 deletions src/amber/validators/params.cr
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module Amber::Validators

# Setups validation rules to be performed
#
# ```crystal
# ```
# params.validation do
# required(:email) { |p| p.url? }
# required(:age, UInt32)
Expand All @@ -108,7 +108,7 @@ module Amber::Validators
# of validated params Otherwise raises a Validator::ValidationFailed error
# messages contain errors.
#
# ```crystal
# ```
# user = User.new params.validate!
# ```
def validate!
Expand All @@ -118,7 +118,7 @@ module Amber::Validators

# Returns True or false whether the validation passed
#
# ```crystal
# ```
# unless params.valid?
# response.puts {errors: params.errors}.to_json
# response.status_code 400
Expand All @@ -142,7 +142,7 @@ module Amber::Validators
# Validates each field with a given set of predicates returns true if the
# field is valid otherwise returns false
#
# ```crystal
# ```
# required(:email) { |p| p.email? & p.size.between? 1..10 }
# ```
def add_rule(rule : BaseRule)
Expand Down
2 changes: 1 addition & 1 deletion src/amber/websockets/channel.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Amber
#
# Example:
#
# ```crystal
# ```
# class ChatChannel < Amber::Websockets::Channel
# def handle_joined(client_socket)
# # functionality when the user joins the channel, optional
Expand Down
4 changes: 2 additions & 2 deletions src/amber/websockets/client_socket.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Amber
#
# Example:
#
# ```crystal
# ```
# struct UserSocket < Amber::Websockets::ClientSocket
# channel "user_channel:*", UserChannel
# channel "room_channel:*", RoomChannel
Expand Down Expand Up @@ -50,7 +50,7 @@ module Amber

# Broadcast a message to all subscribers of the topic
#
# ```crystal
# ```
# UserSocket.broadcast("message", "chats_room:1", "msg:new", {"message" => "test"})
# ```
def self.broadcast(event : String, topic : String, subject : String, payload : Hash)
Expand Down

0 comments on commit 7e6eb32

Please sign in to comment.