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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b50de0c0c67f10bc5082ca6067ff3eff797513c1
4
- data.tar.gz: c70c29abe958f30b1e82efd15ccd5b6243567b23
3
+ metadata.gz: 9fb8bcac53c63acb5f5491d39b28c1d93ee10eea
4
+ data.tar.gz: '091d4d01503edddbe8e08f614ab9da2ceec072cd'
5
5
  SHA512:
6
- metadata.gz: c6a47769bdd9834b842c52e597138dcfabfe35bc1cbbb77cfc32f745fff0d82e166aef5bb5971bc4d1a8d0d22c0e75e023eff2b5dc5932bc5e2c6578f0f2646f
7
- data.tar.gz: e0b64fa05ad223e5178960a943f5da930b6e46bb8dfba7e7f7c72d55408c1cf88eb6047257acf4d77c77dcc4bb0654190a65e319d094ac8e58c14b49d30d4cc8
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
@@ -1,3 +1,3 @@
1
1
  module Bukelatta
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
3
3
  end
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.7
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: 2016-09-08 00:00:00.000000000 Z
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.4.5.1
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.