conformist 0.2.2 → 0.2.3

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: b1b48d245c32ad7e4f2b993cc977e0dd38bfc066
4
- data.tar.gz: c824e40ab3f56707b44f06305cff2b34eadc782d
3
+ metadata.gz: 8fe51dfa6a9ee750fa491c34c8348aad61de12c4
4
+ data.tar.gz: b4cfe4f2d38a8087c50a7af1cfece66fd24f5cbc
5
5
  SHA512:
6
- metadata.gz: 9f17dcb25ae26bf0b53630b936a9a0c507e5958d885a34904887feba98dc09d3182f1ab4bd6425319ff7f8310486f92ea5a38a0fa627e8db36c3317cebac3df5
7
- data.tar.gz: 90e0ff595928908556a76558d12c788abe3f8c463a109cf67e3f8bfb2edb4fbe754da9081a8353a8949f06326862a076604813b88353c04b2102a0cfea13fa3f
6
+ metadata.gz: 556539d85a56a282b67e302e39ec24f019ab7dd1c984da14231e6a670f7244bfda044cbb3e2487d938114cd64d02de7cc5f6ab3d14b4060900f2ffa318d3871a
7
+ data.tar.gz: 87bafbf9bc6df970a5d5e9c46aec70173a4198e6e2e660de1def9a5924a9d51327d6303ee7bd158d53f4de093022c587edc2c66dd592d5be8a77c827f572d1ed
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.2.3 / 2015-03-04
4
+
5
+ * Always return nil when named column isn't found. (@rywall)
6
+
3
7
  ## 0.2.2 / 2015-02-12
4
8
 
5
9
  * Don't munge headers. (@rywall)
@@ -18,11 +18,15 @@ module Conformist
18
18
  else
19
19
  source
20
20
  end
21
- end.compact
21
+ end
22
22
  end
23
23
 
24
24
  def values_in enumerable
25
- values = Array(enumerable).values_at(*indexes).map do |value|
25
+ enumerable = Array(enumerable)
26
+
27
+ values = Array(indexes).map do |index|
28
+ value = enumerable.at(index) if index
29
+
26
30
  if value.respond_to? :strip
27
31
  value.strip
28
32
  else
@@ -1,3 +1,3 @@
1
1
  module Conformist
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
@@ -100,4 +100,13 @@ class IntegrationTest < Minitest::Test
100
100
  first = enumerable.to_a.first
101
101
  assert_equal HashStruct.new(:name => 'Aaron', :age => '21', :gender => 'Male'), first
102
102
  end
103
+
104
+ def test_missing_named_column
105
+ schema = Conformist.new do
106
+ column :state, 'State'
107
+ end
108
+ enumerable = schema.conform open_csv('citizens.csv'), :skip_first => true
109
+ first = enumerable.to_a.first
110
+ assert_equal HashStruct.new(:state => nil), first
111
+ end
103
112
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conformist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tate Johnson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-12 00:00:00.000000000 Z
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest