crabfarm 0.1.1 → 0.1.2
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/lib/crabfarm/assertion/parsers.rb +1 -2
- data/lib/crabfarm/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: 49343d990ddd94c9640f37040a6fe5fc9a97ab49
|
4
|
+
data.tar.gz: f75e89f9dd4b5154f01df31837b98981fed38a3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f841a5d9a50476e38b7a1252b3de75fc132ffcbc4ecb7bd25f49cbfad976eab75f825f47c5ca1afa9c41c53f4713baeb2da8578ed233b2be40897b25f859348f
|
7
|
+
data.tar.gz: c183db189f4968561409c0eea25a54a7ad4fb015b7d8cd3abcceefe3edc7790392626b5944b4bfa5d32b06bf074f357b00867762fb8ee3e1a97889cb0618e778
|
@@ -85,8 +85,7 @@ module Crabfarm
|
|
85
85
|
def extract_number_from_string _value, _options
|
86
86
|
decimal_mark = _options.fetch(:decimal_mark, '.') # TODO: make default decimal mark configurable
|
87
87
|
thousand_mark = _options.fetch(:thousand_mark, infer_thousand_separator(decimal_mark))
|
88
|
-
num_rgx =
|
89
|
-
num_rgx = Regexp.new "(?:\\#{decimal_mark}\\d+|\\d{1,3}(?:\\#{thousand_mark}\\d{3})+(?:\\#{decimal_mark}\\d+)?|\\d+(?:\\#{decimal_mark}\\d+)?)"
|
88
|
+
num_rgx = Regexp.new "-?(?:\\#{decimal_mark}\\d+|\\d{1,3}(?:\\#{thousand_mark}\\d{3})+(?:\\#{decimal_mark}\\d+)?|\\d+(?:\\#{decimal_mark}\\d+)?)"
|
90
89
|
matches = _value.scan num_rgx
|
91
90
|
fail_with "'#{_value}' has an ambiguous numeric format" if matches.count > 1
|
92
91
|
fail_with "'#{_value}' does not contain any number" if matches.count < 1
|
data/lib/crabfarm/version.rb
CHANGED