roda-flow 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -0
  3. data/lib/roda/plugins/flow.rb +0 -4
  4. metadata +3 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4d4b0303ce594d2a42f684180275547d9e11032
4
- data.tar.gz: 510747bc0c24a158d2149db5575607721a92b862
3
+ metadata.gz: 86905c43a6c3bb4805e113ee177e342be147023a
4
+ data.tar.gz: 9344e50a4ea579324ba2248d2d0e8fb69fe5a788
5
5
  SHA512:
6
- metadata.gz: 9b3b29ef6f199663fed4ef668a3cac41204320bc975d6262e9dc2664bf4d28b0d379b902543e3776e02ad3beff391d2010660a97a3c9be3c6a3e748d5cd1c7f7
7
- data.tar.gz: 8f92a3583f9c52bd3de118e0f3fb7548b9f6e417c12140320b518e1ac6d753add978328ff146f783bbb1a709748076d72fc2f4836dfb51cbfa31d19a124decc4
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|
@@ -1,10 +1,6 @@
1
1
  class Roda
2
2
  module RodaPlugins
3
3
  module Flow
4
- def self.load_dependencies(app, _opts = nil)
5
- app.plugin :container
6
- end
7
-
8
4
  module RequestMethods
9
5
  def resolve(*args, &block)
10
6
  on(resolve: args, &block)
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.2.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: 2015-10-02 00:00:00.000000000 Z
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.4.5.1
113
+ rubygems_version: 2.5.1
142
114
  signing_key:
143
115
  specification_version: 4
144
116
  summary: ''