Class: Rsg::Generators::Webpacker::BootstrapGenerator
- Inherits:
-
Base
- Object
- Base
- Rsg::Generators::Webpacker::BootstrapGenerator
- Defined in:
- lib/rsg/generators/webpacker/bootstrap_generator.rb
Instance Method Summary collapse
- #add_bootstrap ⇒ Object
- #application_sass ⇒ Object
- #banner ⇒ Object
- #htmls ⇒ Object
- #sanity_check ⇒ Object
Instance Method Details
#add_bootstrap ⇒ Object
10 11 12 13 |
# File 'lib/rsg/generators/webpacker/bootstrap_generator.rb', line 10 def add_bootstrap return say("Bootstrap already installed, skipping") if File.read("yarn.lock") =~ /^bootstrap[^:]+:/ run "yarn add bootstrap bootstrap-icons" end |
#application_sass ⇒ Object
15 16 17 |
# File 'lib/rsg/generators/webpacker/bootstrap_generator.rb', line 15 def application_sass copy_file "bootstrap/application.sass", "app/javascript/stylesheets/application.sass" end |
#banner ⇒ Object
6 7 8 |
# File 'lib/rsg/generators/webpacker/bootstrap_generator.rb', line 6 def say("Configuring Bootstrap") end |
#htmls ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/rsg/generators/webpacker/bootstrap_generator.rb', line 19 def htmls # TODO: These will ask to confirm for an overwrite, should we just force? template "bootstrap/layout.html.erb", "app/views/layouts/application.html.erb" template "bootstrap/landing.html.erb", "app/views/landing/show.html.erb" # template "bootstrap/about.html.erb", "app/views/landing/about.html.erb" # template "bootstrap/contact.html.erb", "app/views/landing/contact.html.erb" # template "bootstrap/login.html.erb", "app/views/landing/login.html.erb" end |
#sanity_check ⇒ Object
2 3 4 |
# File 'lib/rsg/generators/webpacker/bootstrap_generator.rb', line 2 def sanity_check raise "Can't configure bootstrap on API apps" if api_mode? end |