paperweight 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ccf0600d57412d8ff22d523c1a5b935e2c770bc78f95de0ec310891864ac791
4
- data.tar.gz: 061342fbdaf7d07e4623a9daa999f973395ca28f4ecc80a2aef1c262db7acd67
3
+ metadata.gz: bf350a78eb45871318695fd3a2f6d2d3c4126f7dd3b28140e1012d8141f3479b
4
+ data.tar.gz: 0f94872951f119858b46f4e7f5c545dbe1d73fe3b4c31b29e5870529455e28ec
5
5
  SHA512:
6
- metadata.gz: 3d471be00f0029ccfa2a7138d7ba353e56d117afc4926acae8510287793bd9335fb0d503d250cbbf89f25f59bb5fc71a90dd3c34480f0017999450cf6089d262
7
- data.tar.gz: be97b3029bb54200f8e815645c55b71452c95137d2c47f6b9ce0dcef50e3be9ac17e6b0a0b560cbc4618451f3f8843bfa2acca990017b19ade0853020a76b47e
6
+ metadata.gz: 17bebeb321a9ff3fb55233b04a6ac79c1d2931778a616c8080c57ff0a52534604159725f32c248b34d0ee5f223d4ad58c11530a2f40c19798e4042983e2104d8
7
+ data.tar.gz: 1c7cab05077be909ed669a7a08b23da19cd40cbc9458cfa27523e90689defae0e798b506baf19c9f84ecd1a9d7e9c53556a10e54c48cdb7b0fac60b404e6a600
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.0.2] - 2018-09-04
10
+ ### Changed
11
+ - Handle the case where an image has been removed or cleared before the post process job executes. In this case the job should bail out before attempting to download the file.
12
+
9
13
  ## [1.0.1] - 2018-08-15
10
14
  ### Changed
11
15
  - Fixed `paperweight` to not break `paperclip` functionality when a record does not contain the `#*_processing` column.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paperweight (1.0.1)
4
+ paperweight (1.0.2)
5
5
  paperclip (>= 5)
6
6
  rails (>= 5)
7
7
 
@@ -30,6 +30,10 @@ module Paperweight
30
30
  raise Error, "download failed (#{url}): #{message}"
31
31
  end
32
32
 
33
+ def self.download(url)
34
+ new.download(url)
35
+ end
36
+
33
37
  private
34
38
 
35
39
  # open-uri will return a StringIO instead of a Tempfile if the filesize
@@ -9,9 +9,10 @@ module Paperweight
9
9
 
10
10
  def perform(model, name)
11
11
  processing = :"#{name}_processing"
12
+ image_url = model.public_send(processing)
12
13
 
13
- tempfile = Download.new.download(model.public_send(processing))
14
- model.update!(name => tempfile, processing => nil)
14
+ return unless image_url
15
+ model.update!(name => Download.download(image_url), processing => nil)
15
16
  end
16
17
  end
17
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paperweight
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperweight
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Deisz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-15 00:00:00.000000000 Z
11
+ date: 2018-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paperclip