Class: Geoblacklight::Webpacker
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Geoblacklight::Webpacker
- Defined in:
- lib/generators/geoblacklight/webpacker_generator.rb
Instance Method Summary collapse
- #javascript_install ⇒ Object
- #procfile ⇒ Object
- #webpacker_config ⇒ Object
- #webpacker_install ⇒ Object
Instance Method Details
#javascript_install ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/generators/geoblacklight/webpacker_generator.rb', line 22 def javascript_install # This overrides the default dependencies specified using # webpacker:install copy_file 'package.json', 'package.json' yarn_available = system('yarn --version') if yarn_available run 'yarn install' run 'yarn upgrade' else run 'npm install' run 'npm update' end end |
#procfile ⇒ Object
18 19 20 |
# File 'lib/generators/geoblacklight/webpacker_generator.rb', line 18 def procfile copy_file 'Procfile', 'Procfile' end |
#webpacker_config ⇒ Object
14 15 16 |
# File 'lib/generators/geoblacklight/webpacker_generator.rb', line 14 def webpacker_config copy_file 'webpacker.yml', 'config/webpacker.yml' end |
#webpacker_install ⇒ Object
10 11 12 |
# File 'lib/generators/geoblacklight/webpacker_generator.rb', line 10 def webpacker_install run 'bundle exec rails webpacker:install' end |