fe_core_ext 0.16.0 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fe_core_ext/core_ext/string.rb +7 -2
- data/lib/fe_core_ext/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0562e32d6e92503e137509fa2a929c7c57ee24e41a8bd8c6677368b22e323457
|
4
|
+
data.tar.gz: 6fb2bb1043ada8b48fc39757bd909d36943e80d19797011924cf2d6eba9de18c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcc0cfbc17348f4930ed2224c097c1cffd7af7332431811146bbfe69cd235afeeea75e8fc91b7b736df2d580b7e9c5df724f3e590a6748df3584acce3a4dda88
|
7
|
+
data.tar.gz: 50a631578e20f46f077ea1f272b07abd2938946c2b068c47f93adba4bc2eee8e067f7067637f7c417a0b849115ead3665f3b62c974d87801d5ce4ed632c75cb9
|
@@ -18,7 +18,7 @@ module FeCoreExt::CoreExt::String
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def integer?
|
21
|
-
self.
|
21
|
+
self.to_integer.to_s == self.delete(',')
|
22
22
|
end
|
23
23
|
|
24
24
|
def to_decimal
|
@@ -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?(
|
48
|
+
match?(/^-?(0|[1-9][\d\,\.]*)$/)
|
44
49
|
end
|
45
50
|
|
46
51
|
## deprecated
|
data/lib/fe_core_ext/version.rb
CHANGED
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.
|
4
|
+
version: 0.17.1
|
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-
|
11
|
+
date: 2022-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|