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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c513e33d6b389bc493e117c7aa42f05343b136c6c888b8729effc6968e0ac2b3
4
- data.tar.gz: 5ae62d1c1942e3837770694e6266b74d98f9d723cedbe0045660bc2d6ecf99da
3
+ metadata.gz: f3a8144b72518c01e8f3c6987d3900abdc2e6b1da2e0c1283c28d0b21b69a5e0
4
+ data.tar.gz: 53a123b710d3c3abf8b2c8aca8a004870ca391fa0cb816c357f8731a6f7dd002
5
5
  SHA512:
6
- metadata.gz: 07c55baf1aeabc93ca7f250bb94e241adaa04403983094d6045bf68e27ba48df9ebcc87e84c176a0e601ec2fe6848f731ba9faacce28d39707ed5267320e06f2
7
- data.tar.gz: 6bb14f1b04f4f2f2c18f63b9bbd3b3613703a972c03d61c715f1563bca622428f139e114d0874dcf5b63c7d362b2cea7fa6b1b23cdfd71e7ea50a4729e5cc1d6
6
+ metadata.gz: 80d9ac6b08b2c6c8953fd343926d8930a6201df97b3e3db66c8dc8cd3abf3922979e9af8e472a2110f4f7fecfbc4520fa3fc34c9410fbd877ad714b9877cd3ed
7
+ data.tar.gz: 2f7c4bb5a4db412b65bab74be6785dad412ac9b193c4d8add3f3570a85da681612f115c496c677fa135434a14cade247d351d3a1eb0cb04fc5db82ff8d61aad3
data/.gitignore CHANGED
File without changes
data/.rspec CHANGED
File without changes
File without changes
@@ -1,3 +1,8 @@
1
+ ### 1.0.5 (7/10/2019)
2
+
3
+ * Idiomatic refine. Changing `allow_empty?` question like, to `allow_empty` inference.
4
+ * Fix YAML pattern keys as string, instead of symbol;
5
+
1
6
  ### 1.0.4 (06/10/2019)
2
7
 
3
8
  * Fix date requires crashes;
data/Gemfile CHANGED
File without changes
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- estratto (1.0.4)
4
+ estratto (1.0.5)
5
5
  charlock_holmes
6
6
 
7
7
  GEM
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
File without changes
File without changes
File without changes
File without changes
@@ -34,7 +34,7 @@ module Estratto
34
34
  end
35
35
 
36
36
  def allow_empty?
37
- formats.dig(:allow_empty?)
37
+ formats.dig('allow_empty')
38
38
  end
39
39
  end
40
40
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module Estratto
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
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
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-06 00:00:00.000000000 Z
11
+ date: 2019-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: charlock_holmes