Sha256: 7dd2f9a3dd133deea6222d6e349aaa4d8c58884d764b6ba3f93511535a6a73ea
Contents?: true
Size: 717 Bytes
Versions: 17
Compression:
Stored size: 717 Bytes
Contents
# -*- encoding : utf-8 -*- class UpdateTinymceConfigToV5 < Cardio::Migration::Core DEPRECATED_PLUGINS = %w[contextmenu textcolor colorpicker].freeze def up content = Card[:tiny_mce].content.sub('"modern"', '"silver"') content = remove_deprecated_plugins(content) ensure_card :tiny_mce, content: content end def remove_deprecated_plugins content content.sub(/['"]plugins['"]: \s* ['"](?<plugins>[^"']+)["'] (?<comma>,)? $/x) do |_match| comma = Regexp.last_match[:comma] plugins = Regexp.last_match[:plugins].split(/\s+/) - DEPRECATED_PLUGINS %("plugins": "#{plugins.join ' '}"#{comma}) end end end
Version data entries
17 entries across 17 versions & 1 rubygems