Skip to content

Commit

Permalink
Remove Dragonfly
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen committed Apr 12, 2022
1 parent 594b0a7 commit 71c9c37
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 230 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 @@ -57,8 +57,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
23 changes: 11 additions & 12 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 All @@ -92,7 +90,7 @@ sharpen_images: false
# This is used by the seeder to create the default site.
default_site:
name: Default Site
host: '*'
host: "*"

# This is the default language when seeding.
default_language:
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
21 changes: 0 additions & 21 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 @@ -45,16 +45,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 "jquery-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 @@ -71,14 +71,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 71c9c37

Please sign in to comment.