hanami-router 2.0.0.alpha5 → 2.0.0.alpha6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d72d9efd8d4b3b0df52796170481b05878e531b2aee3ea09894e6eeccb5562e6
4
- data.tar.gz: 2078b5956054db900fe4d2f097b62901499ceb1622a57baae326fa921ef62f48
3
+ metadata.gz: 8d4b765c647ddf0aa30e30b516bc8e449a9734d6de8f8466c5e9ae96051b8b2b
4
+ data.tar.gz: 6b6728d2cb184ac2924fad9b36e0d61396b9dde66c95894a694c831291e113b5
5
5
  SHA512:
6
- metadata.gz: 5409a722ae69fc035fcbe54138ecfe504d97d9dcd62f0c3ce04a93f2fa5ca40aa833813b491a3a13d1db972e8e352e9d7e89948dfa3f522d99beafae4908e961
7
- data.tar.gz: 55505b92589cb74795bd01a6062d32effce16a56d0405b98e726d0ba9d3b54ca301fb464cf0826fdac7e45f1de23a15913a211359c2f908117b1e972684b90d7
6
+ metadata.gz: e2553b5cae230e21181467afce6950bd3df79e17e6351bc8f9b92bf4577ccaf4f7b773d11d67d88e3fe9fa789fcefd5211dd721ea1e723c16414e2d2670594d3
7
+ data.tar.gz: 247718a876404665267bdeb523944a73b55d9f7e846b11888e022f0fcfac39c8514f2dca60b030e8820ac3958bc666f766229793a04f992bca328cbd0c3e2919
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Hanami::Router
2
2
  Rack compatible HTTP router for Ruby
3
3
 
4
+ ## v2.0.0.alpha6 - 2022-02-10
5
+ ### Added
6
+ - [Luca Guidi] Official support for MRI 3.1
7
+ - [Luca Guidi] Parse non-GET request body and make it available in Rack env under the `router.params` key. For JSON requests, please use `Hanami:::Middleware::JsonParser`
8
+
9
+ ### Changed
10
+ - [Luca Guidi] Drop support for Ruby: MRI 2.6, and 2.7.
11
+
4
12
  ## v2.0.0.alpha5 - 2021-05-04
5
13
  ### Added
6
14
  - [Luca Guidi] Introduced `Hanami::Router#to_inspect` which returns a string blob with all the routes formatted for human readability
data/README.md CHANGED
@@ -2,11 +2,15 @@
2
2
 
3
3
  Rack compatible, lightweight and fast HTTP Router for Ruby and [Hanami](http://hanamirb.org).
4
4
 
5
+ ## Version
6
+
7
+ **This branch contains the code for `hanami-router` 2.x.**
8
+
5
9
  ## Status
6
10
 
7
11
  [![Gem Version](https://badge.fury.io/rb/hanami-router.svg)](https://badge.fury.io/rb/hanami-router)
8
- [![CI](https://github.com/hanami/router/workflows/ci/badge.svg?branch=unstable)](https://github.com/hanami/router/actions?query=workflow%3Aci+branch%3Aunstable)
9
- [![Test Coverage](https://codecov.io/gh/hanami/router/branch/unstable/graph/badge.svg)](https://codecov.io/gh/hanami/router)
12
+ [![CI](https://github.com/hanami/router/workflows/ci/badge.svg?branch=main)](https://github.com/hanami/router/actions?query=workflow%3Aci+branch%3Amain)
13
+ [![Test Coverage](https://codecov.io/gh/hanami/router/branch/main/graph/badge.svg)](https://codecov.io/gh/hanami/router)
10
14
  [![Depfu](https://badges.depfu.com/badges/5f6b8e8fa3b0d082539f0b0f84d55960/overview.svg)](https://depfu.com/github/hanami/router?project=Bundler)
11
15
  [![Inline Docs](http://inch-ci.org/github/hanami/router.svg)](http://inch-ci.org/github/hanami/router)
12
16
 
@@ -21,7 +25,7 @@ Rack compatible, lightweight and fast HTTP Router for Ruby and [Hanami](http://h
21
25
 
22
26
  ## Rubies
23
27
 
24
- __Hanami::Router__ supports Ruby (MRI) 2.6+
28
+ __Hanami::Router__ supports Ruby (MRI) 3.0+
25
29
 
26
30
 
27
31
  ## Installation
@@ -361,6 +365,4 @@ __Hanami::Router__ uses [Semantic Versioning 2.0.0](http://semver.org)
361
365
 
362
366
  ## Copyright
363
367
 
364
- Copyright © 2014-2021 Luca Guidi – Released under MIT License
365
-
366
- This project was formerly known as Lotus (`lotus-router`).
368
+ Copyright © 2014-2022 Hanami Team – Released under MIT License
@@ -18,7 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = []
19
19
  spec.test_files = spec.files.grep(%r{^(test)/})
20
20
  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"
22
23
 
23
24
  spec.add_dependency "rack", "~> 2.0"
24
25
  spec.add_dependency "mustermann", "~> 1.0"
@@ -29,6 +30,6 @@ Gem::Specification.new do |spec|
29
30
  spec.add_development_dependency "rack-test", "~> 1.0"
30
31
  spec.add_development_dependency "rspec", "~> 3.8"
31
32
 
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"
34
35
  end
@@ -17,7 +17,7 @@ module Hanami
17
17
 
18
18
  # @since 1.3.0
19
19
  # @api private
20
- MEDIA_TYPE_MATCHER = /\s*[;,]\s*/.freeze
20
+ MEDIA_TYPE_MATCHER = /\s*[;,]\s*/
21
21
 
22
22
  # @since 1.3.0
23
23
  # @api private
@@ -48,11 +48,11 @@ module Hanami
48
48
 
49
49
  # @since 2.0.0
50
50
  # @api private
51
- DEFAULT_SEPARATOR_REGEXP = /\//.freeze
51
+ DEFAULT_SEPARATOR_REGEXP = /\//
52
52
 
53
53
  # @since 2.0.0
54
54
  # @api private
55
- DOUBLE_DEFAULT_SEPARATOR_REGEXP = /\/{2,}/.freeze
55
+ DOUBLE_DEFAULT_SEPARATOR_REGEXP = /\/{2,}/
56
56
 
57
57
  # @since 2.0.0
58
58
  # @api private
@@ -4,6 +4,6 @@ module Hanami
4
4
  class Router
5
5
  # @since 0.1.0
6
6
  # @api public
7
- VERSION = "2.0.0.alpha5"
7
+ VERSION = "2.0.0.alpha6"
8
8
  end
9
9
  end
data/lib/hanami/router.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "rack"
3
4
  require "rack/utils"
4
5
 
5
6
  module Hanami
@@ -868,7 +869,13 @@ module Hanami
868
869
  def _params(env, params)
869
870
  params ||= {}
870
871
  env[PARAMS] ||= {}
871
- env[PARAMS].merge!(Rack::Utils.parse_nested_query(env["QUERY_STRING"]))
872
+
873
+ if (input = env[Rack::RACK_INPUT]) and input.rewind
874
+ env[PARAMS].merge!(Rack::Utils.parse_nested_query(input.read))
875
+ input.rewind
876
+ end
877
+
878
+ env[PARAMS].merge!(Rack::Utils.parse_nested_query(env[Rack::QUERY_STRING]))
872
879
  env[PARAMS].merge!(params)
873
880
  env[PARAMS] = Params.deep_symbolize(env[PARAMS])
874
881
  env
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-router
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.alpha5
4
+ version: 2.0.0.alpha6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-04 00:00:00.000000000 Z
11
+ date: 2022-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -118,30 +118,30 @@ dependencies:
118
118
  name: rubocop
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
- - - '='
121
+ - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '0.91'
123
+ version: '1.0'
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - '='
128
+ - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '0.91'
130
+ version: '1.0'
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: rubocop-performance
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
- - - '='
135
+ - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: 1.8.1
137
+ version: '1.0'
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - '='
142
+ - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: 1.8.1
144
+ version: '1.0'
145
145
  description: Rack compatible HTTP router for Ruby
146
146
  email:
147
147
  - me@lucaguidi.com
@@ -176,7 +176,8 @@ files:
176
176
  homepage: http://hanamirb.org
177
177
  licenses:
178
178
  - MIT
179
- metadata: {}
179
+ metadata:
180
+ rubygems_mfa_required: 'true'
180
181
  post_install_message:
181
182
  rdoc_options: []
182
183
  require_paths:
@@ -185,14 +186,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
185
186
  requirements:
186
187
  - - ">="
187
188
  - !ruby/object:Gem::Version
188
- version: 2.6.0
189
+ version: '3.0'
189
190
  required_rubygems_version: !ruby/object:Gem::Requirement
190
191
  requirements:
191
192
  - - ">"
192
193
  - !ruby/object:Gem::Version
193
194
  version: 1.3.1
194
195
  requirements: []
195
- rubygems_version: 3.2.4
196
+ rubygems_version: 3.3.3
196
197
  signing_key:
197
198
  specification_version: 4
198
199
  summary: Rack compatible HTTP router for Ruby and Hanami