fe_core_ext 0.13.0 → 0.13.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/uri.rb +4 -4
- data/lib/fe_core_ext/version.rb +1 -1
- metadata +1 -1
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
|
@@ -9,15 +9,15 @@ end
|
|
9
9
|
module URI
|
10
10
|
def download(file)
|
11
11
|
binary = OpenURI.open_uri(self).read
|
12
|
-
dirname = File.dirname(file)
|
13
|
-
unless File.directory?(dirname)
|
14
|
-
FileUtils.mkdir_p(dirname)
|
12
|
+
dirname = ::File.dirname(file)
|
13
|
+
unless ::File.directory?(dirname)
|
14
|
+
::FileUtils.mkdir_p(dirname)
|
15
15
|
end
|
16
16
|
::File.open(file, 'wb') {|f| f.write(binary)}
|
17
17
|
end
|
18
18
|
|
19
19
|
def exists?
|
20
|
-
req = Net::HTTP.new(host, port)
|
20
|
+
req = ::Net::HTTP.new(host, port)
|
21
21
|
req.use_ssl = true if scheme == 'https'
|
22
22
|
res = req.request_head(path)
|
23
23
|
return URI(res['location']).exists? if %w(301 302).include?(res.code)
|
data/lib/fe_core_ext/version.rb
CHANGED