card-mod-carrierwave 0.12.0 → 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: ae6f61fadc7f61e0ae8eff9484b223c266af78bd06c8d2d54edbcd4bbb337b43
4
- data.tar.gz: 818a78abc7e061f4bd859f4f011a74c5934a55acf81795b83b893b0885192d33
3
+ metadata.gz: 4ac2c925e781cea75ee15877146a557b3f2a8ea1fdd620ed6af05b0fe076ee36
4
+ data.tar.gz: 91e44c37320cb9b5e9111a7dfe6fc4fb62aa626fb03ffcd77ae3d6cc9e1f6080
5
5
  SHA512:
6
- metadata.gz: 9049446ded4dc6b6f24c7b52675b41ffd1f3ca83c9d5f9c5eb7b0fbee2c8171f03971d2a80369c238ebf6023a1688421e35cb976690463706c36dd044439b4cb
7
- data.tar.gz: e9d38774361ce5f10eeaed09d2973c660afe27defb196fc31e08e610fac62048994e39414f2b256bca3e83c217aee6679d7ca37d44c2ff52f75df19d9524ae1d
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/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
@@ -39,7 +39,7 @@ def files_base_dir_configuration_error
39
39
  "missing directory for file cache (default is `files` in deck root)"
40
40
  end
41
41
 
42
- # used in the indentifier
42
+ # used in the identifier
43
43
  def file_dir
44
44
  if coded?
45
45
  ":#{codename}"
@@ -1,4 +1,4 @@
1
- attr_writer :bucket, :storage_type
1
+ attr_writer :bucket, :new_storage_type
2
2
 
3
3
  event :storage_type_change, :store, on: :update, when: :storage_type_changed? do
4
4
  # carrierwave stores file if @cache_id is not nil
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.12.0
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-07-05 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.102.0
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.102.0
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.12.0
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.12.0
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.12.0
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.12.0
84
+ version: 0.13.3
85
85
  description: ''
86
86
  email:
87
87
  - info@decko.org
@@ -89,11 +89,13 @@ executables: []
89
89
  extensions: []
90
90
  extra_rdoc_files: []
91
91
  files:
92
- - config/core_initializers/carrierwave.rb
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
96
97
  - lib/carrier_wave/image_card_uploader.rb
98
+ - locales/en.yml
97
99
  - set/abstract/attachment.rb
98
100
  - set/abstract/attachment/cloud.rb
99
101
  - set/abstract/attachment/coded.rb
@@ -138,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
140
  - !ruby/object:Gem::Version
139
141
  version: '0'
140
142
  requirements: []
141
- rubygems_version: 3.2.15
143
+ rubygems_version: 3.1.6
142
144
  signing_key:
143
145
  specification_version: 4
144
146
  summary: File and Image handling