Skip to content

Commit

Permalink
Update Hanami app to 2.1 and Ruby gem 4
Browse files Browse the repository at this point in the history
Update the Hanami app to 2.1 so we can test against the latest version.
Update the Ruby gem 4 integration.
  • Loading branch information
tombruijn committed Aug 23, 2024
1 parent a96271f commit a55bf87
Show file tree
Hide file tree
Showing 12 changed files with 197 additions and 92 deletions.
1 change: 1 addition & 0 deletions ruby/hanami2-postgres/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spec/examples.txt
18 changes: 14 additions & 4 deletions ruby/hanami2-postgres/app/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@ source "https://rubygems.org"

gem "appsignal", :path => "/integration"

gem "hanami", "~> 2.0.0"
gem "hanami-router", "~> 2.0.0"
gem "hanami-controller", "~> 2.0.0"
gem "hanami-validations", "~> 2.0.0"
gem "hanami", "~> 2.1.0"
gem "hanami-router", "~> 2.1.0"
gem "hanami-controller", "~> 2.1.0"
gem "hanami-validations", "~> 2.1.0"
gem "hanami-assets", "~> 2.1"
gem "hanami-view", "~> 2.1"

group :development do
gem "hanami-webconsole", "~> 2.1"
end

group :test do
gem "capybara"
end

gem "dry-types", "~> 1.0", ">= 1.6.1"
gem "puma"
Expand Down
188 changes: 115 additions & 73 deletions ruby/hanami2-postgres/app/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,76 +1,52 @@
GIT
remote: https://github.com/dry-rb/dry-types.git
revision: d926d4fb54a5ace073b3ac5324707810fa16ff86
branch: main
specs:
dry-types (1.7.1)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)

GIT
remote: https://github.com/rom-rb/rom.git
revision: 7fb82cf7ffa86805d9c5499a4ecc64d5d3c20f14
branch: main
specs:
rom (6.0.0.alpha1)
concurrent-ruby (~> 1.1)
dry-core (>= 1.0.0.rc1, < 2)
dry-effects (~> 0.4)
dry-inflector (>= 1.0.0.rc1, < 2)
dry-initializer (~> 3.1)
dry-struct (~> 1.4)
dry-transformer (~> 1.0)
dry-types (~> 1.5)
zeitwerk (~> 2.6)

PATH
remote: ../../integration
remote: ../integration
specs:
appsignal (3.3.6)
appsignal (4.0.0)
rack

PATH
remote: /Users/luismiramirez/code/rom-sql
specs:
rom-sql (4.0.0.alpha1)
dry-core (~> 1.0)
dry-types (~> 1.7)
rom (~> 6.0.0.alpha)
sequel (>= 5)

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
better_errors (2.10.1)
erubi (>= 1.0.0)
rack (>= 0.9.0)
rouge (>= 1.0.0)
bigdecimal (3.1.8)
binding_of_caller (1.0.1)
debug_inspector (>= 1.2.0)
capybara (3.40.0)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.11)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
coderay (1.1.3)
concurrent-ruby (1.2.2)
concurrent-ruby (1.3.3)
debug_inspector (1.2.0)
diff-lcs (1.5.0)
dotenv (2.8.1)
dry-auto_inject (1.0.1)
dry-core (~> 1.0)
zeitwerk (~> 2.6)
dry-cli (1.0.0)
dry-configurable (1.0.1)
dry-configurable (1.1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-core (1.0.0)
concurrent-ruby (~> 1.0)
zeitwerk (~> 2.6)
dry-effects (0.4.0)
dry-core (1.0.1)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
dry-initializer (~> 3.0)
zeitwerk (~> 2.6)
dry-events (1.0.1)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
dry-files (1.0.1)
dry-files (1.1.0)
dry-inflector (1.0.0)
dry-initializer (3.1.1)
dry-logger (1.0.3)
dry-logger (1.0.4)
dry-logic (1.5.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
Expand All @@ -79,12 +55,12 @@ GEM
dry-configurable (~> 1.0, < 2)
dry-core (~> 1.0, < 2)
dry-events (~> 1.0, < 2)
dry-schema (1.13.0)
dry-schema (1.13.4)
concurrent-ruby (~> 1.0)
dry-configurable (~> 1.0, >= 1.0.1)
dry-core (~> 1.0, < 2)
dry-initializer (~> 3.0)
dry-logic (>= 1.5, < 2)
dry-logic (>= 1.4, < 2)
dry-types (>= 1.7, < 2)
zeitwerk (~> 2.6)
dry-struct (1.6.0)
Expand All @@ -99,12 +75,20 @@ GEM
dry-inflector (~> 1.0, < 2)
dry-transformer (1.0.1)
zeitwerk (~> 2.6)
dry-types (1.7.2)
bigdecimal (~> 3.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
dry-validation (1.10.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
dry-initializer (~> 3.0)
dry-schema (>= 1.12, < 2)
zeitwerk (~> 2.6)
erubi (1.13.0)
ffi (1.15.5)
formatador (1.1.0)
guard (2.18.0)
Expand All @@ -121,34 +105,36 @@ GEM
guard (~> 2.14)
guard-compat (~> 1.2)
puma (>= 4.0, < 7)
hanami (2.0.3)
hanami (2.1.1)
bundler (>= 1.16, < 3)
dry-configurable (~> 1.0, < 2)
dry-core (~> 1.0, < 2)
dry-inflector (~> 1.0, < 2)
dry-logger (~> 1.0, < 2)
dry-monitor (~> 1.0, >= 1.0.1, < 2)
dry-system (~> 1.0, < 2)
hanami-cli (~> 2.0)
hanami-utils (~> 2.0)
hanami-cli (~> 2.1)
hanami-utils (~> 2.1)
zeitwerk (~> 2.6)
hanami-assets (2.1.0)
zeitwerk (~> 2.6)
hanami-cli (2.0.3)
hanami-cli (2.1.1)
bundler (~> 2.1)
dry-cli (~> 1.0, < 2)
dry-files (~> 1.0, >= 1.0.1, < 2)
dry-files (~> 1.0, >= 1.0.2, < 2)
dry-inflector (~> 1.0, < 2)
rake (~> 13.0)
zeitwerk (~> 2.6)
hanami-controller (2.0.2)
hanami-controller (2.1.0)
dry-configurable (~> 1.0, < 2)
dry-core (~> 1.0)
hanami-utils (~> 2.0)
hanami-utils (~> 2.1)
rack (~> 2.0)
zeitwerk (~> 2.6)
hanami-reloader (2.0.2)
hanami-cli (~> 2.0)
zeitwerk (~> 2.6)
hanami-router (2.0.2)
hanami-router (2.1.0)
mustermann (~> 3.0)
mustermann-contrib (~> 3.0)
rack (~> 2.0)
Expand All @@ -157,43 +143,89 @@ GEM
rake (~> 13.0)
rspec (~> 3.12)
zeitwerk (~> 2.6)
hanami-utils (2.0.3)
hanami-utils (2.1.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
dry-transformer (~> 1.0, < 2)
hanami-validations (2.0.1)
hanami-validations (2.1.0)
dry-validation (>= 1.10, < 2)
zeitwerk (~> 2.6.0)
hanami-view (2.1.0)
dry-configurable (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0, < 2)
temple (~> 0.10.0, >= 0.10.2)
tilt (~> 2.3)
zeitwerk (~> 2.6)
hanami-webconsole (2.1.0)
better_errors (~> 2.10, >= 2.10.1)
binding_of_caller (~> 1.0)
hansi (0.2.1)
ice_nine (0.11.2)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
lumberjack (1.2.8)
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.5)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
mustermann-contrib (3.0.0)
hansi (~> 0.2.0)
mustermann (= 3.0.0)
nenv (0.3.0)
nio4r (2.5.8)
nokogiri (1.16.6-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.6-arm64-darwin)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
pg (1.4.6)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (6.0.0)
puma (6.1.1)
nio4r (~> 2.0)
rack (2.2.6.3)
racc (1.8.0)
rack (2.2.9)
rack-test (2.0.2)
rack (>= 1.3)
rake (13.0.6)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.9.2)
rom (5.3.2)
rom-changeset (~> 5.3, >= 5.3.0)
rom-core (~> 5.3, >= 5.3.2)
rom-repository (~> 5.3, >= 5.3.0)
rom-changeset (5.3.0)
dry-core (~> 1.0)
rom-core (~> 5.3)
transproc (~> 1.0, >= 1.1.0)
rom-core (5.3.2)
concurrent-ruby (~> 1.1)
dry-configurable (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
dry-initializer (~> 3.0, >= 3.0.1)
dry-struct (~> 1.0)
dry-types (~> 1.6)
transproc (~> 1.0, >= 1.1.0)
rom-repository (5.3.0)
dry-core (~> 1.0)
dry-initializer (~> 3.0, >= 3.0.1)
rom-core (~> 5.3, >= 5.3.0)
rom-sql (3.6.3)
dry-core (~> 1.0)
dry-types (~> 1.0)
rom (~> 5.2, >= 5.2.1)
sequel (>= 4.49)
rouge (4.3.0)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
Expand All @@ -208,32 +240,42 @@ GEM
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
ruby2_keywords (0.0.5)
sequel (5.66.0)
sequel (5.81.0)
bigdecimal
shellany (0.0.1)
temple (0.10.3)
thor (1.2.1)
zeitwerk (2.6.7)
tilt (2.3.0)
transproc (1.1.1)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.16)

PLATFORMS
aarch64-linux
arm64-darwin-21

DEPENDENCIES
appsignal!
capybara
dotenv
dry-types!
dry-types (~> 1.0, >= 1.6.1)
guard-puma
hanami (~> 2.0.0)
hanami-controller (~> 2.0.0)
hanami (~> 2.1.0)
hanami-assets (~> 2.1)
hanami-controller (~> 2.1.0)
hanami-reloader
hanami-router (~> 2.0.0)
hanami-router (~> 2.1.0)
hanami-rspec
hanami-validations (~> 2.0.0)
hanami-validations (~> 2.1.0)
hanami-view (~> 2.1)
hanami-webconsole (~> 2.1)
pg
puma
rack-test
rake
rom!
rom-sql!
rom (~> 5.3)
rom-sql (~> 3.6)

BUNDLED WITH
2.3.26
9 changes: 4 additions & 5 deletions ruby/hanami2-postgres/app/Guardfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# frozen_string_literal: true

group :server do
guard "puma", port: ENV["HANAMI_PORT"] || 2300 do
watch(%r{config/*})
watch(%r{lib/*})
watch(%r{app/*})
watch(%r{slices/*})
guard "puma", port: ENV.fetch("HANAMI_PORT", 2300) do
# Edit the following regular expression for your needs.
# See: https://guides.hanamirb.org/app/code-reloading/
watch(%r{^(app|config|lib|slices)([\/][^\/]+)*.(rb|erb|haml|slim)$}i)
end
end
2 changes: 2 additions & 0 deletions ruby/hanami2-postgres/app/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: bundle exec hanami server
assets: bundle exec hanami assets watch
2 changes: 1 addition & 1 deletion ruby/hanami2-postgres/app/app/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Action < Hanami::Action

def handle_standard_error(request, response, exception)
# Report the error to AppSignal
Appsignal.set_error(exception)
Appsignal.report_error(exception)

# Render custom error page
response.status = 500
Expand Down
8 changes: 8 additions & 0 deletions ruby/hanami2-postgres/app/bin/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh

if ! gem list foreman -i --silent; then
echo "Installing foreman..."
gem install foreman
fi

exec foreman start -f Procfile.dev "$@"
Loading

0 comments on commit a55bf87

Please sign in to comment.