fe_core_ext 0.16.1 → 0.17.2

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: 24210816b8a1376ab6234ec60570a056d2b7887501f8f9311e8a810bd7fa3212
4
- data.tar.gz: 4d455281c1f2c002286d9825b9fa4577288d2fe220219b0a0e0544765b1335a0
3
+ metadata.gz: 31f0bf47a6cec69cc5bbc1d89d60917b33190151710d2bd0556f430701c2d39e
4
+ data.tar.gz: 9534202d095c18eb3d4e13a763bdda3a12532240c7b963d8d945688d25041c99
5
5
  SHA512:
6
- metadata.gz: 534d9a1092afe7b3b7c40b9ed5da04a034ea5e0fac0fec76eab168d5c08512ed95415dac80c8ff12fc5742337251164413732d6c7e1a165064d7ee33201423ea
7
- data.tar.gz: 36a0671916faccc840804b6dc157cca33416f47b9bdaacf1ae13c5759f45719ab25a5f769f757003db19867a4aab60aa3575ce60010d6da033136ad2123ba2f9
6
+ metadata.gz: 229303606ccede9b55510cdd8ae857b4cad38648e802f5958f3528c065f31b200066df892a6e205c55ab577635d6d10f60eedde99c9a693fe80fa1030140e75e
7
+ data.tar.gz: 6ad8b6a20d2c2826e697630065902db3dea3b2a0b03e8daa3beed8ce7927ffe6b0dbab72197d79c4d0d13986e34232b4ad89c06dc36d08277b2b1e0c8d1c692e
@@ -31,6 +31,11 @@ module FeCoreExt::CoreExt::String
31
31
  delete(',').to_d
32
32
  end
33
33
 
34
+ def to_float
35
+ return unless valid_number?
36
+ delete(',').to_f
37
+ end
38
+
34
39
  def to_pathname
35
40
  Pathname(self)
36
41
  end
@@ -40,7 +45,7 @@ module FeCoreExt::CoreExt::String
40
45
  end
41
46
 
42
47
  def valid_number?
43
- match?(/^[\d\,\.]+$/)
48
+ match?(/^-?([0-9][\d\,\.]*)$/)
44
49
  end
45
50
 
46
51
  ## deprecated
@@ -1,3 +1,3 @@
1
1
  module FeCoreExt
2
- VERSION = '0.16.1'
2
+ VERSION = '0.17.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fe_core_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.1
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tetsu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-07 00:00:00.000000000 Z
11
+ date: 2022-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport