Class: ViewPrimitives::Generators::ThemeGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Detector
Defined in:
lib/generators/view_primitives/theme/theme_generator.rb

Constant Summary

Constants included from Detector

Detector::JS_CONTROLLER_DIRS, Detector::TAILWIND_ENTRIES

Instance Method Summary collapse

Instance Method Details

#copy_theme_fileObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/generators/view_primitives/theme/theme_generator.rb', line 16

def copy_theme_file
  source = "view_primitives/themes/#{theme_name}.css"
  dest = "#{css_dest_dir}/view_primitives/themes/#{theme_name}.css"

  unless theme_available?
    say "  Unknown theme: #{theme_name}. Available: #{available_themes.join(", ")}", :red
    abort
  end

  copy_file source, dest
  enable_theme_import
  print_usage
end