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 +1 -1
- data/lib/dim.rb +5 -0
- data/lib/version.rb +1 -1
- data/spec/dim_spec.rb +8 -0
- metadata +2 -2
data/Gemfile.lock
CHANGED
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
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.
|
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-
|
13
|
+
date: 2012-08-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|