fe_core_ext 0.17.1 → 0.18.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/string.rb +1 -6
- data/lib/fe_core_ext/core_ext/uri.rb +3 -3
- 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: f7b249684158c61dd3689d6aade9963e9858a58c94070a63cf0b3ea1b78dc78d
|
4
|
+
data.tar.gz: 799e3cc09408170caa03b2d03660358327bb059b067951b0183f92d0dd3cb81c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4f4afd059064d73481bbe5e9b8c8da1f82ab14d0cc9195136dd324bdef3ed111f6f19ecf9ebb5fa6b4d67c2f5a26b5b1e6f535f8352f91052f78e172435c0c3
|
7
|
+
data.tar.gz: 711a007c2dde9507e4b8b683a524905397370adb6bd8c4533e9e8ba334b8659362dfdf9f73c92a32adc901db06f008b65802bd6cb8dc600f7338a9ffed8698cd
|
@@ -8,11 +8,6 @@ end
|
|
8
8
|
|
9
9
|
module FeCoreExt::CoreExt::String
|
10
10
|
def to_integer
|
11
|
-
return if not_number?
|
12
|
-
delete(',').to_i
|
13
|
-
end
|
14
|
-
|
15
|
-
def to_integer_new
|
16
11
|
return unless valid_number?
|
17
12
|
delete(',').to_i
|
18
13
|
end
|
@@ -45,7 +40,7 @@ module FeCoreExt::CoreExt::String
|
|
45
40
|
end
|
46
41
|
|
47
42
|
def valid_number?
|
48
|
-
match?(/^-?(0
|
43
|
+
match?(/^-?([0-9][\d\,\.]*)$/)
|
49
44
|
end
|
50
45
|
|
51
46
|
## deprecated
|
@@ -8,11 +8,11 @@ end
|
|
8
8
|
|
9
9
|
module URI
|
10
10
|
def download(file)
|
11
|
+
warn 'URI#downloadの引数にはPathnameを使いましょう!' if 'file'.is_a?(String)
|
11
12
|
binary = OpenURI.open_uri(self).read
|
13
|
+
file = file + self.basename if file.to_s[-1] == '/'
|
12
14
|
dirname = ::File.dirname(file)
|
13
|
-
unless ::File.directory?(dirname)
|
14
|
-
::FileUtils.mkdir_p(dirname)
|
15
|
-
end
|
15
|
+
::FileUtils.mkdir_p(dirname) unless ::File.directory?(dirname)
|
16
16
|
::File.open(file, 'wb') {|f| f.write(binary)}
|
17
17
|
end
|
18
18
|
|
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.18.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-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|