card-mod-carrierwave 0.13.2 → 0.13.3

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: 07c72b8dff10b57cf9069cf660f32d736cf67df866ea979c6518c46b1285afcb
4
- data.tar.gz: f4442c5099e32a4fbfae63a44fe9e9a172ae11b26509f7d0a56a21a5f1f44a42
3
+ metadata.gz: 4ac2c925e781cea75ee15877146a557b3f2a8ea1fdd620ed6af05b0fe076ee36
4
+ data.tar.gz: 91e44c37320cb9b5e9111a7dfe6fc4fb62aa626fb03ffcd77ae3d6cc9e1f6080
5
5
  SHA512:
6
- metadata.gz: 38e990a4f6232af77d5204a1f4799b08f67e7d0948b5c64211a0eeaeb6900c1b431abac5e519f8d5e567f98c1c7dda174fddc037c6b67eb683f57708eaa541cd
7
- data.tar.gz: b4064e332a60251c6bcce1d39a7cbbde7152f7e4109de401fbe643cfcbff4bff0561dcaa53da6c30356299a56b73eccaa071fcdfb6fd40e980a212a0e6be5b4d
6
+ metadata.gz: 71e94c5ddadbbfde27a7d6cd4b275ec5efcdae771efec9a55b02a5242f965e5c6a5c6bd3770cef9da6f7f8fd1b748ac750a27f5126bc38e6fba2a15b891416f4
7
+ data.tar.gz: e98f8c34631c7405af3a499844ddb8c8d9d294dddc8a8d66f0eefea839ec599280ee39bcd23f5260c79c644b7bd7d4837d7eb9d90cc1fc85aa67768defcbe8af
@@ -0,0 +1,4 @@
1
+ require "mini_magick"
2
+
3
+ # This call fails if ImageMagick isn't installed (common installation problem)
4
+ MiniMagick.cli
@@ -29,8 +29,7 @@ module CarrierWave
29
29
  remove_#{column}!
30
30
  end
31
31
 
32
- event :mark_remove_#{column}_false_event, :finalize,
33
- on: :update do
32
+ event :mark_remove_#{column}_false_event, :finalize, on: :update do
34
33
  mark_remove_#{column}_false
35
34
  end
36
35
 
@@ -116,21 +115,17 @@ module CarrierWave
116
115
  @#{column}_changed
117
116
  end
118
117
 
119
- def serializable_hash(options=nil)
120
- hash = {}
118
+ def serializable_hash(opts=nil)
119
+ except = opts&.dig(:except) && Array.wrap(opts[:except]).map(&:to_s)
120
+ only = opts&.dig(:only) && Array.wrap(opts[:only]).map(&:to_s)
121
121
 
122
- except = options && options[:except] &&
123
- Array.wrap(options[:except]).map(&:to_s)
124
- only = options && options[:only] &&
125
- Array.wrap(options[:only]).map(&:to_s)
126
-
127
- self.class.uploaders.each do |column, uploader|
128
- if (!only && !except) || (only && only.include?(column.to_s)) ||
122
+ self.class.uploaders.each_with_object(super(opts)) do |(column, uploader), hash|
123
+ if (!only && !except) ||
124
+ (only && only.include?(column.to_s)) ||
129
125
  (!only && except && !except.include?(column.to_s))
130
126
  hash[column.to_s] = _mounter(column).uploader.serializable_hash
131
127
  end
132
128
  end
133
- super(options).merge(hash)
134
129
  end
135
130
  RUBY
136
131
  end
data/set/self/admin.rb CHANGED
@@ -1,23 +1,22 @@
1
- add_to_basket(
2
- :tasks,
3
- name: :update_file_storage_locations,
4
- execute_policy: -> { Card.update_all_storage_locations },
5
- stats: {
6
- title: "cards with attachment",
7
- count: -> { Card.count_cards_with_attachment }
8
- # link_text: "update storage locations",
9
- # task: "update_file_storage_locations"
1
+ basket[:tasks] += [
2
+ {
3
+ name: :update_file_storage_locations,
4
+ execute_policy: -> { Card.update_all_storage_locations },
5
+ stats: {
6
+ title: "cards with attachment",
7
+ count: -> { Card.count_cards_with_attachment }
8
+ # link_text: "update storage locations",
9
+ # task: "update_file_storage_locations"
10
+ }
11
+ },
12
+ {
13
+ name: :delete_upload_tmp_files,
14
+ execute_policy: -> { Card.delete_tmp_files_of_cached_uploads },
15
+ stats: {
16
+ title: "tmp files of canceled uploads",
17
+ count: -> { ::Card.draft_actions_with_attachment },
18
+ link_text: "delete tmp files",
19
+ task: "delete_tmp_files_of_cached_uploads"
20
+ }
10
21
  }
11
- )
12
-
13
- add_to_basket(
14
- :tasks,
15
- name: :delete_upload_tmp_files,
16
- execute_policy: -> { Card.delete_tmp_files_of_cached_uploads },
17
- stats: {
18
- title: "tmp files of canceled uploads",
19
- count: -> { ::Card.draft_actions_with_attachment },
20
- link_text: "delete tmp files",
21
- task: "delete_tmp_files_of_cached_uploads"
22
- }
23
- )
22
+ ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-carrierwave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.2
4
+ version: 0.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-08-06 00:00:00.000000000 Z
13
+ date: 2021-09-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.103.2
21
+ version: 1.103.3
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.103.2
28
+ version: 1.103.3
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: carrierwave
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -60,28 +60,28 @@ dependencies:
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.13.2
63
+ version: 0.13.3
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.13.2
70
+ version: 0.13.3
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: card-mod-permissions
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.13.2
77
+ version: 0.13.3
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - '='
83
83
  - !ruby/object:Gem::Version
84
- version: 0.13.2
84
+ version: 0.13.3
85
85
  description: ''
86
86
  email:
87
87
  - info@decko.org
@@ -90,6 +90,7 @@ extensions: []
90
90
  extra_rdoc_files: []
91
91
  files:
92
92
  - init/early/carrierwave.rb
93
+ - init/early/mini_magick.rb
93
94
  - lib/carrier_wave/card_mount.rb
94
95
  - lib/carrier_wave/file_card_uploader.rb
95
96
  - lib/carrier_wave/file_card_uploader/path.rb