dim 1.2.0 → 1.2.2

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dim (1.2.0)
4
+ dim (1.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/dim.rb CHANGED
@@ -97,6 +97,11 @@ module Dim
97
97
  @services[name] || @parent.service_block(name)
98
98
  end
99
99
 
100
+ # Resets the cached services
101
+ def clear_cache!
102
+ @cache = {}
103
+ end
104
+
100
105
  # Searching for a service block only reaches the Container class
101
106
  # when all the containers in the hierarchy search chain have no
102
107
  # entry for the service. In this case, the only thing to do is
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dim
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.2"
3
3
  end
data/spec/dim_spec.rb CHANGED
@@ -39,6 +39,14 @@ describe Dim::Container do
39
39
  Then { container.app.should be(app) }
40
40
  end
41
41
 
42
+ it "clears cache explicitly" do
43
+ container.register(:app) { App.new }
44
+ app_before = container.app
45
+ container.clear_cache!
46
+ app_after = container.app
47
+ app_before.should_not == app_after
48
+ end
49
+
42
50
  Scenario "contructing dependent objects" do
43
51
  Given { container.register(:app) { |c| App.new(c.logger) } }
44
52
  Given { container.register(:logger) { Logger.new } }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dim
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-06-19 00:00:00.000000000 Z
13
+ date: 2012-08-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec