Class: Geoblacklight::AssetsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Geoblacklight::AssetsGenerator
- Defined in:
- lib/generators/geoblacklight/assets_generator.rb
Overview
Run general asset setup and then delegate to the appropriate generator Based on Blacklight::AssetsGenerator
Instance Method Summary collapse
-
#add_frontend ⇒ Object
Pick a version of the frontend asset package and install it.
- #run_asset_pipeline_specific_generator ⇒ Object
Instance Method Details
#add_frontend ⇒ Object
Pick a version of the frontend asset package and install it.
If a branch was specified (e.g. you are running a template.rb build against a test branch), use the latest version available on npm.
Otherwise, pick the version from npm that matches our Geoblacklight gem version.
17 18 19 20 21 22 23 |
# File 'lib/generators/geoblacklight/assets_generator.rb', line 17 def add_frontend if ENV["BRANCH"] run "yarn add @geoblacklight/frontend@latest" else run "yarn add @geoblacklight/frontend@#{Geoblacklight::VERSION}" end end |
#run_asset_pipeline_specific_generator ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/generators/geoblacklight/assets_generator.rb', line 25 def run_asset_pipeline_specific_generator = "--test=true" if [:test] generator = if [:"asset-pipeline"] "geoblacklight:assets:#{options[:"asset-pipeline"]}" else "geoblacklight:assets:vite" end generate generator, end |