fe_core_ext 0.11.0 → 0.13.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d73ff1e3330a404b7c2d2b1b8194770774963351df63355a9248e9ea386f1ab
|
4
|
+
data.tar.gz: ec4a5a0d73267c7888f4d34281a72eeba98666a1dbaddb3fe0039fe8aba248e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e90a09d47bdd8f4fb5d66048cb4b3fee78716dbf7d5833ecb5705bd1f14c27ce8c6a4ee8c637dea1ee450d7d6418fae8791ac37b4bbc836c3d3d0451c2bae08
|
7
|
+
data.tar.gz: aea51cb43dbf5331531d93db23f8acc015ee4b35881953f36137d5f6e41cbd3b817b60f8bab445ec68e3eeead2a9bbdbd938e7aaeeb0238559bef8196003922d
|
@@ -31,6 +31,12 @@ module FeCoreExt::CoreExt::Pathname
|
|
31
31
|
def require_relative
|
32
32
|
Kernel.require_relative(self)
|
33
33
|
end
|
34
|
+
end
|
35
|
+
|
36
|
+
module FeCoreExt::CoreExt::PathnameClassMethods
|
37
|
+
def join(*args)
|
38
|
+
new(File.join(*args))
|
39
|
+
end
|
34
40
|
|
35
41
|
def mktmpdir(prefix_suffix=nil, tmpdir=nil)
|
36
42
|
if block_given?
|
@@ -43,12 +49,6 @@ module FeCoreExt::CoreExt::Pathname
|
|
43
49
|
end
|
44
50
|
end
|
45
51
|
|
46
|
-
module FeCoreExt::CoreExt::PathnameClassMethods
|
47
|
-
def join(*args)
|
48
|
-
new(File.join(*args))
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
52
|
class Pathname
|
53
53
|
extend FeCoreExt::CoreExt::PathnameClassMethods
|
54
54
|
include FeCoreExt::CoreExt::Pathname
|
@@ -25,10 +25,15 @@ module FeCoreExt::CoreExt::String
|
|
25
25
|
to_i == 0 && match('0').nil?
|
26
26
|
end
|
27
27
|
|
28
|
+
## deprecated
|
28
29
|
def zen_to_han
|
29
30
|
tr('0-9A-Za-z &・-()', '0-9A-Za-z &・\-()')
|
30
31
|
end
|
31
32
|
|
33
|
+
def alphanumeric_zen_to_han
|
34
|
+
tr('0-9A-Za-z &・-()', '0-9A-Za-z &・\-()')
|
35
|
+
end
|
36
|
+
|
32
37
|
def to_katakana
|
33
38
|
tr('ぁ-ん', 'ァ-ン')
|
34
39
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'uri'
|
2
|
+
require 'fileutils'
|
2
3
|
require 'open-uri'
|
3
4
|
require 'net/http'
|
4
5
|
|
@@ -8,11 +9,15 @@ end
|
|
8
9
|
module URI
|
9
10
|
def download(file)
|
10
11
|
binary = OpenURI.open_uri(self).read
|
11
|
-
File.
|
12
|
+
dirname = ::File.dirname(file)
|
13
|
+
unless ::File.directory?(dirname)
|
14
|
+
::FileUtils.mkdir_p(dirname)
|
15
|
+
end
|
16
|
+
::File.open(file, 'wb') {|f| f.write(binary)}
|
12
17
|
end
|
13
18
|
|
14
19
|
def exists?
|
15
|
-
req = Net::HTTP.new(host, port)
|
20
|
+
req = ::Net::HTTP.new(host, port)
|
16
21
|
req.use_ssl = true if scheme == 'https'
|
17
22
|
res = req.request_head(path)
|
18
23
|
return URI(res['location']).exists? if %w(301 302).include?(res.code)
|
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.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tetsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -130,8 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
|
-
|
134
|
-
rubygems_version: 2.7.6.2
|
133
|
+
rubygems_version: 3.1.6
|
135
134
|
signing_key:
|
136
135
|
specification_version: 4
|
137
136
|
summary: Core class extensions
|