Skip to content

Commit

Permalink
Remove Dragonfly
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen committed Aug 2, 2023
1 parent 7e9d6ce commit f9c6148
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 232 deletions.
2 changes: 0 additions & 2 deletions alchemy_cms.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency "awesome_nested_set", ["~> 3.1"]
gem.add_runtime_dependency "cancancan", [">= 2.1", "< 4.0"]
gem.add_runtime_dependency "coffee-rails", [">= 4.0", "< 6.0"]
gem.add_runtime_dependency "dragonfly", ["~> 1.4"]
gem.add_runtime_dependency "dragonfly_svg", ["~> 0.0.4"]
gem.add_runtime_dependency "gutentag", ["~> 2.2", ">= 2.2.1"]
gem.add_runtime_dependency "handlebars_assets", ["~> 0.23"]
gem.add_runtime_dependency "image_processing", [">= 1.2"]
Expand Down
4 changes: 2 additions & 2 deletions app/models/alchemy/picture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class Picture < BaseRecord
#
# === CAUTION
#
# This HAS to be placed for Dragonfly's class methods,
# to ensure this runs before Dragonfly's before_destroy callback.
# This HAS to be placed for ActiveStorage class methods,
# to ensure this runs before ActiveStorage before_destroy callback.
#
before_destroy unless: :deletable? do
raise PictureInUseError, Alchemy.t(:cannot_delete_picture_notice) % {name: name}
Expand Down
21 changes: 10 additions & 11 deletions config/alchemy/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ items_per_page: 15

# === Picture rendering settings
#
# Alchemy uses Dragonfly to render images. Settings for image rendering are specific to elements and are defined in elements.yml
# Alchemy uses ActiveStorage to render images. Settings for image rendering are specific to elements and are defined in elements.yml
#
# Example:
# - name: some_element
Expand All @@ -74,8 +74,6 @@ items_per_page: 15
# crop: true # turns on image cropping
# size: '500x500' # image will be cropped to this size
#
# See http://markevans.github.com/dragonfly for further info.
#
# ==== Global Options:
#
# output_image_jpg_quality [Integer] # If image gets rendered as JPG this is the quality setting for it. (Default 85)
Expand Down Expand Up @@ -134,7 +132,8 @@ mailer:
mail_from: [email protected]
mail_to: [email protected]
subject: A new contact form message
fields: [salutation, firstname, lastname, address, zip, city, phone, email, message]
fields:
[salutation, firstname, lastname, address, zip, city, phone, email, message]
validate_fields: [lastname, email]

# === User roles
Expand Down Expand Up @@ -167,14 +166,14 @@ uploader:
file_size_limit: 100
allowed_filetypes:
alchemy/attachments:
- '*'
- "*"
alchemy/pictures:
- jpg
- jpeg
- gif
- png
- svg
- webp
- jpg
- jpeg
- gif
- png
- svg
- webp

# === Link Target Options
#
Expand Down
24 changes: 0 additions & 24 deletions config/initializers/dragonfly.rb

This file was deleted.

18 changes: 0 additions & 18 deletions lib/alchemy/dragonfly/processors/auto_orient.rb

This file was deleted.

35 changes: 0 additions & 35 deletions lib/alchemy/dragonfly/processors/crop_resize.rb

This file was deleted.

11 changes: 0 additions & 11 deletions lib/alchemy/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,5 @@ class Engine < Rails::Engine
end
end
end

initializer "alchemy.webp-mime_type" do
# Rails does not know anything about webp even in 2022
unless Mime::Type.lookup_by_extension(:webp)
Mime::Type.register("image/webp", :webp)
end
# Dragonfly uses Rack to read the mime type and guess what
unless Rack::Mime::MIME_TYPES[".webp"]
Rack::Mime::MIME_TYPES[".webp"] = "image/webp"
end
end
end
end
1 change: 0 additions & 1 deletion lib/alchemy_cms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
require "active_model_serializers"
require "awesome_nested_set"
require "cancan"
require "dragonfly"
require "gutentag"
require "handlebars_assets"
require "importmap-rails"
Expand Down
8 changes: 0 additions & 8 deletions lib/generators/alchemy/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,6 @@ def copy_demo_views
copy_file "alchemy.en.yml", app_config_path.join("locales", "alchemy.en.yml")
end

def copy_dragonfly_config
template(
"#{__dir__}/templates/dragonfly.rb.tt",
app_config_path.join("initializers", "dragonfly.rb"),
skip: options[:auto_accept]
)
end

def install_gutentag_migrations
rake "gutentag:install:migrations"
end
Expand Down
35 changes: 0 additions & 35 deletions lib/generators/alchemy/install/templates/dragonfly.rb.tt

This file was deleted.

37 changes: 0 additions & 37 deletions spec/dummy/config/initializers/dragonfly.rb

This file was deleted.

17 changes: 0 additions & 17 deletions spec/libraries/dragonfly/processors/auto_orient_spec.rb

This file was deleted.

23 changes: 0 additions & 23 deletions spec/libraries/dragonfly/processors/crop_resize_spec.rb

This file was deleted.

8 changes: 0 additions & 8 deletions spec/support/dragonfly_test_app.rb

This file was deleted.

0 comments on commit f9c6148

Please sign in to comment.