eitil 1.1.34 → 1.1.35

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfe9b499c92cf50def38b6ff67a2aeec1966bc6a05d6cba5e4b7d8dfefb38dfd
4
- data.tar.gz: 116a83f8965db21f455c5e36b8f253023b550f4c0ead34ecc14eb5ed7e04e894
3
+ metadata.gz: b74b9f015784dffbc676bc9267714da2a00fe4bb2a8850cffdea897b562d1c76
4
+ data.tar.gz: 77d4c34da79041eccf1964b06af3f6a172b6d90f3e47447583f6ca32f1760c6a
5
5
  SHA512:
6
- metadata.gz: 86bf0a0faaaac7509647519dd200d767063bcab69759a8a9ebf36c0be406bae574923ebb3618113c7e3fb22228d71eb3e2970b998e6989a38ab5b9c49c12a2bc
7
- data.tar.gz: 506b2a290c2323ff6c43453205d461ccb89c17a81dd08ff25f09e34a4826e4ccefa3909dff47bbf6e504ce44cb82059c89be40569f4038ac524c8f1317237c71
6
+ metadata.gz: ff1d56dd9b839a9e0b7fcb4d6ec3bcd3c982f7d05cf3b9d555c71752b0efbd3414d77e9b14e61e8a589a1f23bda83a8d73dc7e995f6371da68e6d46dc79a8462
7
+ data.tar.gz: 2be6215bd658c92994007989012d0278136950c506d4ab325a1a8ac1849e5a68d5d17a8d68347d480186053d30d0741d55f49b9e44c193a75edd1f7ba2cc4626
@@ -17,7 +17,7 @@ module EitilIntegrate::RubyXL
17
17
  end
18
18
 
19
19
  def try_float_conversion
20
- @hash.transform_values! { |array| array.map { |item| item.is_num? ? item.to_f : item } }
20
+ @hash.transform_values! { |array| array.map { |item| item.is_num? ? to_float(item) : item } }
21
21
  end
22
22
 
23
23
  def drop_nil_values
@@ -37,6 +37,12 @@ module EitilIntegrate::RubyXL
37
37
  value_is_a_int || value_is_a_float || value_is_a_time_string
38
38
  end
39
39
 
40
+ def to_float(object)
41
+ # Implemented a new to_float method, which replaces .to_f, because "7.5".to_f
42
+ # would correctly return 7.5, but "7,5" would incorrectly return 7.0.
43
+ object.is_a?(String) ? object.gsub(',','.').to_f : object.to_f
44
+ end
45
+
40
46
  def value_is_a_int
41
47
  @value.is_a? Integer
42
48
  end
@@ -16,7 +16,7 @@ module EitilStore
16
16
  UUID = /\A(\h{32}|\h{8}-\h{4}-\h{4}-\h{4}-\h{12})\z/
17
17
 
18
18
  # IsNum comes from the Rubinius source code and identifies both integers and floats correctly.
19
- IsNum = /^\s*[+-]?((\d+_?)*\d+(\.(\d+_?)*\d+)?|\.(\d+_?)*\d+)(\s*|([eE][+-]?(\d+_?)*\d+)\s*)$/
19
+ IsNum = /^\s*[+-]?((\d+_?)*\d+([.,](\d+_?)*\d+)?|\.(\d+_?)*\d+)(\s*|([eE][+-]?(\d+_?)*\d+)\s*)$/
20
20
 
21
21
  # Validates Credit Card numbers, Checks if it contains 16 numbers in groups of 4 separated by -, space or nothing
22
22
  CreditCard = /\A(\d{4}-){3}\d{4}\z|\A(\d{4}\s){3}\d{4}\z|\A\d{16}\z/
data/lib/eitil/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Eitil
2
2
 
3
- VERSION = '1.1.34'
3
+ VERSION = '1.1.35'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eitil
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.34
4
+ version: 1.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jurriaan Schrofer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-20 00:00:00.000000000 Z
11
+ date: 2021-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails