fe_core_ext 0.12.1 → 0.13.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/uri.rb +5 -0
- 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: a6509e45e7856df89bc3f07e710a8e225ec2fc663aa220eaa8dd3b21148f0918
|
4
|
+
data.tar.gz: 4c730c403a8f83f6883da2f63f25d430841c24a3a5ffe2d4764e81f1a2ede3d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cef3a1512b31ca2f07d9c11de0d89220d403a905b78de4bf4265da37ae2e8e34b51d64791455f4e111534fe84ca1f54db0173ee33148592fb389df061fab883
|
7
|
+
data.tar.gz: b7100437b7e62e38c35507338715109e4700299d58ac3d54688da33350865fa60c6d4b4c2cb6978ef9de70a497d0684c18ed5a1511fd50781e2cb628ba79d339
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'uri'
|
2
|
+
require 'fileutils'
|
2
3
|
require 'open-uri'
|
3
4
|
require 'net/http'
|
4
5
|
|
@@ -8,6 +9,10 @@ end
|
|
8
9
|
module URI
|
9
10
|
def download(file)
|
10
11
|
binary = OpenURI.open_uri(self).read
|
12
|
+
dirname = File.dirname(file)
|
13
|
+
unless File.directory?(dirname)
|
14
|
+
FileUtils.mkdir_p(dirname)
|
15
|
+
end
|
11
16
|
::File.open(file, 'wb') {|f| f.write(binary)}
|
12
17
|
end
|
13
18
|
|
data/lib/fe_core_ext/version.rb
CHANGED