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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89eb9b588515d2dc5644b29728ca80c6e339132d
4
- data.tar.gz: be62f43cb494e3b072535f586a1c9475be5733ef
3
+ metadata.gz: 8bd89b5a4d99d1d4d288de7ea1f2d169b1d65052
4
+ data.tar.gz: b75cd73ebf3bac49970c4f5de27def245039557e
5
5
  SHA512:
6
- metadata.gz: 80e1bbe576841d9ce6e92ded2ecc661e737a11993621ec1bc8e4478b2c72bb5c59c54a733324c01197eddcf8f32694673c47639e617ee070139a6f2865f87bd1
7
- data.tar.gz: 869fb6717555cdff963b6652daca08994f3a92279bd8a1a33d737125fa11dd611c7fe5a36f4ff2bd92c1d0ddada6f1a6fe1dc71a4cc9cab79d264c6ba50211a5
6
+ metadata.gz: de5b0b8a4626e22d166a1d90143e7c2c2ba7c59a15db9cc6f770c8929c4efaadcdcf8df7de09a5f1c55524b9d60c6e8e7f7198db394893eba42ad22e6d88dd1b
7
+ data.tar.gz: a6c7b57568667806cdc534e3fc5d7b939382c63cc509bb83b7f25e3c8ec07a81719209b59dcb2551f84b5a792fd73acefb09fe14deecbd18802b932cf5549bff
data/.rubocop_todo.yml CHANGED
@@ -24,7 +24,7 @@ Metrics/CyclomaticComplexity:
24
24
  # Offense count: 10
25
25
  # Configuration parameters: CountComments.
26
26
  Metrics/MethodLength:
27
- Max: 26
27
+ Max: 28
28
28
 
29
29
  # Offense count: 1
30
30
  # Configuration parameters: CountKeywordArgs.
@@ -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, spec['file_size'].to_i)
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
- HTTParty.get(url.to_s, headers: headers) do |chunk|
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, spec['file_size'].to_i)
56
+ yield(chunk, retrieved, file_size)
54
57
  end
55
58
  else
56
59
  raise URI::BadURIError, "Unknown URI scheme: #{url.scheme}"
@@ -1,3 +1,3 @@
1
1
  module BrowseEverything
2
- VERSION = '0.14.0'.freeze
2
+ VERSION = '0.14.1'.freeze
3
3
  end
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.0
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-07-07 00:00:00.000000000 Z
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.6.12
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