dim 1.2.5 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/dim.rb +7 -0
- data/lib/version.rb +1 -1
- data/spec/dim_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODM5ZDVmNzNjOGE3Yzc1MjBhMWIwNjQ3MGIxYzU3ZDUxMjIwZWVjZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWEwMDRhNWZlNzQ3Y2ZjZDMxOTA5NzM2MDVjY2QwODZmNzAxZmExMg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2E5ODE4MGFhNjM4OTlhYzFkMWFmZDVkZjA1MjBiNmNmMmE5OWMwNTEzZDBi
|
10
|
+
NzYyZmNjMTBhNTk4NGM1NjYzNjdjZDJkYWY0ZTY3NGEzOTNhOTFhN2NiMmYz
|
11
|
+
ZWIzY2Q5ODZlNWVmOGY3MWQ4NmMxZTJmN2EzMzU2NDEwMTFlZGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDJlOTc4ZTFiYTk1ZTA4NThjNjRiMzUyN2UxYzY5MmY0MDc1MDVjMzJmNzU1
|
14
|
+
YjI2ZjczOTI1ZTk4OGU3ZWU3MzIyZDMyNzkyMzQwNjI2OWQxY2Y3ODA1ZjFi
|
15
|
+
NDM3YzkzZGQyMTRmYzgyNTRjNjI4OWZkYjU4Y2UyMjhiNTlkNWE=
|
data/lib/dim.rb
CHANGED
@@ -72,6 +72,13 @@ module Dim
|
|
72
72
|
register(name,false,&block)
|
73
73
|
end
|
74
74
|
|
75
|
+
# Given a list of services, check to see if they are available, returning true or false.
|
76
|
+
def verify_dependencies(*names)
|
77
|
+
names.all? { |name| service_block(name) }
|
78
|
+
rescue Dim::MissingServiceError
|
79
|
+
false
|
80
|
+
end
|
81
|
+
|
75
82
|
# Lookup a service from ENV variables, or use a default if given; fall back to searching the container and its parents for a default value
|
76
83
|
def register_env(name,default = nil)
|
77
84
|
if value = ENV[name.to_s.upcase]
|
data/lib/version.rb
CHANGED
data/spec/dim_spec.rb
CHANGED
@@ -206,4 +206,10 @@ describe Dim::Container do
|
|
206
206
|
}
|
207
207
|
end
|
208
208
|
end
|
209
|
+
|
210
|
+
Scenario "verifying dependencies" do
|
211
|
+
Given { container.register(:app) { :app } }
|
212
|
+
Then { container.verify_dependencies(:app).should == true }
|
213
|
+
Then { container.verify_dependencies(:app,:frobosh).should == false }
|
214
|
+
end
|
209
215
|
end
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Weirich
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|