dryer_routes 0.2.0 → 0.2.2

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: 015aa7bef2aabd6664dcd8241e54d715e71d601657d3574e98e138c9246b975e
4
- data.tar.gz: f15be3a32a714a482227b993749fca0504eb86bad7f1de72ffa6551b1bbfc3c7
3
+ metadata.gz: 4a133f0a65c2b005f047880978e21502314b61d5a2553c75fa08cebf7059a2f2
4
+ data.tar.gz: 2d6c30dcaa3d7558b9544e3bea8c999f67d334f2d62c21a9d43a511747cc1dac
5
5
  SHA512:
6
- metadata.gz: 5557b567f5b5087fd5d7e96a4fe111368030981e1596b5821a8f610e8908f4f8b5e29aa9d56982c5ba6d43e1d6bea6d774b3f6bb6dce0f0581c296cbc2324c15
7
- data.tar.gz: c21afbd663f56d9e93117757261f7d4176f64df671d41d71d293cb82f5097485e63fedd302c91efd0d1632a6d213d0ff2527782327aea5dfcc207304b6ddbe48
6
+ metadata.gz: 5f31bd2c263ed221cda9edb8adda25a202c02046db8657977d96456700cb09fa3e6e383e3c3e0d15e3edd7efe5771fc3d0d6d53e9fc0b5799ae5724c7ba1292d
7
+ data.tar.gz: 243599ab47690a8a38a77d70d78650a179a49b7027880dc0662999cc16e814e0206315f2c93a7f88639f07041b7fbcac5cc9ece7708aa4e05b7641133b5082fd
data/README.md CHANGED
@@ -138,12 +138,10 @@ end
138
138
  ```
139
139
 
140
140
  ## Development
141
- This gem is set up to be developed using [Nix](https://nixos.org/)
142
- Once you have nix installed you can run
143
- `make bundle`
144
- to install all dependencies and
145
- `make dev-shell`
146
- to enter the development environment.
141
+ This gem is set up to be developed using [Nix](https://nixos.org/) and
142
+ [ruby_gem_dev_shell](https://github.com/jbernie2/ruby_gem_dev_shell)
143
+ Once you have nix installed you can run `make env` to enter the development
144
+ environment and then `make` to see the list of available commands
147
145
 
148
146
  ## Contributing
149
147
  Please create a github issue to report any problems using the Gem.
data/dryer_routes.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'dryer_routes'
3
- spec.version = "0.2.0"
3
+ spec.version = "0.2.2"
4
4
  spec.authors = ['John Bernier']
5
5
  spec.email = ['john.b.bernier@gmail.com']
6
6
  spec.summary = 'Typed routing for rails leveraging dry-validation contracts'
@@ -12,6 +12,7 @@ module Dryer
12
12
  end
13
13
 
14
14
  def register(*resources)
15
+ resources = resources[0].is_a?(Array) ? resources[0] : resources
15
16
  validate_resources!(resources)
16
17
  @resources = resources
17
18
  @routes = resources.map do |r|
@@ -53,8 +54,8 @@ module Dryer
53
54
 
54
55
  def route_for(controller:, method:)
55
56
  @routes.filter do |r|
56
- r.controller == controller
57
- r.method == method
57
+ r.controller == controller &&
58
+ r.method == method
58
59
  end.first
59
60
  end
60
61
 
@@ -91,6 +92,7 @@ module Dryer
91
92
  errors = resources.map do |r|
92
93
  ResourceSchema.new.call(r)
93
94
  end.select { |r| !r.errors.empty? }
95
+
94
96
  if !errors.empty?
95
97
  messages = errors.inject({}) do |messages, e|
96
98
  messages.merge(e.errors.to_h)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dryer_routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bernier