csv2hash 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -2
- data/UPGRADE.md +4 -0
- data/lib/csv2hash/coercers/yaml_coercer.rb +2 -0
- data/lib/csv2hash/version.rb +1 -1
- data/lib/csv2hash/yaml_loader.rb +0 -1
- data/spec/csv2hash/yaml_coercer_spec.rb +27 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78efc416ea706262ed45cd1732953a91ab59c3ac
|
4
|
+
data.tar.gz: 045440b7c850178eedeb7e0d54c8797a374a7aea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9db537dbfddb6ef012bd23acdfb2faedb15c20b4471cb66457d0156d15773991a828c875f5d17f0232fe79e178b009e9eba7f48f879dd8497a6881a0c3c8d507
|
7
|
+
data.tar.gz: 33a571b8d8e0217abf628c73c83c6b6264705d0407b5bd0d217410c836a711f330af66f256321141ef6a5007355e4263fdf139d7c42b13b8a37107464eacf36f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
### VERSION 0.7.1
|
2
|
+
|
3
|
+
* enhancements
|
4
|
+
* update yaml coercer to deserialize string position to regex
|
5
|
+
|
6
|
+
* [fullchanges](https://github.com/FinalCAD/csv2hash/pull/21)
|
7
|
+
|
8
|
+
* [Author Ale Paredes](https://github.com/ale7714)
|
9
|
+
|
1
10
|
### VERSION 0.7.0
|
2
11
|
|
3
12
|
* feature
|
@@ -5,6 +14,8 @@
|
|
5
14
|
|
6
15
|
* [fullchanges](https://github.com/FinalCAD/csv2hash/pull/20)
|
7
16
|
|
17
|
+
* [Author Ale Paredes](https://github.com/ale7714)
|
18
|
+
|
8
19
|
### VERSION 0.6.8
|
9
20
|
|
10
21
|
* bug fix
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -243,7 +243,6 @@ became
|
|
243
243
|
cell position: [[0, /Employment/],1], key: 'employment'
|
244
244
|
```
|
245
245
|
|
246
|
-
|
247
246
|
### [COLLECTION] Validation of a collection (Regular CSV)
|
248
247
|
|
249
248
|
Consider the following CSV:
|
@@ -304,7 +303,7 @@ This is a special feature for finding a specific column index on header. For exa
|
|
304
303
|
| | |
|
305
304
|
```
|
306
305
|
|
307
|
-
You want to extract `Name` and
|
306
|
+
You want to extract `Name` and `Age` for all rows but you want the order of the columns to be able to change.
|
308
307
|
You change the position to the regex of column index you are looking for. So this how the position
|
309
308
|
|
310
309
|
```
|
data/UPGRADE.md
CHANGED
data/lib/csv2hash/version.rb
CHANGED
data/lib/csv2hash/yaml_loader.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Csv2hash
|
4
|
+
module Coercers
|
5
|
+
describe YamlCoercer do
|
6
|
+
context 'when position is a string' do
|
7
|
+
let(:rules) { {:position=>"Mobile phone number", :key=>"mobile_phone", :allow_blank=>true} }
|
8
|
+
let(:result_rules) { {:position=>/\A(Mobile phone number)\z/, :key=>"mobile_phone", :allow_blank=>true} }
|
9
|
+
subject { YamlCoercer.new(rules) }
|
10
|
+
|
11
|
+
before { subject.deserialize! }
|
12
|
+
|
13
|
+
it{expect(subject.rules).to eql(result_rules)}
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'when position is a array' do
|
17
|
+
let(:rules) { {:position=>[[1,"Mobile phone number"],2], :key=>"mobile_phone", :allow_blank=>true} }
|
18
|
+
let(:result_rules) { {:position=>[[1, /Mobile phone number/], 2], :key=>"mobile_phone", :allow_blank=>true} }
|
19
|
+
subject { YamlCoercer.new(rules) }
|
20
|
+
|
21
|
+
before { subject.deserialize! }
|
22
|
+
|
23
|
+
it{expect(subject.rules).to eql(result_rules)}
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csv2hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel AZEMAR
|
@@ -155,6 +155,7 @@ files:
|
|
155
155
|
- spec/csv2hash/validator/collection_spec.rb
|
156
156
|
- spec/csv2hash/validator/mapping_spec.rb
|
157
157
|
- spec/csv2hash/validator_spec.rb
|
158
|
+
- spec/csv2hash/yaml_coercer_spec.rb
|
158
159
|
- spec/csv2hash/yaml_loader_spec.rb
|
159
160
|
- spec/csv2hash_spec.rb
|
160
161
|
- spec/generators_helper.rb
|
@@ -196,6 +197,7 @@ test_files:
|
|
196
197
|
- spec/csv2hash/validator/collection_spec.rb
|
197
198
|
- spec/csv2hash/validator/mapping_spec.rb
|
198
199
|
- spec/csv2hash/validator_spec.rb
|
200
|
+
- spec/csv2hash/yaml_coercer_spec.rb
|
199
201
|
- spec/csv2hash/yaml_loader_spec.rb
|
200
202
|
- spec/csv2hash_spec.rb
|
201
203
|
- spec/generators_helper.rb
|