activestorage 7.0.8.1 → 7.2.2.1

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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +49 -360
  3. data/MIT-LICENSE +1 -1
  4. data/README.md +6 -6
  5. data/app/assets/javascripts/activestorage.esm.js +11 -7
  6. data/app/assets/javascripts/activestorage.js +12 -6
  7. data/app/controllers/active_storage/disk_controller.rb +4 -2
  8. data/app/controllers/active_storage/representations/proxy_controller.rb +1 -1
  9. data/app/controllers/concerns/active_storage/file_server.rb +4 -1
  10. data/app/javascript/activestorage/blob_record.js +4 -1
  11. data/app/javascript/activestorage/direct_upload.js +3 -2
  12. data/app/javascript/activestorage/index.js +3 -1
  13. data/app/javascript/activestorage/ujs.js +3 -3
  14. data/app/jobs/active_storage/analyze_job.rb +1 -1
  15. data/app/jobs/active_storage/mirror_job.rb +1 -1
  16. data/app/jobs/active_storage/preview_image_job.rb +16 -0
  17. data/app/jobs/active_storage/purge_job.rb +1 -1
  18. data/app/jobs/active_storage/transform_job.rb +12 -0
  19. data/app/models/active_storage/attachment.rb +101 -16
  20. data/app/models/active_storage/blob/analyzable.rb +4 -3
  21. data/app/models/active_storage/blob/identifiable.rb +1 -0
  22. data/app/models/active_storage/blob/representable.rb +15 -3
  23. data/app/models/active_storage/blob/servable.rb +22 -0
  24. data/app/models/active_storage/blob.rb +59 -72
  25. data/app/models/active_storage/current.rb +0 -10
  26. data/app/models/active_storage/filename.rb +2 -4
  27. data/app/models/active_storage/named_variant.rb +21 -0
  28. data/app/models/active_storage/preview.rb +23 -8
  29. data/app/models/active_storage/variant.rb +10 -7
  30. data/app/models/active_storage/variant_record.rb +0 -2
  31. data/app/models/active_storage/variant_with_record.rb +21 -7
  32. data/app/models/active_storage/variation.rb +5 -3
  33. data/config/routes.rb +6 -4
  34. data/db/migrate/20170806125915_create_active_storage_tables.rb +2 -2
  35. data/lib/active_storage/analyzer/audio_analyzer.rb +16 -4
  36. data/lib/active_storage/analyzer/image_analyzer/vips.rb +5 -9
  37. data/lib/active_storage/analyzer/image_analyzer.rb +2 -0
  38. data/lib/active_storage/analyzer/video_analyzer.rb +9 -3
  39. data/lib/active_storage/analyzer.rb +2 -0
  40. data/lib/active_storage/attached/changes/create_many.rb +8 -3
  41. data/lib/active_storage/attached/changes/create_one.rb +51 -4
  42. data/lib/active_storage/attached/changes/create_one_of_many.rb +5 -1
  43. data/lib/active_storage/attached/many.rb +5 -4
  44. data/lib/active_storage/attached/model.rb +96 -60
  45. data/lib/active_storage/attached/one.rb +5 -4
  46. data/lib/active_storage/attached.rb +2 -0
  47. data/lib/active_storage/deprecator.rb +7 -0
  48. data/lib/active_storage/engine.rb +7 -9
  49. data/lib/active_storage/fixture_set.rb +7 -1
  50. data/lib/active_storage/gem_version.rb +3 -3
  51. data/lib/active_storage/log_subscriber.rb +12 -0
  52. data/lib/active_storage/previewer/mupdf_previewer.rb +6 -2
  53. data/lib/active_storage/previewer/poppler_pdf_previewer.rb +6 -2
  54. data/lib/active_storage/previewer/video_previewer.rb +1 -1
  55. data/lib/active_storage/previewer.rb +8 -1
  56. data/lib/active_storage/reflection.rb +3 -3
  57. data/lib/active_storage/service/azure_storage_service.rb +2 -0
  58. data/lib/active_storage/service/disk_service.rb +2 -0
  59. data/lib/active_storage/service/gcs_service.rb +11 -20
  60. data/lib/active_storage/service/mirror_service.rb +10 -5
  61. data/lib/active_storage/service/s3_service.rb +2 -0
  62. data/lib/active_storage/service.rb +4 -2
  63. data/lib/active_storage/transformers/image_processing_transformer.rb +1 -1
  64. data/lib/active_storage/transformers/transformer.rb +2 -0
  65. data/lib/active_storage/version.rb +1 -1
  66. data/lib/active_storage.rb +5 -4
  67. metadata +23 -32
@@ -6,6 +6,8 @@ require "action_dispatch"
6
6
  require "action_dispatch/http/content_disposition"
7
7
 
8
8
  module ActiveStorage
9
+ # = Active Storage \Service
10
+ #
9
11
  # Abstract class serving as an interface for concrete services.
10
12
  #
11
13
  # The available services are:
@@ -16,7 +18,7 @@ module ActiveStorage
16
18
  # * +AzureStorage+, to manage attachments through Microsoft Azure Storage.
17
19
  # * +Mirror+, to be able to use several services to manage attachments.
18
20
  #
19
- # Inside a Rails application, you can set-up your services through the
21
+ # Inside a \Rails application, you can set-up your services through the
20
22
  # generated <tt>config/storage.yml</tt> file and reference one
21
23
  # of the aforementioned constant under the +service+ key. For example:
22
24
  #
@@ -31,7 +33,7 @@ module ActiveStorage
31
33
  #
32
34
  # config.active_storage.service = :local
33
35
  #
34
- # If you are using Active Storage outside of a Ruby on Rails application, you
36
+ # If you are using Active Storage outside of a Ruby on \Rails application, you
35
37
  # can configure the service to use like this:
36
38
  #
37
39
  # ActiveStorage::Blob.service = ActiveStorage::Service.configure(
@@ -5,7 +5,7 @@ begin
5
5
  rescue LoadError
6
6
  raise LoadError, <<~ERROR.squish
7
7
  Generating image variants require the image_processing gem.
8
- Please add `gem 'image_processing', '~> 1.2'` to your Gemfile.
8
+ Please add `gem "image_processing", "~> 1.2"` to your Gemfile.
9
9
  ERROR
10
10
  end
11
11
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  module ActiveStorage
4
4
  module Transformers
5
+ # = Active Storage \Transformers \Transformer
6
+ #
5
7
  # A Transformer applies a set of transformations to an image.
6
8
  #
7
9
  # The following concrete subclasses are included in Active Storage:
@@ -3,7 +3,7 @@
3
3
  require_relative "gem_version"
4
4
 
5
5
  module ActiveStorage
6
- # Returns the currently loaded version of Active Storage as a <tt>Gem::Version</tt>.
6
+ # Returns the currently loaded version of Active Storage as a +Gem::Version+.
7
7
  def self.version
8
8
  gem_version
9
9
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # Copyright (c) 2017-2022 David Heinemeier Hansson, Basecamp
4
+ # Copyright (c) David Heinemeier Hansson, 37signals LLC
5
5
  #
6
6
  # Permission is hereby granted, free of charge, to any person obtaining
7
7
  # a copy of this software and associated documentation files (the
@@ -29,10 +29,13 @@ require "active_support/rails"
29
29
  require "active_support/core_ext/numeric/time"
30
30
 
31
31
  require "active_storage/version"
32
+ require "active_storage/deprecator"
32
33
  require "active_storage/errors"
33
34
 
34
35
  require "marcel"
35
36
 
37
+ # :markup: markdown
38
+ # :include: ../README.md
36
39
  module ActiveStorage
37
40
  extend ActiveSupport::Autoload
38
41
 
@@ -351,19 +354,17 @@ module ActiveStorage
351
354
  mattr_accessor :unsupported_image_processing_arguments
352
355
 
353
356
  mattr_accessor :service_urls_expire_in, default: 5.minutes
357
+ mattr_accessor :touch_attachment_records, default: true
354
358
  mattr_accessor :urls_expire_in
355
359
 
356
360
  mattr_accessor :routes_prefix, default: "/rails/active_storage"
357
361
  mattr_accessor :draw_routes, default: true
358
362
  mattr_accessor :resolve_model_to_route, default: :rails_storage_redirect
359
363
 
360
- mattr_accessor :replace_on_assign_to_many, default: false
361
364
  mattr_accessor :track_variants, default: false
362
365
 
363
366
  mattr_accessor :video_preview_arguments, default: "-y -vframes 1 -f image2"
364
367
 
365
- mattr_accessor :silence_invalid_content_types_warning, default: false
366
-
367
368
  module Transformers
368
369
  extend ActiveSupport::Autoload
369
370
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activestorage
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.8.1
4
+ version: 7.2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-21 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 7.0.8.1
19
+ version: 7.2.2.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 7.0.8.1
26
+ version: 7.2.2.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 7.0.8.1
33
+ version: 7.2.2.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 7.0.8.1
40
+ version: 7.2.2.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activejob
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 7.0.8.1
47
+ version: 7.2.2.1
48
48
  type: :runtime
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: 7.0.8.1
54
+ version: 7.2.2.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: activerecord
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 7.0.8.1
61
+ version: 7.2.2.1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 7.0.8.1
68
+ version: 7.2.2.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: marcel
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.0'
83
- - !ruby/object:Gem::Dependency
84
- name: mini_mime
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: 1.1.0
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: 1.1.0
97
83
  description: Attach cloud and local files in Rails applications.
98
84
  email: david@loudthinking.com
99
85
  executables: []
@@ -130,14 +116,18 @@ files:
130
116
  - app/jobs/active_storage/analyze_job.rb
131
117
  - app/jobs/active_storage/base_job.rb
132
118
  - app/jobs/active_storage/mirror_job.rb
119
+ - app/jobs/active_storage/preview_image_job.rb
133
120
  - app/jobs/active_storage/purge_job.rb
121
+ - app/jobs/active_storage/transform_job.rb
134
122
  - app/models/active_storage/attachment.rb
135
123
  - app/models/active_storage/blob.rb
136
124
  - app/models/active_storage/blob/analyzable.rb
137
125
  - app/models/active_storage/blob/identifiable.rb
138
126
  - app/models/active_storage/blob/representable.rb
127
+ - app/models/active_storage/blob/servable.rb
139
128
  - app/models/active_storage/current.rb
140
129
  - app/models/active_storage/filename.rb
130
+ - app/models/active_storage/named_variant.rb
141
131
  - app/models/active_storage/preview.rb
142
132
  - app/models/active_storage/record.rb
143
133
  - app/models/active_storage/variant.rb
@@ -171,6 +161,7 @@ files:
171
161
  - lib/active_storage/attached/many.rb
172
162
  - lib/active_storage/attached/model.rb
173
163
  - lib/active_storage/attached/one.rb
164
+ - lib/active_storage/deprecator.rb
174
165
  - lib/active_storage/downloader.rb
175
166
  - lib/active_storage/engine.rb
176
167
  - lib/active_storage/errors.rb
@@ -199,12 +190,12 @@ licenses:
199
190
  - MIT
200
191
  metadata:
201
192
  bug_tracker_uri: https://github.com/rails/rails/issues
202
- changelog_uri: https://github.com/rails/rails/blob/v7.0.8.1/activestorage/CHANGELOG.md
203
- documentation_uri: https://api.rubyonrails.org/v7.0.8.1/
193
+ changelog_uri: https://github.com/rails/rails/blob/v7.2.2.1/activestorage/CHANGELOG.md
194
+ documentation_uri: https://api.rubyonrails.org/v7.2.2.1/
204
195
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
205
- source_code_uri: https://github.com/rails/rails/tree/v7.0.8.1/activestorage
196
+ source_code_uri: https://github.com/rails/rails/tree/v7.2.2.1/activestorage
206
197
  rubygems_mfa_required: 'true'
207
- post_install_message:
198
+ post_install_message:
208
199
  rdoc_options: []
209
200
  require_paths:
210
201
  - lib
@@ -212,15 +203,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
212
203
  requirements:
213
204
  - - ">="
214
205
  - !ruby/object:Gem::Version
215
- version: 2.7.0
206
+ version: 3.1.0
216
207
  required_rubygems_version: !ruby/object:Gem::Requirement
217
208
  requirements:
218
209
  - - ">="
219
210
  - !ruby/object:Gem::Version
220
211
  version: '0'
221
212
  requirements: []
222
- rubygems_version: 3.2.22
223
- signing_key:
213
+ rubygems_version: 3.5.22
214
+ signing_key:
224
215
  specification_version: 4
225
216
  summary: Local and cloud file storage framework.
226
217
  test_files: []