Class: StimulusPlumbers::Tailwind::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- StimulusPlumbers::Tailwind::Generators::InstallGenerator
- Includes:
- Generators::CssEntrypoint
- Defined in:
- lib/generators/stimulus_plumbers/tailwind/install/install_generator.rb
Constant Summary collapse
- GEM_NAME =
"stimulus_plumbers_tailwind"- LIB_DIR =
File.("../../../..", __dir__)
- TAILWIND_CSS_FILE =
"TAILWIND_CSS_FILE"- CSS_CANDIDATES =
%w[ app/assets/stylesheets/application.tailwind.css app/assets/stylesheets/application.css app/javascript/entrypoints/application.css ].freeze
Instance Method Summary collapse
Instance Method Details
#install ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/generators/stimulus_plumbers/tailwind/install/install_generator.rb', line 22 def install css_file = entry_css_file(**) return warn_entry_css_not_found(label: "Tailwind CSS", **) unless css_file apply_edit( css_file, StimulusPlumbers::Generators::TokensDirective.directive, stale_pattern: StimulusPlumbers::Generators::TokensDirective.stale_pattern ) apply_edit( css_file, source_directive, anchor_pattern: source_anchor_pattern, stale_pattern: source_stale_pattern ) end |