roda-flow 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/lib/roda/plugins/flow.rb +0 -4
- metadata +3 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86905c43a6c3bb4805e113ee177e342be147023a
|
4
|
+
data.tar.gz: 9344e50a4ea579324ba2248d2d0e8fb69fe5a788
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b39e48db67a5f410a044cb66ae274dc542952f019459f7c4601da939a88885f9c499164ebbdc07b2c25633cc672e818186090b1fbcbbf909f299ca6ac3d8e437
|
7
|
+
data.tar.gz: ef768e04423d6b85093b615f5add2db0a764c77ad473d8bdd806cf3ccbaf0b3cef532ac8edf66ef8ce06c24ed40595e47a9fab61b8aea051a7c0c7fda0362bf4
|
data/README.md
CHANGED
@@ -1,6 +1,20 @@
|
|
1
1
|
# roda-flow
|
2
2
|
|
3
|
+
Resolve objects from an IoC container within the flow of your Roda routes.
|
4
|
+
|
5
|
+
## Requirements
|
6
|
+
|
7
|
+
Your Roda application class must respond to the `.resolve(container_key)` method and return the object matching the container key.
|
8
|
+
|
9
|
+
You can implement this method yourself, with your own container, or you can use the [roda-container](https://github.com/AMHOL/roda-container) plugin to turn your Roda app into a [dry-container](https://github.com/dry-rb/dry-container) and offer the `.resolve` method for you.
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
This example uses the roda-container plugin.
|
14
|
+
|
3
15
|
```ruby
|
16
|
+
require "roda/plugins/container"
|
17
|
+
|
4
18
|
User = Struct.new(:id, :name, :email)
|
5
19
|
|
6
20
|
class Repository
|
@@ -100,6 +114,7 @@ end
|
|
100
114
|
class App < Roda
|
101
115
|
plugin :all_verbs
|
102
116
|
plugin :json
|
117
|
+
plugin :container
|
103
118
|
plugin :flow
|
104
119
|
|
105
120
|
route do |r|
|
data/lib/roda/plugins/flow.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roda-flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Holland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: dry-container
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.2.4
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.2.4
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: roda-container
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
13
|
- !ruby/object:Gem::Dependency
|
42
14
|
name: bundler
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
110
|
version: '0'
|
139
111
|
requirements: []
|
140
112
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.5.1
|
142
114
|
signing_key:
|
143
115
|
specification_version: 4
|
144
116
|
summary: ''
|