bukelatta 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bukelatta/dsl/context.rb +28 -0
- data/lib/bukelatta/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fb8bcac53c63acb5f5491d39b28c1d93ee10eea
|
4
|
+
data.tar.gz: '091d4d01503edddbe8e08f614ab9da2ceec072cd'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 708cd0f32a905314076fe5480b4d2fb6d34890e8f60c6614758d0a1248731b4cae49486ab4921504857ac07465fa4625c52e2953b01967d3ce162b3ad8458c9a
|
7
|
+
data.tar.gz: 50b3b219fb39501e2df9850cd6f79283f7026ab8088f3bfbafd948a4f96a7b85e37abbf03f5944cb9df7694f2b747cd068a4940ca33bbf990329a1542f5e86d1
|
@@ -8,6 +8,7 @@ class Bukelatta::DSL::Context
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def result
|
11
|
+
expand_leaf_array!
|
11
12
|
@result.sort_array!
|
12
13
|
end
|
13
14
|
|
@@ -52,4 +53,31 @@ class Bukelatta::DSL::Context
|
|
52
53
|
|
53
54
|
@result[name] = yield
|
54
55
|
end
|
56
|
+
|
57
|
+
def expand_leaf_array!
|
58
|
+
@result = expand_leaf_array(@result)
|
59
|
+
end
|
60
|
+
|
61
|
+
def expand_leaf_array(obj)
|
62
|
+
case obj
|
63
|
+
when Array
|
64
|
+
if obj[0].instance_of?(Array) || obj[0].instance_of?(Hash)
|
65
|
+
return obj.map do |o|
|
66
|
+
expand_leaf_array(o)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
# Leaf
|
70
|
+
if obj.length == 1
|
71
|
+
return obj[0]
|
72
|
+
end
|
73
|
+
return obj
|
74
|
+
when Hash
|
75
|
+
h = {}
|
76
|
+
obj.each do |k, v|
|
77
|
+
h[k] = expand_leaf_array(v)
|
78
|
+
end
|
79
|
+
return h
|
80
|
+
end
|
81
|
+
return obj
|
82
|
+
end
|
55
83
|
end
|
data/lib/bukelatta/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bukelatta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- winebarrel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
191
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.
|
192
|
+
rubygems_version: 2.6.11
|
193
193
|
signing_key:
|
194
194
|
specification_version: 4
|
195
195
|
summary: Bukelatta is a tool to manage S3 Bucket Policy.
|