kt-paperclip 7.2.2 → 8.0.0
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.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +24 -56
- data/lib/generators/paperclip/paperclip_generator.rb +3 -1
- data/lib/kt-paperclip.rb +2 -0
- data/lib/paperclip/attachment.rb +49 -30
- data/lib/paperclip/attachment_registry.rb +2 -0
- data/lib/paperclip/callbacks.rb +7 -4
- data/lib/paperclip/commands/imagemagick/geometry_parser.rb +63 -0
- data/lib/paperclip/commands/imagemagick/version_detector.rb +41 -0
- data/lib/paperclip/commands/imagemagick.rb +44 -0
- data/lib/paperclip/commands/runner.rb +38 -0
- data/lib/paperclip/commands/unix_file.rb +28 -0
- data/lib/paperclip/content_type_detector.rb +31 -32
- data/lib/paperclip/errors.rb +2 -0
- data/lib/paperclip/file_command_content_type_detector.rb +11 -12
- data/lib/paperclip/filename_cleaner.rb +2 -0
- data/lib/paperclip/geometry.rb +22 -7
- data/lib/paperclip/geometry_detector_factory.rb +11 -31
- data/lib/paperclip/geometry_parser_factory.rb +13 -17
- data/lib/paperclip/glue.rb +2 -0
- data/lib/paperclip/has_attached_file.rb +2 -0
- data/lib/paperclip/helpers.rb +5 -25
- data/lib/paperclip/interpolations/plural_cache.rb +2 -0
- data/lib/paperclip/interpolations.rb +2 -0
- data/lib/paperclip/io_adapters/abstract_adapter.rb +3 -1
- data/lib/paperclip/io_adapters/attachment_adapter.rb +11 -0
- data/lib/paperclip/io_adapters/data_uri_adapter.rb +2 -0
- data/lib/paperclip/io_adapters/empty_string_adapter.rb +2 -0
- data/lib/paperclip/io_adapters/file_adapter.rb +2 -0
- data/lib/paperclip/io_adapters/http_url_proxy_adapter.rb +2 -0
- data/lib/paperclip/io_adapters/identity_adapter.rb +2 -0
- data/lib/paperclip/io_adapters/nil_adapter.rb +2 -0
- data/lib/paperclip/io_adapters/registry.rb +2 -0
- data/lib/paperclip/io_adapters/stringio_adapter.rb +2 -0
- data/lib/paperclip/io_adapters/uploaded_file_adapter.rb +2 -0
- data/lib/paperclip/io_adapters/uri_adapter.rb +5 -13
- data/lib/paperclip/locales/fr.yml +18 -0
- data/lib/paperclip/locales/gd.yml +1 -1
- data/lib/paperclip/logger.rb +2 -0
- data/lib/paperclip/matchers/have_attached_file_matcher.rb +2 -0
- data/lib/paperclip/matchers/validate_attachment_content_type_matcher.rb +5 -3
- data/lib/paperclip/matchers/validate_attachment_presence_matcher.rb +2 -0
- data/lib/paperclip/matchers/validate_attachment_size_matcher.rb +2 -0
- data/lib/paperclip/matchers.rb +2 -0
- data/lib/paperclip/media_type_spoof_detector.rb +3 -10
- data/lib/paperclip/missing_attachment_styles.rb +2 -0
- data/lib/paperclip/processor.rb +6 -19
- data/lib/paperclip/processor_helpers.rb +2 -0
- data/lib/paperclip/rails_environment.rb +2 -0
- data/lib/paperclip/railtie.rb +2 -0
- data/lib/paperclip/schema.rb +6 -4
- data/lib/paperclip/storage/filesystem.rb +2 -0
- data/lib/paperclip/storage/fog.rb +13 -4
- data/lib/paperclip/storage/s3.rb +27 -5
- data/lib/paperclip/storage.rb +2 -0
- data/lib/paperclip/style.rb +2 -0
- data/lib/paperclip/tempfile.rb +2 -0
- data/lib/paperclip/tempfile_factory.rb +2 -0
- data/lib/paperclip/thumbnail.rb +9 -10
- data/lib/paperclip/url_generator.rb +2 -0
- data/lib/paperclip/validators/attachment_content_type_validator.rb +2 -0
- data/lib/paperclip/validators/attachment_file_name_validator.rb +2 -0
- data/lib/paperclip/validators/attachment_file_type_ignorance_validator.rb +2 -0
- data/lib/paperclip/validators/attachment_presence_validator.rb +2 -0
- data/lib/paperclip/validators/attachment_size_validator.rb +2 -0
- data/lib/paperclip/validators/media_type_spoof_detection_validator.rb +2 -0
- data/lib/paperclip/validators.rb +2 -0
- data/lib/paperclip/version.rb +3 -1
- data/lib/paperclip.rb +25 -4
- data/lib/tasks/paperclip.rake +9 -4
- data/shoulda_macros/paperclip.rb +2 -0
- metadata +19 -538
- data/.codeclimate.yml +0 -17
- data/.github/FUNDING.yml +0 -3
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- data/.github/ISSUE_TEMPLATE/custom.md +0 -10
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- data/.gitignore +0 -19
- data/.hound.yml +0 -3
- data/.rubocop.yml +0 -1061
- data/.travis.yml +0 -45
- data/Appraisals +0 -30
- data/CONTRIBUTING.md +0 -85
- data/Gemfile +0 -19
- data/NEWS +0 -554
- data/RELEASING.md +0 -17
- data/Rakefile +0 -52
- data/UPGRADING +0 -17
- data/features/basic_integration.feature +0 -85
- data/features/migration.feature +0 -29
- data/features/rake_tasks.feature +0 -62
- data/features/step_definitions/attachment_steps.rb +0 -120
- data/features/step_definitions/html_steps.rb +0 -15
- data/features/step_definitions/rails_steps.rb +0 -257
- data/features/step_definitions/s3_steps.rb +0 -14
- data/features/step_definitions/web_steps.rb +0 -106
- data/features/support/env.rb +0 -12
- data/features/support/fakeweb.rb +0 -11
- data/features/support/file_helpers.rb +0 -34
- data/features/support/fixtures/boot_config.txt +0 -15
- data/features/support/fixtures/gemfile.txt +0 -5
- data/features/support/fixtures/preinitializer.txt +0 -20
- data/features/support/paths.rb +0 -28
- data/features/support/rails.rb +0 -39
- data/features/support/selectors.rb +0 -19
- data/gemfiles/4.2.gemfile +0 -20
- data/gemfiles/5.0.gemfile +0 -20
- data/gemfiles/5.1.gemfile +0 -20
- data/gemfiles/5.2.gemfile +0 -20
- data/gemfiles/6.0.gemfile +0 -20
- data/gemfiles/6.1.gemfile +0 -21
- data/gemfiles/7.0.gemfile +0 -21
- data/paperclip.gemspec +0 -50
- data/spec/database.yml +0 -4
- data/spec/paperclip/attachment_definitions_spec.rb +0 -13
- data/spec/paperclip/attachment_processing_spec.rb +0 -79
- data/spec/paperclip/attachment_registry_spec.rb +0 -158
- data/spec/paperclip/attachment_spec.rb +0 -1590
- data/spec/paperclip/content_type_detector_spec.rb +0 -54
- data/spec/paperclip/file_command_content_type_detector_spec.rb +0 -40
- data/spec/paperclip/filename_cleaner_spec.rb +0 -13
- data/spec/paperclip/geometry_detector_spec.rb +0 -47
- data/spec/paperclip/geometry_parser_spec.rb +0 -73
- data/spec/paperclip/geometry_spec.rb +0 -267
- data/spec/paperclip/glue_spec.rb +0 -63
- data/spec/paperclip/has_attached_file_spec.rb +0 -78
- data/spec/paperclip/integration_spec.rb +0 -702
- data/spec/paperclip/interpolations_spec.rb +0 -270
- data/spec/paperclip/io_adapters/abstract_adapter_spec.rb +0 -160
- data/spec/paperclip/io_adapters/attachment_adapter_spec.rb +0 -140
- data/spec/paperclip/io_adapters/data_uri_adapter_spec.rb +0 -88
- data/spec/paperclip/io_adapters/empty_string_adapter_spec.rb +0 -17
- data/spec/paperclip/io_adapters/file_adapter_spec.rb +0 -131
- data/spec/paperclip/io_adapters/http_url_proxy_adapter_spec.rb +0 -142
- data/spec/paperclip/io_adapters/identity_adapter_spec.rb +0 -8
- data/spec/paperclip/io_adapters/nil_adapter_spec.rb +0 -25
- data/spec/paperclip/io_adapters/registry_spec.rb +0 -35
- data/spec/paperclip/io_adapters/stringio_adapter_spec.rb +0 -64
- data/spec/paperclip/io_adapters/uploaded_file_adapter_spec.rb +0 -146
- data/spec/paperclip/io_adapters/uri_adapter_spec.rb +0 -231
- data/spec/paperclip/matchers/have_attached_file_matcher_spec.rb +0 -19
- data/spec/paperclip/matchers/validate_attachment_content_type_matcher_spec.rb +0 -108
- data/spec/paperclip/matchers/validate_attachment_presence_matcher_spec.rb +0 -69
- data/spec/paperclip/matchers/validate_attachment_size_matcher_spec.rb +0 -88
- data/spec/paperclip/media_type_spoof_detector_spec.rb +0 -126
- data/spec/paperclip/meta_class_spec.rb +0 -30
- data/spec/paperclip/paperclip_missing_attachment_styles_spec.rb +0 -88
- data/spec/paperclip/paperclip_spec.rb +0 -196
- data/spec/paperclip/plural_cache_spec.rb +0 -37
- data/spec/paperclip/processor_helpers_spec.rb +0 -57
- data/spec/paperclip/processor_spec.rb +0 -26
- data/spec/paperclip/rails_environment_spec.rb +0 -30
- data/spec/paperclip/rake_spec.rb +0 -103
- data/spec/paperclip/schema_spec.rb +0 -252
- data/spec/paperclip/storage/filesystem_spec.rb +0 -102
- data/spec/paperclip/storage/fog_spec.rb +0 -606
- data/spec/paperclip/storage/s3_live_spec.rb +0 -188
- data/spec/paperclip/storage/s3_spec.rb +0 -1878
- data/spec/paperclip/style_spec.rb +0 -251
- data/spec/paperclip/tempfile_factory_spec.rb +0 -33
- data/spec/paperclip/tempfile_spec.rb +0 -35
- data/spec/paperclip/thumbnail_spec.rb +0 -504
- data/spec/paperclip/url_generator_spec.rb +0 -231
- data/spec/paperclip/validators/attachment_content_type_validator_spec.rb +0 -410
- data/spec/paperclip/validators/attachment_file_name_validator_spec.rb +0 -249
- data/spec/paperclip/validators/attachment_presence_validator_spec.rb +0 -85
- data/spec/paperclip/validators/attachment_size_validator_spec.rb +0 -325
- data/spec/paperclip/validators/media_type_spoof_detection_validator_spec.rb +0 -48
- data/spec/paperclip/validators_spec.rb +0 -179
- data/spec/spec_helper.rb +0 -46
- data/spec/support/assertions.rb +0 -84
- data/spec/support/fake_model.rb +0 -24
- data/spec/support/fake_rails.rb +0 -12
- data/spec/support/fixtures/12k.png +0 -0
- data/spec/support/fixtures/50x50.png +0 -0
- data/spec/support/fixtures/5k.png +0 -0
- data/spec/support/fixtures/animated +0 -0
- data/spec/support/fixtures/animated.gif +0 -0
- data/spec/support/fixtures/animated.unknown +0 -0
- data/spec/support/fixtures/aws_s3.yml +0 -13
- data/spec/support/fixtures/bad.png +0 -1
- data/spec/support/fixtures/empty.html +0 -1
- data/spec/support/fixtures/empty.xlsx +0 -0
- data/spec/support/fixtures/fog.yml +0 -8
- data/spec/support/fixtures/rotated.jpg +0 -0
- data/spec/support/fixtures/s3.yml +0 -8
- data/spec/support/fixtures/sample.xlsm +0 -0
- data/spec/support/fixtures/spaced file.jpg +0 -0
- data/spec/support/fixtures/spaced file.png +0 -0
- data/spec/support/fixtures/text.txt +0 -1
- data/spec/support/fixtures/twopage.pdf +0 -0
- data/spec/support/fixtures/uppercase.PNG +0 -0
- data/spec/support/matchers/accept.rb +0 -5
- data/spec/support/matchers/exist.rb +0 -5
- data/spec/support/matchers/have_column.rb +0 -23
- data/spec/support/mock_attachment.rb +0 -24
- data/spec/support/mock_interpolator.rb +0 -24
- data/spec/support/mock_url_generator_builder.rb +0 -26
- data/spec/support/model_reconstruction.rb +0 -72
- data/spec/support/reporting.rb +0 -11
- data/spec/support/test_data.rb +0 -13
- data/spec/support/version_helper.rb +0 -9
data/.travis.yml
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
language: ruby
|
|
2
|
-
|
|
3
|
-
rvm:
|
|
4
|
-
- 2.3
|
|
5
|
-
- 2.4
|
|
6
|
-
- 2.5
|
|
7
|
-
- 2.6
|
|
8
|
-
- 2.7
|
|
9
|
-
|
|
10
|
-
script: "bundle exec rake clean spec cucumber"
|
|
11
|
-
|
|
12
|
-
addons:
|
|
13
|
-
apt:
|
|
14
|
-
update: true
|
|
15
|
-
packages:
|
|
16
|
-
- ghostscript
|
|
17
|
-
|
|
18
|
-
before_install:
|
|
19
|
-
- sudo rm /etc/ImageMagick-6/policy.xml
|
|
20
|
-
|
|
21
|
-
gemfile:
|
|
22
|
-
- gemfiles/4.2.gemfile
|
|
23
|
-
- gemfiles/5.0.gemfile
|
|
24
|
-
- gemfiles/5.1.gemfile
|
|
25
|
-
- gemfiles/5.2.gemfile
|
|
26
|
-
- gemfiles/6.0.gemfile
|
|
27
|
-
- gemfiles/6.1.gemfile
|
|
28
|
-
|
|
29
|
-
matrix:
|
|
30
|
-
fast_finish: true
|
|
31
|
-
exclude:
|
|
32
|
-
- gemfile: gemfiles/6.0.gemfile
|
|
33
|
-
rvm: 2.3
|
|
34
|
-
- gemfile: gemfiles/6.0.gemfile
|
|
35
|
-
rvm: 2.4
|
|
36
|
-
- gemfile: gemfiles/6.1.gemfile
|
|
37
|
-
rvm: 2.3
|
|
38
|
-
- gemfile: gemfiles/6.1.gemfile
|
|
39
|
-
rvm: 2.4
|
|
40
|
-
- gemfile: gemfiles/4.2.gemfile
|
|
41
|
-
rvm: 2.7
|
|
42
|
-
- gemfile: gemfiles/5.0.gemfile
|
|
43
|
-
rvm: 2.7
|
|
44
|
-
- gemfile: gemfiles/5.1.gemfile
|
|
45
|
-
rvm: 2.7
|
data/Appraisals
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
appraise "4.2" do
|
|
2
|
-
gem "sqlite3", "~> 1.3.8", platforms: :ruby
|
|
3
|
-
gem "rails", "~> 4.2.0"
|
|
4
|
-
end
|
|
5
|
-
|
|
6
|
-
appraise "5.0" do
|
|
7
|
-
gem "sqlite3", "~> 1.3.8", platforms: :ruby
|
|
8
|
-
gem "rails", "~> 5.0.0"
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
appraise "5.1" do
|
|
12
|
-
gem "sqlite3", "~> 1.3.8", platforms: :ruby
|
|
13
|
-
gem "rails", "~> 5.1.0"
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
appraise "5.2" do
|
|
17
|
-
gem "sqlite3", "~> 1.3.8", platforms: :ruby
|
|
18
|
-
gem "rails", "~> 5.2.0"
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
appraise "6.0" do
|
|
22
|
-
gem "sqlite3", "~> 1.4", platforms: :ruby
|
|
23
|
-
gem "rails", "~> 6.0.0"
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
appraise "6.1" do
|
|
27
|
-
gem "sqlite3", "~> 1.4", platforms: :ruby
|
|
28
|
-
gem "aruba", "~> 1.0", ">= 1.0.4"
|
|
29
|
-
gem "rails", "~> 6.1", ">= 6.1.1"
|
|
30
|
-
end
|
data/CONTRIBUTING.md
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
Contributing
|
|
2
|
-
============
|
|
3
|
-
|
|
4
|
-
We love pull requests from everyone. By participating in this project, you agree
|
|
5
|
-
to abide by the thoughtbot [code of conduct].
|
|
6
|
-
|
|
7
|
-
[code of conduct]: https://thoughtbot.com/open-source-code-of-conduct
|
|
8
|
-
|
|
9
|
-
Here's a quick guide for contributing:
|
|
10
|
-
|
|
11
|
-
1. Fork the repo.
|
|
12
|
-
|
|
13
|
-
1. Make sure you have ImageMagick and Ghostscript installed. See [this section](./README.md#image-processor) of the README.
|
|
14
|
-
|
|
15
|
-
1. Run the tests. We only take pull requests with passing tests, and it's great
|
|
16
|
-
to know that you have a clean slate: `bundle && bundle exec rake`
|
|
17
|
-
|
|
18
|
-
1. Add a test for your change. Only refactoring and documentation changes
|
|
19
|
-
require no new tests. If you are adding functionality or fixing a bug, we need
|
|
20
|
-
a test!
|
|
21
|
-
|
|
22
|
-
1. Make the test pass.
|
|
23
|
-
|
|
24
|
-
1. Mention how your changes affect the project to other developers and users in
|
|
25
|
-
the `NEWS.md` file.
|
|
26
|
-
|
|
27
|
-
1. Push to your fork and submit a pull request.
|
|
28
|
-
|
|
29
|
-
At this point you're waiting on us. We like to at least comment on, if not
|
|
30
|
-
accept, pull requests within seven business days (most of the work on Paperclip
|
|
31
|
-
gets done on Fridays). We may suggest some changes or improvements or
|
|
32
|
-
alternatives.
|
|
33
|
-
|
|
34
|
-
Some things that will increase the chance that your pull request is accepted,
|
|
35
|
-
taken straight from the Ruby on Rails guide:
|
|
36
|
-
|
|
37
|
-
* Use Rails idioms and helpers
|
|
38
|
-
* Include tests that fail without your code, and pass with it
|
|
39
|
-
* Update the documentation, the surrounding one, examples elsewhere, guides,
|
|
40
|
-
whatever is affected by your contribution
|
|
41
|
-
|
|
42
|
-
Running Tests
|
|
43
|
-
-------------
|
|
44
|
-
|
|
45
|
-
Paperclip uses [Appraisal](https://github.com/thoughtbot/appraisal) to aid
|
|
46
|
-
testing against multiple version of Ruby on Rails. This helps us to make sure
|
|
47
|
-
that Paperclip performs correctly with them.
|
|
48
|
-
|
|
49
|
-
Paperclip also uses [RSpec](http://rspec.info) for its unit tests. If you submit
|
|
50
|
-
tests that are not written for Cucumber or RSpec without a very good reason, you
|
|
51
|
-
will be asked to rewrite them before we'll accept.
|
|
52
|
-
|
|
53
|
-
### Bootstrapping your test suite:
|
|
54
|
-
|
|
55
|
-
bundle install
|
|
56
|
-
bundle exec appraisal install
|
|
57
|
-
|
|
58
|
-
This will install all the required gems that requires to test against each
|
|
59
|
-
version of Rails, which defined in `gemfiles/*.gemfile`.
|
|
60
|
-
|
|
61
|
-
### To run a full test suite:
|
|
62
|
-
|
|
63
|
-
bundle exec appraisal rake
|
|
64
|
-
|
|
65
|
-
This will run RSpec and Cucumber against all version of Rails
|
|
66
|
-
|
|
67
|
-
### To run single Test::Unit or Cucumber test
|
|
68
|
-
|
|
69
|
-
You need to specify a `BUNDLE_GEMFILE` pointing to the gemfile before running
|
|
70
|
-
the normal test command:
|
|
71
|
-
|
|
72
|
-
BUNDLE_GEMFILE=gemfiles/4.1.gemfile rspec spec/paperclip/attachment_spec.rb
|
|
73
|
-
BUNDLE_GEMFILE=gemfiles/4.1.gemfile cucumber features/basic_integration.feature
|
|
74
|
-
|
|
75
|
-
Syntax
|
|
76
|
-
------
|
|
77
|
-
|
|
78
|
-
* Two spaces, no tabs.
|
|
79
|
-
* No trailing whitespace. Blank lines should not have any space.
|
|
80
|
-
* Prefer `&&` instead of `and` ; prefer `||` instead of `or`.
|
|
81
|
-
* Use `MyClass.my_method(my_arg)` instead of `MyClass.my_method( my_arg )` or `MyClass.my_method my_arg`.
|
|
82
|
-
* `a = b` rather than `a=b` .
|
|
83
|
-
* Follow the conventions you see used in the source already.
|
|
84
|
-
|
|
85
|
-
And in case we didn't emphasize it enough: we love tests!
|
data/Gemfile
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
source "https://rubygems.org"
|
|
2
|
-
|
|
3
|
-
gemspec
|
|
4
|
-
|
|
5
|
-
gem "pry"
|
|
6
|
-
|
|
7
|
-
# Hinting at development dependencies
|
|
8
|
-
# Prevents bundler from taking a long-time to resolve
|
|
9
|
-
group :development, :test do
|
|
10
|
-
gem "activerecord-import"
|
|
11
|
-
gem "bootsnap", require: false
|
|
12
|
-
gem "builder"
|
|
13
|
-
gem "listen", "~> 3.0.8"
|
|
14
|
-
gem "rspec"
|
|
15
|
-
# Hound only supports certain versions of Rubocop -- 1.22.1 is currently the most recent one supported.
|
|
16
|
-
gem "rubocop", "1.22.1", require: false
|
|
17
|
-
gem "rubocop-rails"
|
|
18
|
-
gem "sprockets", "3.7.2"
|
|
19
|
-
end
|