csv2hash 0.6.5 → 0.6.6
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/CHANGELOG.md +25 -0
- data/Gemfile.lock +1 -1
- data/README.md +15 -0
- data/UPGRADE.md +4 -0
- data/lib/csv2hash/version.rb +1 -1
- data/lib/csv2hash/yaml_loader.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18bc8763e096c34ff6118e37ef9fd2247762e91d
|
4
|
+
data.tar.gz: 50318a57def57128858b83ccf06ec75a1d62c106
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eac65e74ebc8aea9a5ab683ef76c50eff563eec50cd7d07e37d8f9136d10c439f2f242a3d8c44bb1acaf1e42d9461d00851d4123601a514f251e4c4fd0292ea8
|
7
|
+
data.tar.gz: e260dd7c94939ebc9acd6e311abb6140afbc3206807f7d4d7272d1feebb48077e77d81cb7654bab52edc859a01d0683133ad32ff6a2af12a55def72478475772
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
### VERSION 0.6.6
|
2
|
+
|
3
|
+
* refactoring
|
4
|
+
* little trick on YamlLoader
|
5
|
+
|
6
|
+
* [fullchanges](https://github.com/FinalCAD/csv2hash/pull/17)
|
7
|
+
|
1
8
|
### VERSION 0.6.5
|
2
9
|
|
3
10
|
* enhancements
|
@@ -9,11 +16,15 @@
|
|
9
16
|
* feature
|
10
17
|
* Add generator for configure csv2hash on Rails app
|
11
18
|
|
19
|
+
* [fullchanges](https://github.com/FinalCAD/csv2hash/pull/16)
|
20
|
+
|
12
21
|
### VERSION 0.6.4
|
13
22
|
|
14
23
|
* feature
|
15
24
|
* make configuration file can be writing with ERB interpolation.
|
16
25
|
|
26
|
+
* [fullchanges](https://github.com/FinalCAD/csv2hash/pull/15)
|
27
|
+
|
17
28
|
### VERSION 0.6.3
|
18
29
|
|
19
30
|
* refactoring
|
@@ -22,16 +33,22 @@
|
|
22
33
|
* feature
|
23
34
|
* add yml loader
|
24
35
|
|
36
|
+
* [fullchanges](https://github.com/FinalCAD/csv2hash/pull/14)
|
37
|
+
|
25
38
|
### VERSION 0.6.2
|
26
39
|
|
27
40
|
* feature
|
28
41
|
* Auto discover, you can add floating position on mapping rules
|
29
42
|
|
43
|
+
* [fullchanges](https://github.com/FinalCAD/csv2hash/pull/12)
|
44
|
+
|
30
45
|
### VERSION 0.6.1
|
31
46
|
|
32
47
|
* deprecations
|
33
48
|
* Structure validation rules, MinColumn, MaxColumn are replaced by :min_columns, :max_columns
|
34
49
|
|
50
|
+
* [fullchanges](https://github.com/FinalCAD/csv2hash/pull/11)
|
51
|
+
|
35
52
|
### VERSION 0.6.0
|
36
53
|
|
37
54
|
* backwards incompatible changes
|
@@ -40,6 +57,8 @@
|
|
40
57
|
* refactoring
|
41
58
|
* replace arguments for rules by DSL of cells
|
42
59
|
|
60
|
+
* [fullchanges](https://github.com/FinalCAD/csv2hash/pull/10)
|
61
|
+
|
43
62
|
### VERSION 0.5.0
|
44
63
|
|
45
64
|
* backwards incompatible changes
|
@@ -48,6 +67,8 @@
|
|
48
67
|
* refactoring
|
49
68
|
* remove params ``` ignore_blank_line ``` to benefit of options of Hash
|
50
69
|
|
70
|
+
* [fullchanges](https://github.com/FinalCAD/csv2hash/pull/9)
|
71
|
+
|
51
72
|
### VERSION 0.4.0
|
52
73
|
|
53
74
|
* backwards incompatible changes
|
@@ -56,6 +77,8 @@
|
|
56
77
|
* refactoring
|
57
78
|
* remove params ``` break_on_failure ``` to benefit of ``` Csv2hash::Main#parse! ``` of ``` Csv2hash::Main#parse ```
|
58
79
|
|
80
|
+
* [fullchanges](https://github.com/FinalCAD/csv2hash/pull/8)
|
81
|
+
|
59
82
|
### VERSION 0.3.0
|
60
83
|
|
61
84
|
* backwards incompatible changes
|
@@ -65,6 +88,8 @@
|
|
65
88
|
* refactoring
|
66
89
|
* Use adapter to select source of data, either file.csv or Array of data, is more transparently, not impact signature of Csv2Hash constructor
|
67
90
|
|
91
|
+
* [fullchanges](https://github.com/FinalCAD/csv2hash/pull/7)
|
92
|
+
|
68
93
|
### VERSION 0.2.1
|
69
94
|
|
70
95
|
* bug fix
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -470,6 +470,21 @@ this change is due to Yaml conversion
|
|
470
470
|
|
471
471
|
You can write ERB file, should be named with following convention ```<file name>.erb.yml```
|
472
472
|
|
473
|
+
## YamlLoader
|
474
|
+
|
475
|
+
You can load your definition with YamlLoader llike that :
|
476
|
+
|
477
|
+
```
|
478
|
+
loader = Csv2hash::YamlLoader.load!('config/rules.erb.yml')
|
479
|
+
loader.definition
|
480
|
+
```
|
481
|
+
or
|
482
|
+
```
|
483
|
+
loader = Csv2hash::YamlLoader.new('config/rules.erb.yml')
|
484
|
+
loader.load!
|
485
|
+
loader.definition
|
486
|
+
```
|
487
|
+
|
473
488
|
# Type conversion
|
474
489
|
|
475
490
|
By default Csv2hash doesn't convert basic value, but you can activate this on configuration, for Rails use :
|
data/UPGRADE.md
CHANGED
data/lib/csv2hash/version.rb
CHANGED
data/lib/csv2hash/yaml_loader.rb
CHANGED
@@ -12,6 +12,10 @@ module Csv2hash
|
|
12
12
|
self.conf.deep_symbolize_keys!
|
13
13
|
end
|
14
14
|
|
15
|
+
def self.load! file
|
16
|
+
new(file).tap &:load!
|
17
|
+
end
|
18
|
+
|
15
19
|
def load!
|
16
20
|
mapping = self.conf.fetch(:mapping)
|
17
21
|
header_size = self.conf.fetch(:header_size).to_i
|
@@ -28,6 +32,7 @@ module Csv2hash
|
|
28
32
|
end
|
29
33
|
|
30
34
|
Main[self.conf.fetch(:name)] = self.definition
|
35
|
+
nil
|
31
36
|
end
|
32
37
|
|
33
38
|
private
|