estratto 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/.rspec +0 -0
- data/.travis.yml +0 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +0 -0
- data/Gemfile.lock +1 -1
- data/LICENSE.txt +0 -0
- data/README.md +28 -4
- data/Rakefile +0 -0
- data/estratto.gemspec +0 -0
- data/lib/estratto.rb +0 -0
- data/lib/estratto/content.rb +0 -0
- data/lib/estratto/data/base.rb +0 -0
- data/lib/estratto/data/coercer.rb +1 -1
- data/lib/estratto/data/date.rb +0 -0
- data/lib/estratto/data/datetime.rb +0 -0
- data/lib/estratto/data/float.rb +0 -0
- data/lib/estratto/data/integer.rb +0 -0
- data/lib/estratto/data/string.rb +0 -0
- data/lib/estratto/document.rb +0 -0
- data/lib/estratto/encoder.rb +0 -0
- data/lib/estratto/helpers/range.rb +0 -0
- data/lib/estratto/layout/base.rb +0 -0
- data/lib/estratto/layout/factory.rb +0 -0
- data/lib/estratto/layout/multi_register.rb +0 -0
- data/lib/estratto/layout/reader.rb +0 -0
- data/lib/estratto/parser.rb +0 -0
- data/lib/estratto/register.rb +0 -0
- data/lib/estratto/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3a8144b72518c01e8f3c6987d3900abdc2e6b1da2e0c1283c28d0b21b69a5e0
|
4
|
+
data.tar.gz: 53a123b710d3c3abf8b2c8aca8a004870ca391fa0cb816c357f8731a6f7dd002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80d9ac6b08b2c6c8953fd343926d8930a6201df97b3e3db66c8dc8cd3abf3922979e9af8e472a2110f4f7fecfbc4520fa3fc34c9410fbd877ad714b9877cd3ed
|
7
|
+
data.tar.gz: 2f7c4bb5a4db412b65bab74be6785dad412ac9b193c4d8add3f3570a85da681612f115c496c677fa135434a14cade247d351d3a1eb0cb04fc5db82ff8d61aad3
|
data/.gitignore
CHANGED
File without changes
|
data/.rspec
CHANGED
File without changes
|
data/.travis.yml
CHANGED
File without changes
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
File without changes
|
data/Gemfile.lock
CHANGED
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
@@ -169,7 +169,7 @@ Output example:
|
|
169
169
|
#raw_data
|
170
170
|
'Hierophant Green '
|
171
171
|
# with strip clause
|
172
|
-
'Hierophant Green'
|
172
|
+
'Hierophant Green'
|
173
173
|
```
|
174
174
|
|
175
175
|
#### Integer
|
@@ -182,15 +182,15 @@ Actually we don't have any formats for Integer. :)
|
|
182
182
|
#raw_data
|
183
183
|
'000123'
|
184
184
|
# coerced
|
185
|
-
123
|
185
|
+
123
|
186
186
|
#raw_data
|
187
187
|
'123'
|
188
188
|
# coerced
|
189
|
-
123
|
189
|
+
123
|
190
190
|
#raw_data
|
191
191
|
'a'
|
192
192
|
# coerced
|
193
|
-
0
|
193
|
+
0
|
194
194
|
```
|
195
195
|
|
196
196
|
#### Float
|
@@ -282,6 +282,30 @@ format: '%d/%m/%Y'
|
|
282
282
|
#<DateTime: 2018-01-01T00:00:00+00:00 ...>
|
283
283
|
```
|
284
284
|
|
285
|
+
## General Formats Properties
|
286
|
+
|
287
|
+
Sometimes we need to deal with some general patterns on third-party files. Like lacks of informations, or some unexpected exported data pattern.
|
288
|
+
|
289
|
+
#### Allow Empty
|
290
|
+
|
291
|
+
The `allow_empty` property was designed to deal with randomic unexpected data exported from third-party. Like `DateTime` field that has `%Y%m%d` format, but in third-party file, some lines cames with ` `, or `00000000`.
|
292
|
+
|
293
|
+
The common return when `allow_empty` was marked on field, is `nil`.
|
294
|
+
|
295
|
+
_Tip: `allow_empty` could be ommitted when you not need a data saving_
|
296
|
+
|
297
|
+
##### Example
|
298
|
+
|
299
|
+
```yaml
|
300
|
+
fields:
|
301
|
+
- name: birthdate
|
302
|
+
range: 2..10
|
303
|
+
type: DateTime
|
304
|
+
formats:
|
305
|
+
allow_empty: true
|
306
|
+
format: '%d/%m/%Y'
|
307
|
+
```
|
308
|
+
|
285
309
|
## Tests
|
286
310
|
|
287
311
|
Simple `rake spec`
|
data/Rakefile
CHANGED
File without changes
|
data/estratto.gemspec
CHANGED
File without changes
|
data/lib/estratto.rb
CHANGED
File without changes
|
data/lib/estratto/content.rb
CHANGED
File without changes
|
data/lib/estratto/data/base.rb
CHANGED
File without changes
|
data/lib/estratto/data/date.rb
CHANGED
File without changes
|
File without changes
|
data/lib/estratto/data/float.rb
CHANGED
File without changes
|
File without changes
|
data/lib/estratto/data/string.rb
CHANGED
File without changes
|
data/lib/estratto/document.rb
CHANGED
File without changes
|
data/lib/estratto/encoder.rb
CHANGED
File without changes
|
File without changes
|
data/lib/estratto/layout/base.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/estratto/parser.rb
CHANGED
File without changes
|
data/lib/estratto/register.rb
CHANGED
File without changes
|
data/lib/estratto/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: estratto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique A. Lavezzo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: charlock_holmes
|