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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99f3a404577b576209fe2a83f92b4049a2c25afd
4
- data.tar.gz: 9e5f806014c4fcbd40e03dd9eb80a69fb99fa41b
3
+ metadata.gz: 4d86a3e1c9ae992f10540eb8bc343c788a111089
4
+ data.tar.gz: 388ea8ad0dd651ff9889e3dbe068ecec4ae4a4a4
5
5
  SHA512:
6
- metadata.gz: fd36efe1f07eb08b84c8cc2d96c846dffb1b8188ee5eebd367fd3d4288b833443909fdfa1182919238412eaf543701cd0b120fa82c160d32eac49ea441a5d3f7
7
- data.tar.gz: 32eb81ebf63a1927b1cce3d63cbf3a0e27e00e82201cdc5b922af3f84045094d2473418f08990b305b2a50eb8537cd35d46cecc1a0fd4e369958473c719fe513
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)
@@ -15,7 +15,7 @@
15
15
  module Cfn
16
16
  module Ruby
17
17
  module Dsl
18
- VERSION = "1.0.5"
18
+ VERSION = "1.1.0"
19
19
  end
20
20
  end
21
21
  end
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.5
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: 2015-12-03 00:00:00.000000000 Z
18
+ date: 2016-01-20 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: detabulator