class Rsg::Generators::Webpacker::BootstrapGenerator
Public Instance Methods
add_bootstrap()
click to toggle source
# 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()
click to toggle source
# File lib/rsg/generators/webpacker/bootstrap_generator.rb, line 15 def application_sass copy_file "bootstrap/application.sass", "app/javascript/stylesheets/application.sass" end
htmls()
click to toggle source
# 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()
click to toggle source
# 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