Skip to content

Commit 76ba3ad

Browse files
authored
Remove ckeditor gem (#245)
* Remove ckeditor (gh security scan is blocking other work from going through) * Remove initializer * Comment out routes and remove spec * Remove the inclusions from ckeditor asset model * Quick and dirty commenting/inheritance changes * Remove inclusion of ckeditor in application.js
1 parent 006af5a commit 76ba3ad

File tree

9 files changed

+23
-81
lines changed

9 files changed

+23
-81
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ gem "will_paginate", "~> 3.1.7"
3232
gem "bootstrap-will_paginate"
3333
gem "apipie-rails", "~> 1.5.0"
3434
gem "rack-cors", require: "rack/cors"
35-
gem "ckeditor", "~> 4.3.0"
35+
# gem "ckeditor", "~> 4.3.0" # removed given gh security scan results. still need a replacement.
3636
gem "binding_of_caller"
3737
gem "image_processing"
3838
gem "inky-rb", require: "inky"

Gemfile.lock

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@ GEM
132132
rack-test (>= 0.6.3)
133133
regexp_parser (>= 1.5, < 3.0)
134134
xpath (~> 3.2)
135-
ckeditor (4.3.0)
136-
orm_adapter (~> 0.5.0)
137-
terrapin
138135
climate_control (0.2.0)
139136
cocoon (1.2.15)
140137
coderay (1.1.3)
@@ -456,7 +453,6 @@ DEPENDENCIES
456453
brakeman
457454
bundler-audit
458455
capybara (~> 3.36)
459-
ckeditor (~> 4.3.0)
460456
cocoon (~> 1.2.6)
461457
country_select
462458
debug (~> 1.11)

app/assets/javascripts/application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//= require bootstrap.min
1616
//= require cocoon
1717
//= require annotator-full.min
18-
//= require ckeditor/init
18+
1919
//= require ckeditor/config
2020
//= require_tree ./components
2121
//= require_tree ./select-2

app/models/ckeditor/asset.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
class Ckeditor::Asset < ApplicationRecord
2-
include Ckeditor::Orm::ActiveRecord::AssetBase
3-
include Ckeditor::Backend::Paperclip
2+
# include Ckeditor::Orm::ActiveRecord::AssetBase
3+
# include Ckeditor::Backend::Paperclip
44
end
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
class Ckeditor::AttachmentFile < Ckeditor::Asset
2-
has_attached_file :data,
3-
:url => "/ckeditor_assets/attachments/:id/:filename",
4-
:path => "/ckeditor_assets/attachments/:id/:filename"
5-
6-
validates_attachment_presence :data
7-
validates_attachment_size :data, :less_than => 100.megabytes
8-
do_not_validate_attachment_file_type :data
1+
class Ckeditor::AttachmentFile < ApplicationRecord # Ckeditor::Asset
2+
# has_attached_file :data,
3+
# :url => "/ckeditor_assets/attachments/:id/:filename",
4+
# :path => "/ckeditor_assets/attachments/:id/:filename"
5+
#
6+
# validates_attachment_presence :data
7+
# validates_attachment_size :data, :less_than => 100.megabytes
8+
# do_not_validate_attachment_file_type :data
99

1010
def url_thumb
11-
@url_thumb ||= Ckeditor::Utils.filethumb(filename)
11+
@url_thumb ||= nil # Ckeditor::Utils.filethumb(filename)
1212
end
1313
end

app/models/ckeditor/picture.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
class Ckeditor::Picture < Ckeditor::Asset
2-
has_attached_file :data,
3-
:url => "/ckeditor_assets/pictures/:id/:style_:basename.:extension",
4-
:path => "/ckeditor_assets/pictures/:id/:style_:basename.:extension",
5-
:styles => { :content => '800>', :thumb => '118x100#' }
6-
7-
validates_attachment_presence :data
8-
validates_attachment_size :data, :less_than => 2.megabytes
9-
validates_attachment_content_type :data, :content_type => /\Aimage/
1+
class Ckeditor::Picture < ApplicationRecord # Ckeditor::Asset
2+
# has_attached_file :data,
3+
# :url => "/ckeditor_assets/pictures/:id/:style_:basename.:extension",
4+
# :path => "/ckeditor_assets/pictures/:id/:style_:basename.:extension",
5+
# :styles => { :content => '800>', :thumb => '118x100#' }
6+
#
7+
# validates_attachment_presence :data
8+
# validates_attachment_size :data, :less_than => 2.megabytes
9+
# validates_attachment_content_type :data, :content_type => /\Aimage/
1010

1111
def url_content
1212
url(:content)

config/initializers/ckeditor.rb

Lines changed: 0 additions & 50 deletions
This file was deleted.

config/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Rails.application.routes.draw do
2-
mount Ckeditor::Engine, at: '/admin/ckeditor', as: 'ckeditor'
2+
# mount Ckeditor::Engine, at: '/admin/ckeditor', as: 'ckeditor'
33
apipie
44
get 'cms', to: 'admins/base#show'
55

spec/decorators/facilitator_decorator_spec.rb

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)