browse-everything 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +1 -1
- data/lib/browse_everything/retriever.rb +6 -3
- data/lib/browse_everything/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bd89b5a4d99d1d4d288de7ea1f2d169b1d65052
|
4
|
+
data.tar.gz: b75cd73ebf3bac49970c4f5de27def245039557e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de5b0b8a4626e22d166a1d90143e7c2c2ba7c59a15db9cc6f770c8929c4efaadcdcf8df7de09a5f1c55524b9d60c6e8e7f7198db394893eba42ad22e6d88dd1b
|
7
|
+
data.tar.gz: a6c7b57568667806cdc534e3fc5d7b939382c63cc509bb83b7f25e3c8ec07a81719209b59dcb2551f84b5a792fd73acefb09fe14deecbd18802b932cf5549bff
|
data/.rubocop_todo.yml
CHANGED
@@ -32,6 +32,7 @@ module BrowseEverything
|
|
32
32
|
end
|
33
33
|
|
34
34
|
url = ::Addressable::URI.parse(spec['url'])
|
35
|
+
file_size = spec.fetch('file_size', 0).to_i
|
35
36
|
retrieved = 0
|
36
37
|
case url.scheme
|
37
38
|
when 'file'
|
@@ -39,7 +40,7 @@ module BrowseEverything
|
|
39
40
|
until f.eof?
|
40
41
|
chunk = f.read(chunk_size)
|
41
42
|
retrieved += chunk.length
|
42
|
-
yield(chunk, retrieved,
|
43
|
+
yield(chunk, retrieved, file_size)
|
43
44
|
end
|
44
45
|
end
|
45
46
|
when /https?/
|
@@ -48,9 +49,11 @@ module BrowseEverything
|
|
48
49
|
headers[k] = v.tr('+', ' ')
|
49
50
|
end
|
50
51
|
|
51
|
-
|
52
|
+
stream_body = file_size > 500.megabytes
|
53
|
+
|
54
|
+
HTTParty.get(url.to_s, stream_body: stream_body, headers: headers) do |chunk|
|
52
55
|
retrieved += chunk.length
|
53
|
-
yield(chunk, retrieved,
|
56
|
+
yield(chunk, retrieved, file_size)
|
54
57
|
end
|
55
58
|
else
|
56
59
|
raise URI::BadURIError, "Unknown URI scheme: #{url.scheme}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browse-everything
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carolyn Cole
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2017-
|
16
|
+
date: 2017-09-11 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: rails
|
@@ -570,7 +570,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
570
570
|
version: '0'
|
571
571
|
requirements: []
|
572
572
|
rubyforge_project:
|
573
|
-
rubygems_version: 2.
|
573
|
+
rubygems_version: 2.5.1
|
574
574
|
signing_key:
|
575
575
|
specification_version: 4
|
576
576
|
summary: AJAX/Rails engine file browser for cloud storage services
|