dryer_routes 0.1.0 → 0.2.1

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: 5c4ab11a10ae2c4b6cdfe2c82e054e1e9ef730ff3bf10c123bb0dfe8bbab05b2
4
- data.tar.gz: 2d3f288428329f0c3b8f42f52fc0aead1830db85bc4ec02919bed1ed303ec877
3
+ metadata.gz: b1eeae5f0fc8aedeb1206fe5cf82eb40adbe9a111ba61cd8ca8b3e7b91131a12
4
+ data.tar.gz: 41af9d49fbbe513df716b53b7c2fad558e0917f81d922655ee26274cb0415dcf
5
5
  SHA512:
6
- metadata.gz: 80149658ca6548e6f20eec62f6b8aef9678b83d8facc163e9107a04b18f0b1094f6c36055bca64d43a3667a7f608930769a9d4ea6be87f4697e6289883eaad39
7
- data.tar.gz: f814d934d8102e65e29f80d78df36068c63342d1b33bc3a0c5c3805bfaffaecb2cac7624394a14a93a3118359404fa4a7d0bce1cd0ff2386b0aa11fc7a4d4913
6
+ metadata.gz: 3ef95e5e70df6a9c19204a20b207351ddcaa27fcf74a55171771be603835d7c48ed24e3e9bc07a632118ff70ca54789314c7ba43a0a92a2017f5de5d1338344e
7
+ data.tar.gz: e16921263a026ee8ca3543231afb24230174f6f5deed7535a1ff137bc7fb626b318ef64bd036d9a4a00910a8c6837fff1a3d17e8fc7632ac175e17775e8abb1c
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.1.0"
3
+ spec.version = "0.2.1"
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'
@@ -11,7 +11,8 @@ module Dryer
11
11
  @routes = []
12
12
  end
13
13
 
14
- def register(*resources)
14
+ def register(resources)
15
+ resources = resources.is_a?(Array) ? resources : [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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dryer_routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bernier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-06 00:00:00.000000000 Z
11
+ date: 1980-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-validation
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.4.13
122
+ rubygems_version: 3.4.22
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Typed routing for rails leveraging dry-validation contracts