conformist 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/conformist/column.rb +6 -2
- data/lib/conformist/version.rb +1 -1
- data/test/unit/integration_test.rb +9 -0
- 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: 8fe51dfa6a9ee750fa491c34c8348aad61de12c4
|
4
|
+
data.tar.gz: b4cfe4f2d38a8087c50a7af1cfece66fd24f5cbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 556539d85a56a282b67e302e39ec24f019ab7dd1c984da14231e6a670f7244bfda044cbb3e2487d938114cd64d02de7cc5f6ab3d14b4060900f2ffa318d3871a
|
7
|
+
data.tar.gz: 87bafbf9bc6df970a5d5e9c46aec70173a4198e6e2e660de1def9a5924a9d51327d6303ee7bd158d53f4de093022c587edc2c66dd592d5be8a77c827f572d1ed
|
data/CHANGELOG.md
CHANGED
data/lib/conformist/column.rb
CHANGED
@@ -18,11 +18,15 @@ module Conformist
|
|
18
18
|
else
|
19
19
|
source
|
20
20
|
end
|
21
|
-
end
|
21
|
+
end
|
22
22
|
end
|
23
23
|
|
24
24
|
def values_in enumerable
|
25
|
-
|
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
|
data/lib/conformist/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2015-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|