estratto 1.0.3 → 1.0.4

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: 81ad6d5b175ef7ddbbf1d8e279715585e39c39e29fb930f710700d1d41075460
4
- data.tar.gz: 35e2d119781e972cc45116224969681b95f801d3e32afca5b61d865ac824bce4
3
+ metadata.gz: c513e33d6b389bc493e117c7aa42f05343b136c6c888b8729effc6968e0ac2b3
4
+ data.tar.gz: 5ae62d1c1942e3837770694e6266b74d98f9d723cedbe0045660bc2d6ecf99da
5
5
  SHA512:
6
- metadata.gz: b9fff31ab9057250a0bef1d96c25ac8d60e1e5fa37cbf7a175554114751058807e3aac524e397c578f88279b96434335f2386f14570dd1021e1eed57f20c8252
7
- data.tar.gz: eeef2f8df3fc33cc053fa59cad2e752924d1ca26584b25a35e9efafc491820a4348f51738e6353b8f3bed69093d6342319e239029510132693ffdbb3a0eab8cd
6
+ metadata.gz: 07c55baf1aeabc93ca7f250bb94e241adaa04403983094d6045bf68e27ba48df9ebcc87e84c176a0e601ec2fe6848f731ba9faacce28d39707ed5267320e06f2
7
+ data.tar.gz: 6bb14f1b04f4f2f2c18f63b9bbd3b3613703a972c03d61c715f1563bca622428f139e114d0874dcf5b63c7d362b2cea7fa6b1b23cdfd71e7ea50a4729e5cc1d6
data/.gitignore CHANGED
File without changes
data/.rspec CHANGED
File without changes
File without changes
@@ -1,3 +1,8 @@
1
- ### 1.0.3 (05/09/20189)
1
+ ### 1.0.4 (06/10/2019)
2
+
3
+ * Fix date requires crashes;
4
+ * Included `allow_empty?` property into `formats` node, that allow estratto to send `nil` value when data to be coerced does not be the same expected by coercer;
5
+
6
+ ### 1.0.3 (05/09/2019)
2
7
 
3
8
  * Implement coercer error improvement, that expose data, and line number that raises error
data/Gemfile CHANGED
File without changes
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- estratto (1.0.2)
4
+ estratto (1.0.4)
5
5
  charlock_holmes
6
6
 
7
7
  GEM
@@ -62,4 +62,4 @@ DEPENDENCIES
62
62
  rspec (~> 3.0)
63
63
 
64
64
  BUNDLED WITH
65
- 2.0.1
65
+ 2.0.2
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -21,8 +21,10 @@ module Estratto
21
21
  def build
22
22
  target_coercer.coerce
23
23
  rescue StandardError => error
24
- raise DataCoercionError,
25
- "Error when coercing #{data} on line #{index}, raising: #{error.message}"
24
+ unless allow_empty?
25
+ raise DataCoercionError,
26
+ "Error when coercing #{data} on line #{index}, raising: #{error.message}"
27
+ end
26
28
  end
27
29
 
28
30
  def target_coercer
@@ -30,6 +32,10 @@ module Estratto
30
32
  rescue NameError
31
33
  raise InvalidCoercionType, "Does not exists coercer class for #{type}"
32
34
  end
35
+
36
+ def allow_empty?
37
+ formats.dig(:allow_empty?)
38
+ end
33
39
  end
34
40
  end
35
41
  end
File without changes
@@ -1,3 +1,4 @@
1
+ require 'date'
1
2
  require_relative 'base'
2
3
 
3
4
  module Estratto
@@ -35,7 +35,6 @@ module Estratto
35
35
  def precision
36
36
  formats['precision'].to_i || 2
37
37
  end
38
-
39
38
  end
40
39
  end
41
40
  end
@@ -3,7 +3,6 @@ require_relative 'base'
3
3
  module Estratto
4
4
  module Data
5
5
  class Integer < Base
6
-
7
6
  def coerce
8
7
  data.to_i
9
8
  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
@@ -1,3 +1,3 @@
1
1
  module Estratto
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
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.3
4
+ version: 1.0.4
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-09-05 00:00:00.000000000 Z
11
+ date: 2019-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: charlock_holmes