Skip to content

Commit 7635ec3

Browse files
committed
Ruby 3.0+ only
1 parent 2c731a8 commit 7635ec3

File tree

7 files changed

+19
-9
lines changed

7 files changed

+19
-9
lines changed

.github/workflows/ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
ruby:
25+
- "3.1"
2526
- "3.0"
26-
- "2.7"
27-
- "2.6"
2827
steps:
2928
- uses: actions/checkout@v1
3029
- name: Install package dependencies

.rubocop.yml

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# alphabetically
33
inherit_from:
44
- https://raw.githubusercontent.com/hanami/devtools/main/.rubocop.yml
5+
Lint/EmptyBlock:
6+
Exclude:
7+
- "spec/**/*.rb"
58
Metrics/ParameterLists:
69
Exclude:
710
- "lib/hanami/router.rb"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Rack compatible, lightweight and fast HTTP Router for Ruby and [Hanami](http://h
2525

2626
## Rubies
2727

28-
__Hanami::Router__ supports Ruby (MRI) 2.6+
28+
__Hanami::Router__ supports Ruby (MRI) 3.0+
2929

3030

3131
## Installation

hanami-router.gemspec

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Gem::Specification.new do |spec|
1818
spec.executables = []
1919
spec.test_files = spec.files.grep(%r{^(test)/})
2020
spec.require_paths = ["lib"]
21-
spec.required_ruby_version = ">= 2.6.0"
21+
spec.metadata["rubygems_mfa_required"] = "true"
22+
spec.required_ruby_version = ">= 3.0"
2223

2324
spec.add_dependency "rack", "~> 2.0"
2425
spec.add_dependency "mustermann", "~> 1.0"
@@ -29,6 +30,6 @@ Gem::Specification.new do |spec|
2930
spec.add_development_dependency "rack-test", "~> 1.0"
3031
spec.add_development_dependency "rspec", "~> 3.8"
3132

32-
spec.add_development_dependency "rubocop", "0.91"
33-
spec.add_development_dependency "rubocop-performance", "1.8.1"
33+
spec.add_development_dependency "rubocop", "~> 1.0"
34+
spec.add_development_dependency "rubocop-performance", "~> 1.0"
3435
end

lib/hanami/middleware/body_parser.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class BodyParser
1717

1818
# @since 1.3.0
1919
# @api private
20-
MEDIA_TYPE_MATCHER = /\s*[;,]\s*/.freeze
20+
MEDIA_TYPE_MATCHER = /\s*[;,]\s*/
2121

2222
# @since 1.3.0
2323
# @api private

lib/hanami/router/prefix.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ def to_sym
4848

4949
# @since 2.0.0
5050
# @api private
51-
DEFAULT_SEPARATOR_REGEXP = /\//.freeze
51+
DEFAULT_SEPARATOR_REGEXP = /\//
5252

5353
# @since 2.0.0
5454
# @api private
55-
DOUBLE_DEFAULT_SEPARATOR_REGEXP = /\/{2,}/.freeze
55+
DOUBLE_DEFAULT_SEPARATOR_REGEXP = /\/{2,}/
5656

5757
# @since 2.0.0
5858
# @api private

spec/support/fixtures.rb

+7
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,15 @@ def call(_env)
570570
end
571571
end
572572
end
573+
573574
module Avatar
574575
class Show
575576
def call(_env)
576577
[200, {}, ["Hello from Nested::Controllers::Users::Avatar::Show"]]
577578
end
578579
end
579580
end
581+
580582
module Posts
581583
module Comments
582584
class Index
@@ -587,6 +589,7 @@ def call(_env)
587589
end
588590
end
589591
end
592+
590593
module User
591594
module Comments
592595
class Index
@@ -595,6 +598,7 @@ def call(_env)
595598
end
596599
end
597600
end
601+
598602
module ApiKey
599603
class Show
600604
def call(_env)
@@ -603,13 +607,15 @@ def call(_env)
603607
end
604608
end
605609
end
610+
606611
module Products
607612
module Variants
608613
class Index
609614
def call(_env)
610615
[200, {}, ["Hello from Nested::Controllers::Products::Variants::Index"]]
611616
end
612617
end
618+
613619
class Show
614620
def call(_env)
615621
[200, {}, ["Hello from Nested::Controllers::Products::Variants::Show"]]
@@ -696,6 +702,7 @@ def call(*)
696702
[200, {}, ["User::Post::Destroy"]]
697703
end
698704
end
705+
699706
module Comment
700707
class New < Action
701708
def call(*)

0 commit comments

Comments
 (0)