hanami-router 1.0.0.beta1 → 1.0.0.beta2

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
  SHA1:
3
- metadata.gz: 459ea54d61819ab58f2fbaf0e0ee5dc14386ce58
4
- data.tar.gz: 3507f38ff7540320daf7c086af56db3861d8108b
3
+ metadata.gz: f6efe1bf0b84ce27d1aba7571f7d57faee9e63dd
4
+ data.tar.gz: 18ae4097f5a5584a5500e3421120fc62b9c6b4d8
5
5
  SHA512:
6
- metadata.gz: 6a5b0fa43e6dcaffa276be494bb3abec4be4cd58a0d8049ec78e7ca6d736e5f272b9e8743d4fef9629841c79f49c812468ec2f4d91a01f0bd3da26733501fa01
7
- data.tar.gz: 8b9e93acf33e481ea75547c2c97c0f20c8b9bb52e9d3ed32243795bde569f087409b01ce6dc4731b977c2fed0a1a7ac0a79c030d88fbb99ef1ad5826a6cc4bdf
6
+ metadata.gz: 357ad670d55be64cb067e53df95b5b2f30483869c6c9991978e842ed293508b095813a10129dcddc76ddfe3017384b1ebe28930351136c9420337f88aa2743aa
7
+ data.tar.gz: 7762a3896731fb24cb81651fe1d5e845f716a51a827ea33bcbb199b4fd9ad4029ad2549a176259d0e0c75b62c7b9fea864a8330f571f24997fe448a720698be8
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Hanami::Router
2
2
  Rack compatible HTTP router for Ruby
3
3
 
4
+ ## v1.0.0.beta2 - 2017-03-02
5
+ ### Fixed
6
+ - [Valentyn Ostakh] Deep symbolize params from parsed body
7
+ - [Luca Guidi] `Hanami::Router#recognize` must return a non-routeable object when the endpoint cannot be resolved
8
+
4
9
  ## v1.0.0.beta1 - 2017-02-14
5
10
  ### Added
6
11
  - [Luca Guidi] Official support for Ruby: MRI 2.4
@@ -1,6 +1,6 @@
1
1
  module Hanami
2
2
  class Router
3
3
  # @since 0.1.0
4
- VERSION = '1.0.0.beta1'.freeze
4
+ VERSION = '1.0.0.beta2'.freeze
5
5
  end
6
6
  end
@@ -45,6 +45,13 @@ module Hanami
45
45
  "#<#{ __getobj__.class }>"
46
46
  end
47
47
  end
48
+
49
+ # @since 1.0.0.beta2
50
+ # @api private
51
+ def routable?
52
+ !__getobj__.nil?
53
+ rescue ArgumentError
54
+ end
48
55
  end
49
56
 
50
57
  # Routing endpoint
@@ -58,7 +58,7 @@ module Hanami
58
58
 
59
59
  def _symbolize(body)
60
60
  if body.is_a?(Hash)
61
- Utils::Hash.new(body).deep_dup.symbolize!.to_h
61
+ Utils::Hash.new(body).deep_dup.deep_symbolize!.to_h
62
62
  else
63
63
  { FALLBACK_KEY => body }
64
64
  end
@@ -146,7 +146,7 @@ module Hanami
146
146
  # puts router.recognize('/').routable? # => true
147
147
  # puts router.recognize('/foo').routable? # => false
148
148
  def routable?
149
- !@endpoint.nil?
149
+ @endpoint&.routable?
150
150
  end
151
151
 
152
152
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-router
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta1
4
+ version: 1.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-02-14 00:00:00.000000000 Z
13
+ date: 2017-03-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack