Class: Alchemy::Upgrader::SevenPointThree

Inherits:
Alchemy::Upgrader show all
Includes:
Thor::Actions, Thor::Base
Defined in:
lib/alchemy/upgrader/seven_point_three.rb

Constant Summary

Constants included from Shell

Shell::COLORS

Class Method Summary collapse

Methods inherited from Alchemy::Upgrader

copy_new_config_file

Methods included from Shell

#add_todo, #desc, #display_todos, #log, silence!, silenced?, #todo, #todos, verbose!

Class Method Details

.generate_custom_css_entrypointObject



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/alchemy/upgrader/seven_point_three.rb', line 21

def generate_custom_css_entrypoint
  if File.exist? "app/assets/config/manifest.js"
    log "Generating alchemy/admin/custom.css entrypoint file."
    task.copy_file "custom.css", "app/assets/stylesheets/alchemy/admin/custom.css"
    task.append_to_file "app/assets/config/manifest.js", "//= link alchemy/admin/custom.css\n"
    todo(<<~TODO, "Custom styles have been moved to `app/assets/alchemy/admin/custom.css`")
      Check the new `app/assets/alchemy/admin/custom.css` file for any custom styles you might
      have added to the old `vendor/assets/stylesheets/alchemy/admin/all.css` file.
    TODO
  end
end

.remove_admin_stylesheetsObject



14
15
16
17
18
19
# File 'lib/alchemy/upgrader/seven_point_three.rb', line 14

def remove_admin_stylesheets
  if File.exist? "vendor/assets/stylesheets/alchemy/admin/all.css"
    log "Removing Alchemy admin stylesheets."
    FileUtils.rm_f "vendor/assets/stylesheets/alchemy/admin/all.css"
  end
end

.show_resource_table_noticeObject



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/alchemy/upgrader/seven_point_three.rb', line 33

def show_resource_table_notice
  custom_modules = Alchemy::Modules.alchemy_modules.reject { _1["engine_name"] == "alchemy" }
  return if custom_modules.none?

  todo(<<~TODO, "Resource templates have been updated.")
    We updated the resource templates to use the newly introduced
    `Alchemy::Admin::Resource::Table` view component.

    Please update your resource templates accordingly.
  TODO
end