deject 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.md +1 -1
- data/lib/deject.rb +1 -1
- data/lib/deject/version.rb +1 -1
- data/spec/acceptance_spec.rb +1 -1
- data/spec/class_methods_spec.rb +3 -2
- metadata +5 -5
data/Readme.md
CHANGED
data/lib/deject.rb
CHANGED
@@ -76,7 +76,7 @@ def Deject(klass, *initial_dependencies)
|
|
76
76
|
# define klass.dependency
|
77
77
|
klass.define_singleton_method :dependency do |meth, &default_block|
|
78
78
|
if instance_exec meth, &has_dependency
|
79
|
-
warn "Deprecation: Use .override instead of .dependency to override a dependency"
|
79
|
+
warn "Deprecation: Use .override instead of .dependency to override a dependency (#{meth})"
|
80
80
|
end
|
81
81
|
instance_exec meth, default_block, &define_instance_methods
|
82
82
|
end
|
data/lib/deject/version.rb
CHANGED
data/spec/acceptance_spec.rb
CHANGED
@@ -62,7 +62,7 @@ describe Deject, 'acceptance tests' do
|
|
62
62
|
# overriding the default at class level
|
63
63
|
client = double('Mock Client 2')
|
64
64
|
client.should_receive(:login).with('mei')
|
65
|
-
Service.
|
65
|
+
Service.override(:client) { client }
|
66
66
|
Service.new('mei').login
|
67
67
|
end
|
68
68
|
|
data/spec/class_methods_spec.rb
CHANGED
@@ -57,8 +57,9 @@ describe 'Klass.dependency' do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'writes a deprecated warning when using dependency to override an existing dependency' do
|
60
|
-
catch_stderr { klass.dependency :
|
61
|
-
catch_stderr { klass.dependency :
|
60
|
+
catch_stderr { klass.dependency :meth }.should == ""
|
61
|
+
catch_stderr { klass.dependency :meth }.should =~ /deprecat/i
|
62
|
+
catch_stderr { klass.dependency :meth }.should =~ /meth/i
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-04-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70118660588240 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70118660588240
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: pry
|
27
|
-
requirement: &
|
27
|
+
requirement: &70118660586140 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70118660586140
|
36
36
|
description: Provides a super simple API for dependency injection
|
37
37
|
email:
|
38
38
|
- josh.cheek@gmail.com
|