cloudformation-ruby-dsl 1.0.5 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cloudformation-ruby-dsl/table.rb +7 -2
- data/lib/cloudformation-ruby-dsl/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: 4d86a3e1c9ae992f10540eb8bc343c788a111089
|
4
|
+
data.tar.gz: 388ea8ad0dd651ff9889e3dbe068ecec4ae4a4a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8f8a87b3e8af88daaf3752f95047c6e1aa124ba49c994c7d918b185960c323cdaf796d950b0ac50c5eff43774cfba4818cd2697f0a0ca0f28492ac6c157c818
|
7
|
+
data.tar.gz: 42ad392c8638195e397e6ea59529aac1cec3bc97fdcfd4d14eb22d232a787921e831f3eb9647841c6a8fbcef4954d8bec15cb3f6ebf8cc74b66eccadbfb88f15
|
@@ -21,8 +21,8 @@ class Table
|
|
21
21
|
|
22
22
|
def initialize(table_as_text)
|
23
23
|
raw_header, *raw_data = Detabulator.new.detabulate table_as_text
|
24
|
-
header = raw_header.map(&:to_sym)
|
25
|
-
@records = raw_data.map { |row| Hash[header.zip(row)] }
|
24
|
+
@header = raw_header.map(&:to_sym)
|
25
|
+
@records = raw_data.map { |row| Hash[@header.zip(row)] }
|
26
26
|
end
|
27
27
|
|
28
28
|
# Selects all rows in the table which match the name/value pairs of the predicate object and returns
|
@@ -31,6 +31,11 @@ class Table
|
|
31
31
|
distinct_values(filter(predicate), key, false)
|
32
32
|
end
|
33
33
|
|
34
|
+
# Select the headers as list. Argument(s) will be excluded from output.
|
35
|
+
def get_header(*exclude)
|
36
|
+
@header.reject{ |key| key if exclude.include?(key) }
|
37
|
+
end
|
38
|
+
|
34
39
|
# Selects all rows in the table which match the name/value pairs of the predicate object and returns
|
35
40
|
# all distinct values from those rows for the specified key.
|
36
41
|
def get_list(key, predicate)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudformation-ruby-dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shawn Smith
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date:
|
18
|
+
date: 2016-01-20 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: detabulator
|