hubcap 1.1.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec9cecf4b71e69d8361217640dca39aef5135028
4
- data.tar.gz: 42e2d26f932995b23e2b63c8c3cfc0d6d6e1632a
3
+ metadata.gz: b6c7801199d9b0a21c799941f3ef21c7734562bd
4
+ data.tar.gz: 30d80572504bef6604ec5732794fe03e07b5af08
5
5
  SHA512:
6
- metadata.gz: b91df5081cd0693c3ee1f056c1e50d8c01cce07d7e6caa66916cd06ecfd18a989ef6050bce2720794906e6cc0ae1532bfd84b5463de1cefbe36375374c13f172
7
- data.tar.gz: ac8cb0c8e22b6544f34de9b46e7f0d6142846e011392d57186e5ac997884d8412d5f94973003a1edb09366bf9d9daf40caa62cffaddf9d8ad4c22a9ec66cce3f
6
+ metadata.gz: 1b4e62ef8235240a68b5f9dc9920069cda86c099edbc2fa1e4d8d8628e78ac573a21190561ae78888f61ad9396b3c48ea38caa0254d7e4d80637e72334c7124a
7
+ data.tar.gz: 501d4a8444084f68b789cfb5743fabf86b1dfe0d42c9cb4e9c106f40994c8da973181528f95b51fd18d1d112dc5faea6db00a9ed5b7ff70ba6dec87d81cb7211
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hubcap (1.1.0)
4
+ hubcap (1.2.1)
5
5
  capistrano (~> 2.13)
6
6
 
7
7
  GEM
data/lib/hubcap/group.rb CHANGED
@@ -20,6 +20,7 @@ class Hubcap::Group
20
20
  @cap_roles = []
21
21
  @puppet_roles = {}
22
22
  @params = {}
23
+ @extra_attributes = {}
23
24
  @hosts = {}
24
25
  @children = []
25
26
  instance_eval(&blk) if blk && processable?
@@ -203,6 +204,20 @@ class Hubcap::Group
203
204
  update_with_stringified_keys(@params, hash)
204
205
  end
205
206
 
207
+ # Adds extra (inheritable) attributes to the referencing scope
208
+ # These attributes are not used by hubcap or puppet, but can be used by
209
+ # by other tools using hubcap to parse the configuration tree.
210
+ #
211
+ # extra({'some_key' => 'some_value'})
212
+ #
213
+ def extra(hash)
214
+ hash.each_key { |k|
215
+ unless k.kind_of?(String) || k.kind_of?(Symbol)
216
+ raise(Hubcap::InvalidParamKeyType, k.inspect)
217
+ end
218
+ }
219
+ update_with_stringified_keys(@extra_attributes, hash)
220
+ end
206
221
 
207
222
  # Defines hostnames that point to IP addresses. Eg,
208
223
  #
@@ -249,6 +264,9 @@ class Hubcap::Group
249
264
  @parent ? @parent.hosts.merge(@hosts) : @hosts
250
265
  end
251
266
 
267
+ def extras
268
+ @parent ? @parent.extras.merge(@extra_attributes) : @extra_attributes
269
+ end
252
270
 
253
271
  # Takes a name and returns an IP address. It looks at the @hosts table first,
254
272
  # then falls back to a normal DNS look-up.
@@ -1,5 +1,5 @@
1
1
  module Hubcap
2
2
 
3
- VERSION = '1.1.0'
3
+ VERSION = '1.2.1'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubcap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Pearson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-28 00:00:00.000000000 Z
11
+ date: 2014-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano