Class: StimulusPlumbers::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
CssEntrypoint
Defined in:
lib/generators/stimulus_plumbers/install/install_generator.rb

Constant Summary

Constants included from CssEntrypoint

CssEntrypoint::ENTRY_CANDIDATES, CssEntrypoint::STIMULUS_PLUMBERS_CSS_ENTRY

Instance Method Summary collapse

Methods included from CssEntrypoint

#apply_edit, #content_edit, #entry_css_file, #insert_near_anchor, #prepend, #relative_to_destination, #warn_entry_css_not_found

Instance Method Details

#installObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/generators/stimulus_plumbers/install/install_generator.rb', line 12

def install
  css_file = entry_css_file(**css_file_lookup_options)
  return warn_entry_css_not_found(label: "CSS", **css_file_lookup_options) unless css_file

  apply_edit(
    css_file,
    TokensDirective.directive(from: File.dirname(css_file)),
    stale_pattern: TokensDirective.stale_pattern
  )
end