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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjkxNzk1YWJkYzEwNzUxZmI5NTM3YzViYzJiYjdkYTdmZmNjYmY1Mg==
4
+ ODM5ZDVmNzNjOGE3Yzc1MjBhMWIwNjQ3MGIxYzU3ZDUxMjIwZWVjZA==
5
5
  data.tar.gz: !binary |-
6
- YmNkOWVjZjc4OWI2NThjNzVjZDkwMjMzNjNjMDE3ZjUwMGZmOTBhMA==
6
+ ZWEwMDRhNWZlNzQ3Y2ZjZDMxOTA5NzM2MDVjY2QwODZmNzAxZmExMg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NWMyZmE0ZDA1ZWQyNDFiNTY0MTA3NmQ1YmUxNDE4NWViMjllZjQ0NjM5ZTg0
10
- OGM4MDgxZTg0OTc5NDdmZWZiZWE2NDcyMDFlODNlNzkwMmUwNWZkODZiYjJj
11
- MzQ2ODhiNjI3ZTgxMDM5ZWIyN2UyNzBhNTIxNzE3OTIwNDM3ZjY=
9
+ N2E5ODE4MGFhNjM4OTlhYzFkMWFmZDVkZjA1MjBiNmNmMmE5OWMwNTEzZDBi
10
+ NzYyZmNjMTBhNTk4NGM1NjYzNjdjZDJkYWY0ZTY3NGEzOTNhOTFhN2NiMmYz
11
+ ZWIzY2Q5ODZlNWVmOGY3MWQ4NmMxZTJmN2EzMzU2NDEwMTFlZGQ=
12
12
  data.tar.gz: !binary |-
13
- MTk4NDRmZTYzZDEwYzg5MWM1YzdkM2YzYzYzNTVkMGY4ZjY0YTFlOTQyYWNj
14
- MGM1NTA3ZDIxYmEzOTU2YTA4NDEzNDE2M2Y1ZDk2YmY5OTA1NzNjODBiMzFj
15
- MzAzMDNhMzQ0NTYzNWFkODhjYjcyMzQ3NGU4ZGFiYzA3MzA4ZGI=
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]
@@ -1,3 +1,3 @@
1
1
  module Dim
2
- VERSION = "1.2.5"
2
+ VERSION = "1.2.6"
3
3
  end
@@ -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.5
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-07-31 00:00:00.000000000 Z
12
+ date: 2013-11-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec