Class: StimulusPlumbers::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- StimulusPlumbers::Generators::InstallGenerator
- Includes:
- CssEntrypoint
- Defined in:
- lib/generators/stimulus_plumbers/install/install_generator.rb
Constant Summary collapse
- TOKENS_CSS_SOURCE =
File.join( File.("../../../..", __dir__), TokensDirective::TOKENS_CSS_PATH )
Constants included from CssEntrypoint
CssEntrypoint::ENTRY_CANDIDATES, CssEntrypoint::STIMULUS_PLUMBERS_CSS_ENTRY
Instance Method Summary collapse
Methods included from CssEntrypoint
#append_to_gitignore, #apply_edit, #content_edit, #copy_asset, #entry_css_file, #insert_near_anchor, #prepend, #relative_to_destination, #remove_lines, #warn_entry_css_not_found, #write_generated
Instance Method Details
#install ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/generators/stimulus_plumbers/install/install_generator.rb', line 17 def install css_file = entry_css_file(**) return warn_entry_css_not_found(label: "CSS", **) unless css_file return unless copy_asset(TOKENS_CSS_SOURCE, TokensDirective::TOKENS_CSS_PATH) apply_edit( css_file, TokensDirective.directive(from: File.dirname(css_file), destination_root: destination_root), stale_pattern: TokensDirective.stale_pattern ) end |