paperweight 1.1.0 → 1.2.0

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
  SHA256:
3
- metadata.gz: 1c3a418afa5d783b26a30c395d25027a6520661087e828d13ae522a57c72d84a
4
- data.tar.gz: b137292e157766a5ac5bb6c5dd583a05d98cc44ec8f9a40039f65ede48f70d48
3
+ metadata.gz: b4088736d7d52a74d52cd5406056eb0cf6e60a583162741c36fc71ca70c9217f
4
+ data.tar.gz: 6c19dd7d3fdf2736c6869261d6b0e17bd39ce4e7c7bb8d24bf943478f82fd915
5
5
  SHA512:
6
- metadata.gz: 334f233a0b66cd999ed338c09c9a77dd28b2866677c9a1935d7e6c33a8a63f9a28daf1d093698a4ee321707d3ac337dafb76cbadb5774d4658d64a71cabfe080
7
- data.tar.gz: bf8736c8fdcf75f40c8bc52187f5b9c5fd18de0f283acae419ceb3c5bc77eea037f6810c1a78d069216aeb853c7f8b5278a4a7f36683a7529df132ded2da7461
6
+ metadata.gz: ca88b6907567fefe7d6d4cca3da64230aba3745e1fad9a9bc2d01436b8e6cc172cdd8e40060058452472d178dd2bda1602871cf58eea3e511de402dca24db9f4
7
+ data.tar.gz: 464cf9f8e0b8f811268855631e5f29dcb56f203d51b376a121510ef525d6186842e482c0d3270f19bfbb932e2d7bd70ea30e0c46f2b316814ae5448c5d04a0b4
@@ -3,7 +3,13 @@ workflow "Main" {
3
3
  resolves = "Publish"
4
4
  }
5
5
 
6
+ action "Bundler" {
7
+ uses = "docker://culturehq/actions-bundler:latest"
8
+ runs = "gem install bundler"
9
+ }
10
+
6
11
  action "Install" {
12
+ needs = "Bundler"
7
13
  uses = "docker://culturehq/actions-bundler:latest"
8
14
  args = "install"
9
15
  }
@@ -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.2.0] - 2019-02-27
10
+ ### Added
11
+ - Support a `download_attempts` configuration option for retrying the download. Currently defaults to 1 to maintain backwards compatability.
12
+
9
13
  ## [1.1.0] - 2019-01-08
10
14
  ### Added
11
15
  - Support the `after_download` option on `paperweight`-enabled attachments that takes a callable and calls it when the post process job has completed.
@@ -27,9 +31,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
27
31
  ### Added
28
32
  - The ability to configure the `max_size` value (the maximum download size) using the `Paperweight.configure` method.
29
33
 
30
- [Unreleased]: https://github.com/CultureHQ/paperweight/compare/v1.1.0...HEAD
34
+ [Unreleased]: https://github.com/CultureHQ/paperweight/compare/v1.2.0...HEAD
35
+ [1.2.0]: https://github.com/CultureHQ/paperweight/compare/v1.1.0...v1.2.0
31
36
  [1.1.0]: https://github.com/CultureHQ/paperweight/compare/v1.0.2...v1.1.0
32
37
  [1.0.2]: https://github.com/CultureHQ/paperweight/compare/v1.0.1...v1.0.2
33
38
  [1.0.1]: https://github.com/CultureHQ/paperweight/compare/v1.0.0...v1.0.1
34
39
  [1.0.0]: https://github.com/CultureHQ/paperweight/compare/v0.2.0...v1.0.0
35
- [0.2.0]: https://github.com/CultureHQ/paperweight/compare/v0.1.2...v0.2.0
40
+ [0.2.0]: https://github.com/CultureHQ/paperweight/compare/780202...v0.2.0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paperweight (1.1.0)
4
+ paperweight (1.2.0)
5
5
  paperclip (>= 5)
6
6
  rails (>= 5)
7
7
 
@@ -52,17 +52,17 @@ GEM
52
52
  arel (9.0.0)
53
53
  ast (2.4.0)
54
54
  builder (3.2.3)
55
- bundler-audit (0.6.0)
56
- bundler (~> 1.2)
55
+ bundler-audit (0.6.1)
56
+ bundler (>= 1.2.0, < 3)
57
57
  thor (~> 0.18)
58
58
  climate_control (0.2.0)
59
59
  concurrent-ruby (1.1.4)
60
60
  crass (1.0.4)
61
61
  docile (1.3.1)
62
62
  erubi (1.8.0)
63
- globalid (0.4.1)
63
+ globalid (0.4.2)
64
64
  activesupport (>= 4.2.0)
65
- i18n (1.5.1)
65
+ i18n (1.5.3)
66
66
  concurrent-ruby (~> 1.0)
67
67
  jaro_winkler (1.5.2)
68
68
  json (2.1.0)
@@ -82,7 +82,7 @@ GEM
82
82
  mini_portile2 (2.4.0)
83
83
  minitest (5.11.3)
84
84
  nio4r (2.3.1)
85
- nokogiri (1.10.0)
85
+ nokogiri (1.10.1)
86
86
  mini_portile2 (~> 2.4.0)
87
87
  paperclip (6.1.0)
88
88
  activemodel (>= 4.2.0)
@@ -90,10 +90,11 @@ GEM
90
90
  mime-types
91
91
  mimemagic (~> 0.3.0)
92
92
  terrapin (~> 0.6.0)
93
- parallel (1.12.1)
94
- parser (2.5.3.0)
93
+ parallel (1.13.0)
94
+ parser (2.6.0.0)
95
95
  ast (~> 2.4.0)
96
96
  powerpack (0.1.2)
97
+ psych (3.1.0)
97
98
  rack (2.0.6)
98
99
  rack-test (1.1.0)
99
100
  rack (>= 1.0, < 3)
@@ -123,11 +124,12 @@ GEM
123
124
  thor (>= 0.19.0, < 2.0)
124
125
  rainbow (3.0.0)
125
126
  rake (12.3.2)
126
- rubocop (0.62.0)
127
+ rubocop (0.65.0)
127
128
  jaro_winkler (~> 1.5.1)
128
129
  parallel (~> 1.10)
129
130
  parser (>= 2.5, != 2.5.1.1)
130
131
  powerpack (~> 0.1)
132
+ psych (>= 3.1.0)
131
133
  rainbow (>= 2.2.2, < 4.0)
132
134
  ruby-progressbar (~> 1.7)
133
135
  unicode-display_width (~> 1.4.0)
@@ -160,14 +162,14 @@ PLATFORMS
160
162
  ruby
161
163
 
162
164
  DEPENDENCIES
163
- bundler (~> 1.16)
165
+ bundler (~> 2.0)
164
166
  bundler-audit (~> 0.6)
165
167
  minitest (~> 5.11)
166
168
  paperweight!
167
169
  rake (~> 12.3)
168
- rubocop (~> 0.62)
170
+ rubocop (~> 0.65)
169
171
  simplecov (~> 0.16)
170
- sqlite3 (~> 1.3)
172
+ sqlite3 (= 1.3.13)
171
173
 
172
174
  BUNDLED WITH
173
- 1.17.2
175
+ 2.0.1
data/README.md CHANGED
@@ -65,12 +65,14 @@ You can provide additional configuration options through the `Paperweight.config
65
65
 
66
66
  ```ruby
67
67
  Paperweight.configure do |config|
68
+ config.download_attempts = 10
68
69
  config.max_size = 20 * 1024 * 1024
69
70
  end
70
71
  ```
71
72
 
72
73
  The current configuration options include:
73
74
 
75
+ * `download_attempts` - defaults to 1
74
76
  * `max_size` - defaults to 10 MB
75
77
 
76
78
  ## Development
@@ -4,9 +4,10 @@
4
4
  module Paperweight
5
5
  # Allows configuring certain attributes about how to process attachments.
6
6
  class Configuration
7
- attr_accessor :max_size
7
+ attr_accessor :download_attempts, :max_size
8
8
 
9
9
  def initialize
10
+ @download_attempts = 1
10
11
  @max_size = 10 * 1024 * 1024
11
12
  end
12
13
  end
@@ -6,6 +6,7 @@ module Paperweight
6
6
  Error = Class.new(StandardError)
7
7
 
8
8
  DOWNLOAD_ERRORS = [
9
+ Errno::ECONNREFUSED, # invalid url
9
10
  SocketError, # domain not found
10
11
  OpenURI::HTTPError, # response status 4xx or 5xx
11
12
  RuntimeError, # redirection errors (e.g. redirection loop)
@@ -7,6 +7,12 @@ module Paperweight
7
7
 
8
8
  discard_on ActiveJob::DeserializationError
9
9
 
10
+ rescue_from Download::Error do |error|
11
+ raise error if executions >= Paperweight.config.download_attempts
12
+
13
+ retry_job(wait: (executions**4) + 2)
14
+ end
15
+
10
16
  def perform(model, name)
11
17
  name = AttachmentName.new(name)
12
18
  image_url = model.public_send(name.processing)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paperweight
4
- VERSION = '1.1.0'
4
+ VERSION = '1.2.0'
5
5
  end
@@ -24,11 +24,11 @@ Gem::Specification.new do |spec|
24
24
  spec.add_dependency 'paperclip', '>= 5'
25
25
  spec.add_dependency 'rails', '>= 5'
26
26
 
27
- spec.add_development_dependency 'bundler', '~> 1.16'
27
+ spec.add_development_dependency 'bundler', '~> 2.0'
28
28
  spec.add_development_dependency 'bundler-audit', '~> 0.6'
29
29
  spec.add_development_dependency 'minitest', '~> 5.11'
30
30
  spec.add_development_dependency 'rake', '~> 12.3'
31
- spec.add_development_dependency 'rubocop', '~> 0.62'
31
+ spec.add_development_dependency 'rubocop', '~> 0.65'
32
32
  spec.add_development_dependency 'simplecov', '~> 0.16'
33
- spec.add_development_dependency 'sqlite3', '~> 1.3'
33
+ spec.add_development_dependency 'sqlite3', '= 1.3.13'
34
34
  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.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Deisz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-08 00:00:00.000000000 Z
11
+ date: 2019-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paperclip
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.16'
47
+ version: '2.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.16'
54
+ version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler-audit
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0.62'
103
+ version: '0.65'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0.62'
110
+ version: '0.65'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: simplecov
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -126,16 +126,16 @@ dependencies:
126
126
  name: sqlite3
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: '1.3'
131
+ version: 1.3.13
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: '1.3'
138
+ version: 1.3.13
139
139
  description:
140
140
  email:
141
141
  - kevin.deisz@gmail.com
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  - !ruby/object:Gem::Version
182
182
  version: '0'
183
183
  requirements: []
184
- rubygems_version: 3.0.1
184
+ rubygems_version: 3.0.2
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: An opinionated Paperclip.