Skip to content

Commit d0c2986

Browse files
committed
Fix remaining RuboCop CI failures
1 parent cf7c47a commit d0c2986

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

lib/uploadcare.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
require 'zeitwerk'
44
require 'faraday'
55

6-
module Uploadcare
7-
end
8-
96
require_relative 'uploadcare/cname_generator'
107

118
module Uploadcare

lib/uploadcare/configuration.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ def with(**options)
6060
end
6161

6262
def to_h
63-
DEFAULTS.keys.each_with_object({}) do |attribute, result|
64-
result[attribute] = public_send(attribute)
65-
end
63+
DEFAULTS.keys.to_h { |attribute| [attribute, public_send(attribute)] }
6664
end
6765
end

lib/uploadcare/operations/multipart_upload.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ def upload_parts_parallel(file, presigned_urls, part_size, threads, &block)
116116
end
117117

118118
def run_parallel_worker(queue, file_path, part_size, total_size, total_parts, mutex, uploaded, errors, &block)
119-
worker_file = ::File.open(file_path, 'rb')
120-
begin
119+
::File.open(file_path, 'rb') do |worker_file|
121120
loop do
122121
job = queue.pop
123122
break if job.nil?
@@ -139,8 +138,6 @@ def run_parallel_worker(queue, file_path, part_size, total_size, total_parts, mu
139138
end
140139
rescue StandardError => e
141140
mutex.synchronize { errors << e }
142-
ensure
143-
worker_file.close
144141
end
145142
end
146143
end

spec/uploadcare/coverage_boost_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@
287287
let(:handler_class) do
288288
Class.new do
289289
include Uploadcare::Internal::ThrottleHandler
290+
290291
def config
291292
Uploadcare::Configuration.new(max_throttle_attempts: 2)
292293
end

0 commit comments

Comments
 (0)