Class: Blacklight::Assets::PropshaftGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Blacklight::Assets::PropshaftGenerator
- Defined in:
- lib/generators/blacklight/assets/propshaft_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_package ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/generators/blacklight/assets/propshaft_generator.rb', line 6 def add_package if ENV['CI'] run "yarn add file:#{Blacklight::Engine.root}" else run "yarn add blacklight-frontend@#{Blacklight::VERSION}" end end |
#add_package_assets ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/generators/blacklight/assets/propshaft_generator.rb', line 18 def add_package_assets append_to_file 'app/assets/stylesheets/application.bootstrap.scss' do <<~CONTENT @import "blacklight-frontend/app/assets/stylesheets/blacklight/blacklight"; CONTENT end append_to_file 'app/javascript/application.js' do <<~CONTENT import Blacklight from "blacklight-frontend"; import githubAutoCompleteElement from "@github/auto-complete-element"; CONTENT end end |
#add_third_party_packages ⇒ Object
14 15 16 |
# File 'lib/generators/blacklight/assets/propshaft_generator.rb', line 14 def add_third_party_packages run 'yarn add @github/auto-complete-element' end |