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 CHANGED
@@ -84,7 +84,7 @@ game.player2.type # => "poker player2"
84
84
  Note that dependencies using the defaults can be declared when dejecting the class:
85
85
 
86
86
  ```ruby
87
- lass Game
87
+ class Game
88
88
  # this
89
89
  Deject self
90
90
  dependency :player1
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Deject
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -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.dependency(:client) { client }
65
+ Service.override(:client) { client }
66
66
  Service.new('mei').login
67
67
  end
68
68
 
@@ -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 :dep }.should == ""
61
- catch_stderr { klass.dependency :dep }.should =~ /deprecat/i
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.0
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: &70254829462080 !ruby/object:Gem::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: *70254829462080
24
+ version_requirements: *70118660588240
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: pry
27
- requirement: &70254829461380 !ruby/object:Gem::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: *70254829461380
35
+ version_requirements: *70118660586140
36
36
  description: Provides a super simple API for dependency injection
37
37
  email:
38
38
  - josh.cheek@gmail.com