card-mod-carrierwave 0.13.0 → 0.13.4

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: 8c8f20cc9a7b83ae10932e555f5826a53de1aa4732775b5ccd5625e44efadff1
4
- data.tar.gz: 8d657cbdc291433776002029114f1408383848b4410367b1bea1c58a12e65fb6
3
+ metadata.gz: e7304e98064495ce7fd04793d2c5ba725a3d03badb878d8b7fb5a413cf28a71c
4
+ data.tar.gz: ebcc5e035dea1a675d2372a2e062d8bf5fade776e65cd867721a251be863ff3d
5
5
  SHA512:
6
- metadata.gz: f949fbdd2be70ff51e834b23b86575fb0bf4bd8363316b23a8c9aa93b7c605913e9e7860d46402e850e6629459db8fedda22510cc5631f4b90eccd4911405d40
7
- data.tar.gz: 8753dd281fdbd9c0c013a27d1f4281a53c806617f33bda390f00264ec8537c9104f128af16ffe4549685665818e1762c7af596efb9bcd71098f4b8e0a142a8f7
6
+ metadata.gz: 2c47c08a8a7f0266be5138934258442158374fb4b7b6604d677df3294c33f2bb2a3d6c9b375224f39f67e8b478448bcca9e42165312e5dbb1b59a68150106963
7
+ data.tar.gz: 3d5dc7e994acb72df1a2517328f7232babfa0271da38a4ed552a8f5a349ed53cc6dc1f9ee8c94becd03ce39f111c59c671ef0829b60ff593a694df930cbdcc91
@@ -0,0 +1,5 @@
1
+ require "carrierwave"
2
+
3
+ ActiveSupport.on_load :card do
4
+ Card.extend CarrierWave::Mount
5
+ end
@@ -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/locales/en.yml ADDED
@@ -0,0 +1,13 @@
1
+ en:
2
+ carrierwave_add_item: Add %{attachment_name}...
3
+ carrierwave_codename_needed_for_storage: codename needed for storage type coded
4
+ carrierwave_delete: Delete
5
+ carrierwave_download: Download %{title}
6
+ carrierwave_error_invalid_storage_type: "%{type} is not a valid file storage option"
7
+ carrierwave_file_error: File Error
8
+ carrierwave_is_missing: is missing
9
+ carrierwave_mod_argument_needed_to_save: mod argument needed to save card as coded
10
+ carrierwave_moving_files_is_not_supported: moving files from cloud elsewhere is not supported
11
+ carrierwave_replace_item: Replace %{attachment_name}...
12
+ carrierwave_unknown_storage_type: unknown storage type %{new_storage_type}
13
+ carrierwave_url_is_missing: url is missing
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.0
4
+ version: 0.13.4
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.0
21
+ version: 1.103.4
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.0
28
+ version: 1.103.4
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.0
63
+ version: 0.13.4
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.0
70
+ version: 0.13.4
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.0
77
+ version: 0.13.4
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.0
84
+ version: 0.13.4
85
85
  description: ''
86
86
  email:
87
87
  - info@decko.org
@@ -89,10 +89,13 @@ executables: []
89
89
  extensions: []
90
90
  extra_rdoc_files: []
91
91
  files:
92
+ - init/early/carrierwave.rb
93
+ - init/early/mini_magick.rb
92
94
  - lib/carrier_wave/card_mount.rb
93
95
  - lib/carrier_wave/file_card_uploader.rb
94
96
  - lib/carrier_wave/file_card_uploader/path.rb
95
97
  - lib/carrier_wave/image_card_uploader.rb
98
+ - locales/en.yml
96
99
  - set/abstract/attachment.rb
97
100
  - set/abstract/attachment/cloud.rb
98
101
  - set/abstract/attachment/coded.rb