fe_core_ext 0.18.1 → 0.21.0
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/pathname.rb +4 -0
- data/lib/fe_core_ext/core_ext/string.rb +9 -1
- 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: ef6b3f2b4feddc41d15a33f24b3cc758ec46d80b80f1fe96f193a94e88d5fd2c
|
4
|
+
data.tar.gz: a9c3f947886aedfa34c5fbf4da55ac3b481a0b2e97ee031706317e04ba5b7a69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8307fd7f008f9b864d394b8cb954fd957e88ab5236c32aaea05561f394dfb92c11c08ec541425f12b3c8afab23479f602ddf1e78ca2c4b6181e5e3ad76ca706f
|
7
|
+
data.tar.gz: 7bf2701a91ebb4e8d8c86545733fa19d44420e732e488d1a76a4ae9da87a315fbe5e201a1cba7fa7f98b4c0f931a21b060bf46dea58e7441c063cb5d24a26877
|
@@ -17,7 +17,7 @@ module FeCoreExt::CoreExt::String
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def to_decimal
|
20
|
-
return
|
20
|
+
return unless valid_number?
|
21
21
|
delete(',').to_d
|
22
22
|
end
|
23
23
|
|
@@ -75,9 +75,17 @@ module FeCoreExt::CoreExt::String
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def to_date_in_ja
|
78
|
+
to_date_in_ja_seireki || to_date_in_ja_heisei
|
79
|
+
end
|
80
|
+
|
81
|
+
def to_date_in_ja_seireki
|
78
82
|
match(/(\d{4})年(\d{1,2})月(\d{1,2})日/) {Date.new($1.to_i, $2.to_i, $3.to_i)}
|
79
83
|
end
|
80
84
|
|
85
|
+
def to_date_in_ja_heisei
|
86
|
+
match(/平成(\d{2})年(\d{1,2})月(\d{1,2})日/) {Date.new($1.to_i + 1988, $2.to_i, $3.to_i)}
|
87
|
+
end
|
88
|
+
|
81
89
|
# remove also no break space and other space like characters.
|
82
90
|
def strong_strip
|
83
91
|
reverse.gsub(/^\p{Zs}+|^\p{Cf}+/, '').reverse.gsub(/^\p{Zs}+|^\p{Cf}+/, '')
|
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.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tetsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|