injection 2.0.0 → 2.0.1
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.
- data/README.rdoc +14 -14
- data/lib/injection/railtie.rb +1 -1
- data/lib/injection/version.rb +1 -1
- data/spec/dummy/config/initializers/init_my_object.rb +1 -0
- data/spec/rails_integration_spec.rb +9 -0
- metadata +8 -4
data/README.rdoc
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
==
|
1
|
+
== Description
|
2
2
|
|
3
|
-
Injection is a simple dependency injection plugin for
|
3
|
+
Injection is a simple dependency injection plugin for Rails 3. It allows you to inject objects into your controllers and observers which have been described in a yaml file (config/objects.yml).
|
4
4
|
|
5
|
-
*
|
5
|
+
* http://github.com/atomicobject/injection
|
6
6
|
|
7
|
-
(for the
|
7
|
+
(for the Rails 2 plugin install from the rails_2_plugin tag of this repository)
|
8
8
|
|
9
|
-
==
|
9
|
+
== Features
|
10
10
|
|
11
11
|
* Declarative dependency injection that automatically instantiates ivars via the objects.yml file
|
12
12
|
|
13
|
-
==
|
13
|
+
== Synopsis
|
14
14
|
To specify objects to be injected from the DIY context into your controller or observer
|
15
15
|
use the inject class method:
|
16
16
|
|
@@ -58,7 +58,7 @@ Injection is a simple dependency injection plugin for rails3. It allows you to i
|
|
58
58
|
|
59
59
|
=== Declarative Observations
|
60
60
|
|
61
|
-
Observations on an
|
61
|
+
Observations on an Active Record object can be specified in a declarative way using
|
62
62
|
the before and after class methods. The methods are invoked with a
|
63
63
|
symbol which specifies what kind of event the observer is interested in, and a block
|
64
64
|
that defines what actions it will perform.
|
@@ -81,20 +81,20 @@ Injection is a simple dependency injection plugin for rails3. It allows you to i
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
==
|
84
|
+
== Requirements
|
85
85
|
|
86
|
-
* constructor
|
87
|
-
* diy
|
86
|
+
* constructor[http://rubygems.org/gems/constructor]
|
87
|
+
* diy[http://rubygems.org/gems/diy]
|
88
88
|
|
89
|
-
==
|
89
|
+
== Install
|
90
90
|
|
91
91
|
* gem install injection
|
92
92
|
|
93
|
-
==
|
93
|
+
== License
|
94
94
|
|
95
95
|
(The MIT License)
|
96
96
|
|
97
|
-
Copyright (c) 2007-
|
97
|
+
Copyright (c) 2007-2011 Atomic Object
|
98
98
|
|
99
99
|
Permission is hereby granted, free of charge, to any person obtaining
|
100
100
|
a copy of this software and associated documentation files (the
|
@@ -113,4 +113,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
113
113
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
114
114
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
115
115
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
116
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
116
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/injection/railtie.rb
CHANGED
data/lib/injection/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
MY_OBJECT = Injection.context['my_object']
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: injection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 1
|
10
|
+
version: 2.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Atomic Object
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-02-11 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- spec/dummy/config/environments/test.rb
|
124
124
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
125
125
|
- spec/dummy/config/initializers/inflections.rb
|
126
|
+
- spec/dummy/config/initializers/init_my_object.rb
|
126
127
|
- spec/dummy/config/initializers/mime_types.rb
|
127
128
|
- spec/dummy/config/initializers/secret_token.rb
|
128
129
|
- spec/dummy/config/initializers/session_store.rb
|
@@ -146,6 +147,7 @@ files:
|
|
146
147
|
- spec/dummy/public/stylesheets/.gitkeep
|
147
148
|
- spec/dummy/script/rails
|
148
149
|
- spec/observer_inject_spec.rb
|
150
|
+
- spec/rails_integration_spec.rb
|
149
151
|
- spec/spec_helper.rb
|
150
152
|
has_rdoc: true
|
151
153
|
homepage: https://github.com/atomicobject/injection
|
@@ -197,6 +199,7 @@ test_files:
|
|
197
199
|
- spec/dummy/config/environments/test.rb
|
198
200
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
199
201
|
- spec/dummy/config/initializers/inflections.rb
|
202
|
+
- spec/dummy/config/initializers/init_my_object.rb
|
200
203
|
- spec/dummy/config/initializers/mime_types.rb
|
201
204
|
- spec/dummy/config/initializers/secret_token.rb
|
202
205
|
- spec/dummy/config/initializers/session_store.rb
|
@@ -220,4 +223,5 @@ test_files:
|
|
220
223
|
- spec/dummy/public/stylesheets/.gitkeep
|
221
224
|
- spec/dummy/script/rails
|
222
225
|
- spec/observer_inject_spec.rb
|
226
|
+
- spec/rails_integration_spec.rb
|
223
227
|
- spec/spec_helper.rb
|