injection 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,16 +1,16 @@
1
- == DESCRIPTION:
1
+ == Description
2
2
 
3
- Injection is a simple dependency injection plugin for rails3. It allows you to inject objects into your controllers and observers which have been described in a yaml file (config/objects.yml).
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
- * https://github.com/atomicobject/injection
5
+ * http://github.com/atomicobject/injection
6
6
 
7
- (for the rails2 plugin install from the rails_2_plugin tag of this repository)
7
+ (for the Rails 2 plugin install from the rails_2_plugin tag of this repository)
8
8
 
9
- == FEATURES/PROBLEMS:
9
+ == Features
10
10
 
11
11
  * Declarative dependency injection that automatically instantiates ivars via the objects.yml file
12
12
 
13
- == SYNOPSIS:
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 active record object can be specified in a declarative way using
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
- == REQUIREMENTS:
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
- == INSTALL:
89
+ == Install
90
90
 
91
91
  * gem install injection
92
92
 
93
- == LICENSE:
93
+ == License
94
94
 
95
95
  (The MIT License)
96
96
 
97
- Copyright (c) 2007-2010 Atomic Object
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.
@@ -6,7 +6,7 @@ module Injection
6
6
  Injection.context_file = ::Rails.root.to_s + '/config/objects.yml'
7
7
  end
8
8
 
9
- config.after_initialize do
9
+ config.before_initialize do
10
10
  # Let Rails do the auto loading
11
11
  DIY::Context.auto_require = false
12
12
 
@@ -1,3 +1,3 @@
1
1
  module Injection
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
@@ -0,0 +1 @@
1
+ MY_OBJECT = Injection.context['my_object']
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Rails Integration' do
4
+ it "makes the context available to Rails initializers" do
5
+ # There is a config/initializers file that sets the MY_OBJECT to
6
+ # something from the context
7
+ MY_OBJECT.should be
8
+ end
9
+ end
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: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 0
10
- version: 2.0.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-01-02 00:00:00 -05:00
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