see_as_vee 0.4.0 → 0.4.1
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/README.md +21 -0
- data/lib/see_as_vee/sheet.rb +1 -1
- data/lib/see_as_vee/version.rb +1 -1
- 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: a1a3e9167cd2bbc44f922211ec9f84e497e36af3
|
4
|
+
data.tar.gz: 4e3ce3851f020cf58bae679f8a450ecb82f0d09c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f10b6a4be483ff2bf32154d9825107726e58ef314553c05033358d9fc7b7e82b7517b1fb3fb0d4544ba81ccfad13e3d2d51ee213ba8fcb775ed4b4f056e41489
|
7
|
+
data.tar.gz: 1a3c16e57076716078e8ea36e3b995ab30f6b7de34c9364dead6f4144b3717e2241f0f4dd87194778d61ecc5d37738196d802c59f8bdcba6487609b9d0c31bc1
|
data/README.md
CHANGED
@@ -53,6 +53,23 @@ Or install it yourself as:
|
|
53
53
|
expect(xlsx.length > 0).to eq true
|
54
54
|
```
|
55
55
|
|
56
|
+
### `Dry::Validation`
|
57
|
+
|
58
|
+
From the version `0.4.0` we support dry validation of the data given:
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
schema = Dry::Validation.Form do
|
62
|
+
required(:reference) { filled? > str? }
|
63
|
+
required(:trade_date).filled(:date?)
|
64
|
+
required(:notional).filled(:float?)
|
65
|
+
required(:notional_currency).filled(:str?)
|
66
|
+
end
|
67
|
+
validation = SeeAsVee.validate('spec/fixtures/velo.csv', schema)
|
68
|
+
expect(validation.all? { |vr| vr.errors.empty? }).to be true
|
69
|
+
```
|
70
|
+
|
71
|
+
The returned value is an array of [validation results](http://dry-rb.org/gems/dry-validation/basics/).
|
72
|
+
|
56
73
|
### Produce
|
57
74
|
|
58
75
|
```ruby
|
@@ -71,6 +88,10 @@ Or install it yourself as:
|
|
71
88
|
|
72
89
|
## Changelog
|
73
90
|
|
91
|
+
### `0.4.0` support for `Dry::Validation`
|
92
|
+
|
93
|
+
### `0.3.0` support for XLSX options
|
94
|
+
|
74
95
|
### `0.2.5` support for CSV options
|
75
96
|
|
76
97
|
## Development
|
data/lib/see_as_vee/sheet.rb
CHANGED
@@ -80,7 +80,7 @@ module SeeAsVee
|
|
80
80
|
p.workbook.add_worksheet(**axlsx_params) do |sheet|
|
81
81
|
@rows.each do |row|
|
82
82
|
styles = row.map { |cell| malformed?(cell) ? red : nil }
|
83
|
-
row = row.map { |cell| cell.to_s.gsub(/\A#{
|
83
|
+
row = row.map { |cell| cell.to_s.gsub(/\A#{CELL_ERROR_MARKER}/, '') if malformed?(cell) } if params[:lem]
|
84
84
|
sheet.add_row row, style: styles
|
85
85
|
end
|
86
86
|
end
|
data/lib/see_as_vee/version.rb
CHANGED