humidifier 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/humidifier/resource.rb +8 -0
- data/lib/humidifier/stack.rb +4 -2
- data/lib/humidifier/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49e71afc90f25c69c4186ef0d296bb6a4709c8c4
|
4
|
+
data.tar.gz: 249d24a729f0d5c92dee6987eefc974c6ff947c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b483ce9400693c726c93a8a50aa703fc446d2dc20d7efa8c7dd03a3ad1e10f13ccc1a030679103ef0c05fd701b423a7d592b1d37dec0d0f18f41e4c1cc52160b
|
7
|
+
data.tar.gz: 244bf6664b9b54a2ecf69d72a19df94d10c65e464fc0912f12773d7729e9417816eabe25b6b38bbcb53274c093a66088eb1adaaeed927f70b36ff5ef53dcb274
|
data/lib/humidifier/resource.rb
CHANGED
@@ -44,6 +44,14 @@ module Humidifier
|
|
44
44
|
properties.each { |property, value| update_property(property, value, raw) }
|
45
45
|
end
|
46
46
|
|
47
|
+
# Update the attributes of the resource defined by COMMON_ATTRIBUTES
|
48
|
+
def update_attributes(attributes)
|
49
|
+
attributes.each do |attribute, value|
|
50
|
+
raise ArgumentError, "Invalid attribute: #{attribute}" unless COMMON_ATTRIBUTES.value?(attribute)
|
51
|
+
public_send(:"#{attribute}=", value)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
47
55
|
# Update an individual property on this resource
|
48
56
|
def update_property(property, value, raw = false)
|
49
57
|
property = property.to_s
|
data/lib/humidifier/stack.rb
CHANGED
@@ -19,9 +19,11 @@ module Humidifier
|
|
19
19
|
STATIC_RESOURCES.values.each { |prop| send(:"#{prop}=", opts[prop]) }
|
20
20
|
end
|
21
21
|
|
22
|
-
# Add a resource to the stack
|
23
|
-
def add(name, resource)
|
22
|
+
# Add a resource to the stack and optionally set its attributes
|
23
|
+
def add(name, resource, attributes = {})
|
24
24
|
resources[name] = resource
|
25
|
+
resource.update_attributes(attributes) if attributes.any?
|
26
|
+
resource
|
25
27
|
end
|
26
28
|
|
27
29
|
# The identifier used by the shim to find the stack in CFN, prefers id to name
|
data/lib/humidifier/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: humidifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Localytics
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|