kumogata 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/kumogata/ext/string_ext.rb +54 -5
- data/lib/kumogata/version.rb +1 -1
- data/spec/kumogata_convert_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9282e45b98b32e3c888ddfff061da0bc320528c0
|
4
|
+
data.tar.gz: 280684e5055d626dfb1215a6f53eae8c386b5c61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8787902eada204842507d2e54a9d6cd1e740e12416cf335684970a602040460bef6a3c4ba87478b58db0c141be5b17cc78b5938ba3fad01aea032bb40b1281ac
|
7
|
+
data.tar.gz: 561ce9fcc167842fc85a5aaa42ac3a11a7142b4cf0cf49b08b1f6386a34293dfa545455b3add759b72caa00003da303b3e882f159840e875f8168adcbb5cfbf4
|
data/README.md
CHANGED
@@ -5,8 +5,8 @@
|
|
5
5
|
|
6
6
|
Kumogata is a tool for [AWS CloudFormation](https://aws.amazon.com/cloudformation/).
|
7
7
|
|
8
|
-
[![Gem Version](https://badge.fury.io/rb/kumogata.png?
|
9
|
-
[![Build Status](https://drone.io/github.com/winebarrel/kumogata/status.png?
|
8
|
+
[![Gem Version](https://badge.fury.io/rb/kumogata.png?201403050245)](http://badge.fury.io/rb/kumogata)
|
9
|
+
[![Build Status](https://drone.io/github.com/winebarrel/kumogata/status.png?201403050245)](https://drone.io/github.com/winebarrel/kumogata/latest)
|
10
10
|
|
11
11
|
It can define a template in Ruby DSL, such as:
|
12
12
|
|
@@ -58,32 +58,81 @@ class String
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def Fn__Base64(value)
|
61
|
-
|
61
|
+
value = {'Fn::Base64' => @__value_conv__[value]}
|
62
|
+
|
63
|
+
case @__functions__
|
64
|
+
when Array
|
65
|
+
@__functions__ << value
|
66
|
+
when Hash
|
67
|
+
@__functions__.update(value)
|
68
|
+
end
|
69
|
+
|
62
70
|
#{null.inspect}
|
63
71
|
end
|
64
72
|
|
65
73
|
def Fn__FindInMap(map_name, top_level_key, second_level_key)
|
66
|
-
|
74
|
+
value = {'Fn::FindInMap' => [
|
67
75
|
map_name, top_level_key, second_level_key].map(&@__value_conv__)}
|
76
|
+
|
77
|
+
case @__functions__
|
78
|
+
when Array
|
79
|
+
@__functions__ << value
|
80
|
+
when Hash
|
81
|
+
@__functions__.update(value)
|
82
|
+
end
|
83
|
+
|
68
84
|
#{null.inspect}
|
69
85
|
end
|
70
86
|
|
71
87
|
def Fn__GetAtt(logical_name, attr_name)
|
72
|
-
|
88
|
+
value = {'Fn::GetAtt' => [
|
73
89
|
logical_name, attr_name].map(&@__value_conv__)}
|
90
|
+
|
91
|
+
case @__functions__
|
92
|
+
when Array
|
93
|
+
@__functions__ << value
|
94
|
+
when Hash
|
95
|
+
@__functions__.update(value)
|
96
|
+
end
|
97
|
+
|
74
98
|
#{null.inspect}
|
75
99
|
end
|
76
100
|
|
77
101
|
def Fn__GetAZs(region)
|
78
|
-
|
102
|
+
value = {'Fn::GetAZs' => @__value_conv__[region]}
|
103
|
+
|
104
|
+
case @__functions__
|
105
|
+
when Array
|
106
|
+
@__functions__ << value
|
107
|
+
when Hash
|
108
|
+
@__functions__.update(value)
|
109
|
+
end
|
110
|
+
|
79
111
|
#{null.inspect}
|
80
112
|
end
|
81
113
|
|
82
114
|
def Ref(value)
|
83
|
-
|
115
|
+
value = {'Ref' => value}
|
116
|
+
|
117
|
+
case @__functions__
|
118
|
+
when Array
|
119
|
+
@__functions__ << value
|
120
|
+
when Hash
|
121
|
+
@__functions__.update(value)
|
122
|
+
end
|
123
|
+
|
84
124
|
#{null.inspect}
|
85
125
|
end
|
86
126
|
|
127
|
+
def _(&block)
|
128
|
+
__functions__orig = @__functions__
|
129
|
+
@__functions__ = {}
|
130
|
+
block.call if block
|
131
|
+
value = @__functions__
|
132
|
+
@__functions__ = __functions__orig
|
133
|
+
return value
|
134
|
+
end
|
135
|
+
|
87
136
|
ERB.new(#{data.inspect}, nil, #{trim_mode.inspect}).result(binding).split(#{null.inspect}).zip(@__functions__)
|
88
137
|
EOS
|
89
138
|
|
data/lib/kumogata/version.rb
CHANGED