Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .codeclimate.yml

This file was deleted.

101 changes: 101 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: CI

on:
push:
branches: [master]
pull_request: ~

jobs:
rubocop:
runs-on: ubuntu-latest
name: RuboCop
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby-4.0
bundler-cache: true
- name: Run RuboCop
run: bundle exec rubocop

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { ruby: ruby-2.7, rails: '5.2', imagemagick: '7' }
- { ruby: ruby-3.0, rails: '6.1', imagemagick: '6' }
- { ruby: ruby-3.1, rails: '7.0', imagemagick: '7' }
- { ruby: ruby-3.2, rails: '7.1', imagemagick: '6' }
- { ruby: ruby-3.3, rails: '7.2', imagemagick: '7' }
- { ruby: ruby-3.4, rails: '8.0', imagemagick: '6' }
- { ruby: ruby-4.0, rails: '8.1', imagemagick: '7' }
- { ruby: jruby-10.0, rails: '7.2', imagemagick: '7' }
- { ruby: truffleruby-24, rails: '8.1', imagemagick: '7' }

name: ${{matrix.ruby}} rails-${{matrix.rails}} im-${{matrix.imagemagick}}

steps:
- uses: actions/checkout@v4

- name: Install ImageMagick 6
if: matrix.imagemagick == '6'
run: |
sudo apt-get update
sudo apt-get install -y imagemagick libmagickwand-dev ghostscript
sudo rm -f /etc/ImageMagick-6/policy.xml
convert -version

- name: Cache ImageMagick 7
if: matrix.imagemagick == '7'
id: cache-im7
uses: actions/cache@v4
with:
path: |
/usr/local/lib/libMagick*
/usr/local/bin/magick
/usr/local/include/ImageMagick-7
/usr/local/lib/ImageMagick-*
/usr/local/etc/ImageMagick-7
/usr/local/share/ImageMagick-7
key: imagemagick7-${{ runner.os }}

- name: Install ImageMagick 7 dependencies
if: matrix.imagemagick == '7'
run: |
sudo apt-get update
sudo apt-get remove -y imagemagick imagemagick-6-common || true
sudo apt-get install -y build-essential pkg-config ghostscript \
libjpeg-dev libpng-dev libtiff-dev libwebp-dev \
libfreetype6-dev libfontconfig1-dev libxml2-dev \
libltdl-dev

- name: Build ImageMagick 7
if: matrix.imagemagick == '7' && steps.cache-im7.outputs.cache-hit != 'true'
run: |
cd /tmp
wget -q https://imagemagick.org/archive/ImageMagick.tar.gz
tar xzf ImageMagick.tar.gz
cd ImageMagick-*
./configure --with-modules --enable-shared --quiet
make -j$(nproc) --quiet
sudo make install --quiet

- name: Configure ImageMagick 7
if: matrix.imagemagick == '7'
run: |
sudo ldconfig
magick -version

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
env:
RAILS_VERSION: ${{ matrix.rails }}

- name: Run specs
run: bundle exec rspec
env:
RAILS_VERSION: ${{ matrix.rails }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
.bundle
tmp
.DS_Store
.idea

*.log
*.tmp

public
paperclip*.gem
Expand Down
3 changes: 0 additions & 3 deletions .hound.yml

This file was deleted.

1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ Metrics/AbcSize:
Metrics/BlockLength:
Exclude:
- "spec/**/*"
- "**/*.rake"
Metrics/BlockNesting:
Description: Avoid excessive block nesting
StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
Expand Down
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

30 changes: 0 additions & 30 deletions Appraisals

This file was deleted.

25 changes: 22 additions & 3 deletions OLD_NEWS → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
[UNRELEASED]

* Improvement: Support aws-sdk-s3 >= 1.196.1 and multipart file downloads
7.4.0 [UNRELEASED]
* Version Support: Drop support for Ruby 2.6 and earlier (Rails support stays at 4.2 and later)
* Add Github Actions CI to ensure support Ruby 2.7+, Rails 4.2+, ImageMagick 6 and 7, JRuby, and TruffleRuby.
* Fix all failing specs on all Ruby versions.
* Fix issues with Rails deprecation in tests.
* Remove appraisal gem, use RAILS_VERSION env var in main Gemfile instead.
* Move gemspec development dependencies to Gemfile, per latest standards.
* Change "NEWS" and "OLD_NEWS" files to "CHANGELOG.md".
* Remove UPGRADING message.
* Remove cruft files: .travis.yml, .codeclimate.yml, .hound.yml

7.3.0 (2026-01-31)
* Fix BOM for gd locale (https://github.com/kreeti/kt-paperclip/pull/158)
* Support versions of aws-sdk-s3 >= 1.197 by conditionally using Aws::S3::TransferManager if available (https://github.com/kreeti/kt-paperclip/pull/155)
* Fix frozen string literal warning in geometry.rb (https://github.com/kreeti/kt-paperclip/pull/151)
* Feature: Add option to return attachment attributes on destroy (https://github.com/kreeti/kt-paperclip/pull/91)
* Ruby 3.1: Fix loading of Fog (https://github.com/kreeti/kt-paperclip/pull/135, https://github.com/kreeti/kt-paperclip/pull/139)
* French Locale (https://github.com/kreeti/kt-paperclip/pull/134)

7.2.2 (2024-01-19)
* Allow for terrapin 1.x (https://github.com/kreeti/kt-paperclip/pull/130)
* Include migration statements on ActiveRecord::Migration (https://github.com/kreeti/kt-paperclip/pull/125)

7.2.1 (2023-09-09)
* Improvement: Support file extension names both as symbols and strings for :content_type_mappings
Expand Down
34 changes: 25 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,34 @@ source "https://rubygems.org"

gemspec

gem "pry"
rails_version = "~> #{ENV['RAILS_VERSION']}.0" if ENV["RAILS_VERSION"]
gem "rails", rails_version

if RUBY_ENGINE == "jruby"
gem "activerecord-jdbcsqlite3-adapter", ">= 70.0"
else
gem "sqlite3", ("~> 1.4" if ENV["RAILS_VERSION"]&.<("7.2"))
end

# Hinting at development dependencies
# Prevents bundler from taking a long-time to resolve
group :development, :test do
gem "activerecord-import"
gem "bootsnap", require: false
gem "aruba"
gem "aws-sdk-s3"
gem "builder"
gem "listen", "~> 3.0.8"
gem "capybara"
gem "cucumber-expressions"
gem "cucumber-rails"
gem "fakeweb"
gem "fog-aws"
gem "fog-local"
gem "generator_spec"
gem "launchy"
gem "nokogiri"
gem "ostruct" # required for Ruby >= 4.0
gem "rake"
gem "rspec"
# Hound only supports certain versions of Rubocop -- 1.22.1 is currently the most recent one supported.
gem "rubocop", "1.22.1", require: false
gem "rubocop-rails"
gem "sprockets", "3.7.2"
gem "rubocop", require: false
gem "rubocop-rails", require: false
gem "shoulda"
gem "timecop" unless RUBY_ENGINE == "jruby" # timecop's Time.new patch is broken on JRuby 10
end
16 changes: 4 additions & 12 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
require "bundler/gem_tasks"
require "appraisal"
require "rspec/core/rake_task"
require "cucumber/rake/task"

desc "Default: run unit tests."
task default: [:clean, :all]

desc "Test the paperclip plugin under all supported Rails versions."
task :all do |_t|
if ENV["BUNDLE_GEMFILE"]
exec("rake spec && cucumber")
else
exec("rm -f gemfiles/*.lock")
Rake::Task["appraisal:gemfiles"].execute
Rake::Task["appraisal:install"].execute
exec("rake appraisal")
end
task all: :environment do |_t|
exec("rake spec && cucumber")
end

desc "Test the paperclip plugin."
Expand All @@ -27,13 +19,13 @@ Cucumber::Rake::Task.new do |t|
end

desc "Start an IRB session with all necessary files required."
task :shell do |_t|
task shell: :environment do |_t|
chdir File.dirname(__FILE__)
exec "irb -I lib/ -I lib/paperclip -r rubygems -r active_record -r tempfile -r init"
end

desc "Clean up files."
task :clean do |_t|
task clean: :environment do |_t|
FileUtils.rm_rf "doc"
FileUtils.rm_rf "tmp"
FileUtils.rm_rf "pkg"
Expand Down
17 changes: 0 additions & 17 deletions UPGRADING

This file was deleted.

20 changes: 0 additions & 20 deletions gemfiles/4.2.gemfile

This file was deleted.

20 changes: 0 additions & 20 deletions gemfiles/5.0.gemfile

This file was deleted.

Loading
Loading