filbunke 1.13.2 → 1.13.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Y2RhNGVjMjMzZmFmZGFkOWQzMGE3OTJmYjlkZTg2NzU3NDYxNzNkNg==
4
+ YjBmZGY5ZWY1MjM2ZjM4ZTZkYWMxZjg3OTJkMmExMTQ5MTNkNjdkNg==
5
5
  data.tar.gz: !binary |-
6
- NWIzOGJiNzIwNzEwYjMxMWQwMzFkNTI4NjYzYmIzOWFkYjRkZmZiNA==
6
+ Yjk5ZTMzZmUxMzE3YzkxNzk4ZWNhMWUwZDU2NmYwMjFkZWNmZWMwNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmViNTdlMWQxZjYwNGU3ZGFmODdkOWE3MzdhYzUxNTI0NDU4ZWVlMWYzNWI0
10
- YzMyM2ZiM2M3Y2RkOTMzNWQ5MjQzM2UyZGJlYzkwNjRkZTc3YzcxZmFmMDNl
11
- NmM3YjhhYTk1MjFkZmFjYzExODQzYmVjNzc5ZTE0NjQ2MjQ2OTY=
9
+ MzhiMmMyMzFiNzcxNTZlOTJjMjgzZTQ0ODRlNTE5YTZjYTExMTY2ZGM2OTA5
10
+ ZDZiMzJhZWVlN2EyOWMzZWJiNjQ1YjU1M2ZhMWYyOGNlY2YzMTk2NmJkZGFj
11
+ ZWQ3OWE3YTdjNTVkODc2ZjI1ZTcxYWVjNDE4NTc3NzIzYjlkYjQ=
12
12
  data.tar.gz: !binary |-
13
- ZDk3OWY4MjMyZjE4ZDQ1N2ExZDFjYjgxMjQzYTFkZjg5MzFmMDU1MDQ3MWVi
14
- MmJlZTU5MTI2OTQ3ZjY2NmY2MmMyZjA5MWMzOWU3MDBlNDQ5MGJjOGIyYjE5
15
- NDYxM2EyNjNjZGE0OWE4NDA0NTgwODA5N2UyNjBlYzBlYTU3ODk=
13
+ MmY0ZWI5OTJjYWRiZjQxNmYwZjZlN2UxZGQ0MDQ4NTFkMzBmNWQ4ZDc0NzAz
14
+ MmMxYWEyMTM3ZDgzM2VkYTE3MWI3ZmI3OGIxNmUzMmQ0ZjYxYzhjMTEyZTRm
15
+ NzRkNzhlZmRlZWYxYzhjYzlkNmJiNmEzNjQ0NjNlMzQ4YjU1ZmY=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.13.2
1
+ 1.13.3
data/filbunke.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: filbunke 1.13.2 ruby lib
5
+ # stub: filbunke 1.13.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "filbunke"
9
- s.version = "1.13.2"
9
+ s.version = "1.13.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -240,6 +240,8 @@ module Filbunke
240
240
  end
241
241
 
242
242
  def update_http_file!(file, local_file_path)
243
+ downloaded_file = nil
244
+ tmp_filename = "#{local_file_path}-#{(0...8).map { (65 + rand(26)).chr }.join}.tmp"
243
245
  begin
244
246
  async_request = if @repository.user
245
247
  Typhoeus::Request.new(
@@ -255,8 +257,7 @@ module Filbunke
255
257
  )
256
258
  end
257
259
 
258
- downloaded_file = nil
259
- tmp_filename = "#{local_file_path}-#{(0...8).map { (65 + rand(26)).chr }.join}.tmp"
260
+
260
261
  async_request.on_headers do |response|
261
262
  if response.code != 200
262
263
  raise "Failed to fetch response(#{response.code}) for url '#{response.effective_url}' ---\n\t #{response.inspect}"
@@ -274,10 +275,12 @@ module Filbunke
274
275
  unless downloaded_file.nil?
275
276
  downloaded_file.close
276
277
  end
277
- if response.code == 200
278
- ::FileUtils.mv(tmp_filename, local_file_path)
279
- else
280
- ::FileUtils.rm(tmp_filename) if ::File.exist?(tmp_filename)
278
+ if ::File.exist?(tmp_filename)
279
+ if response.code == 200
280
+ ::FileUtils.mv(tmp_filename, local_file_path)
281
+ else
282
+ ::FileUtils.rm(tmp_filename)
283
+ end
281
284
  end
282
285
  true
283
286
  end
@@ -287,6 +290,9 @@ module Filbunke
287
290
  rescue RuntimeError, SystemCallError, StandardError => e
288
291
  msg = ["#{e.class} - #{e.message}", *e.backtrace].join("\n\t")
289
292
  @logger.error "Failed to update file #{file.url}: #{msg}"
293
+ if ::File.exist?(tmp_filename)
294
+ ::FileUtils.rm(tmp_filename)
295
+ end
290
296
  false
291
297
  end
292
298
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filbunke
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.2
4
+ version: 1.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter de Bie