Class: KozenetUi::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- KozenetUi::Generators::InstallGenerator
- Defined in:
- lib/generators/kozenet_ui/install/install_generator.rb
Overview
Generator for installing Kozenet UI into a Rails application Copies stylesheets, creates initializer, and adds runtime tags
Instance Method Summary collapse
- #add_importmap_pins ⇒ Object
- #add_stylesheets_to_application ⇒ Object
- #add_tags_to_layout ⇒ Object
- #copy_stylesheets ⇒ Object
- #create_initializer ⇒ Object
- #show_readme ⇒ Object
Instance Method Details
#add_importmap_pins ⇒ Object
37 38 39 40 41 42 |
# File 'lib/generators/kozenet_ui/install/install_generator.rb', line 37 def add_importmap_pins importmap_file = find_importmap_file return unless importmap_file update_importmap_file(importmap_file) end |
#add_stylesheets_to_application ⇒ Object
26 27 28 |
# File 'lib/generators/kozenet_ui/install/install_generator.rb', line 26 def add_stylesheets_to_application say "Kozenet UI stylesheets will be loaded from kozenet_ui_head_tags", :blue end |
#add_tags_to_layout ⇒ Object
30 31 32 33 34 35 |
# File 'lib/generators/kozenet_ui/install/install_generator.rb', line 30 def layout_file = find_application_layout return warn_no_layout_file unless layout_file update_layout_file(layout_file) end |
#copy_stylesheets ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/generators/kozenet_ui/install/install_generator.rb', line 18 def copy_stylesheets say "📦 Copying Kozenet UI stylesheets...", :blue setup_directories copy_main_stylesheets copy_component_stylesheets say "✅ Stylesheets copied successfully!", :green end |
#create_initializer ⇒ Object
14 15 16 |
# File 'lib/generators/kozenet_ui/install/install_generator.rb', line 14 def create_initializer template "kozenet_ui.rb", "config/initializers/kozenet_ui.rb" end |
#show_readme ⇒ Object
44 45 46 |
# File 'lib/generators/kozenet_ui/install/install_generator.rb', line 44 def show_readme end |