Skip to content

Commit 4b06c47

Browse files
authored
Merge pull request #8877 from timriley/patch-1
Fix incorrect Hanami app setup
2 parents c648adb + f38ca9f commit 4b06c47

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

ruby/hanami/Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
source "https://rubygems.org"
22

33
gem "hanami", "~> 2.3.0"
4-
gem "hanami-router", "~> 2.3.0"
4+
gem "hanami-controller", "~> 2.3.0"
5+
gem "hanami-router", "~> 2.3.0"

ruby/hanami/app/action.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
require "hanami/action"
2+
3+
module Benchmark
4+
class Action < Hanami::Action
5+
end
6+
end

ruby/hanami/app/actions/benchmark/index/empty.rb renamed to ruby/hanami/app/actions/index/empty.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Benchmark
22
module Actions
3-
module Home
4-
class Index < Benchmark::Action
3+
module Index
4+
class Empty < Benchmark::Action
55
def handle(request, response)
66
response.body = ""
77
end

ruby/hanami/app/actions/benchmark/user/get.rb renamed to ruby/hanami/app/actions/user/get.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Benchmark
22
module Actions
3-
module Home
4-
class Index < Benchmark::Action
3+
module User
4+
class Get < Benchmark::Action
55
def handle(request, response)
66
response.body = request.params[:id]
77
end

ruby/hanami/config/routes.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
require "hanami/routes"
2-
31
module Benchmark
42
class Routes < Hanami::Routes
53
root to: "index.empty"
64

75
get "/user/:id", to: "user.get"
86

9-
post "/user", to "index.empty"
7+
post "/user", to: "index.empty"
108
end
119
end

0 commit comments

Comments
 (0)