def puts_red(heredoc); puts set_color heredoc, :red; end def puts_green(heredoc); puts set_color heredoc, :green; end puts_red "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" puts_red "@@ @@@@@@@@ @@@@@@@@37@@@" puts_red "@ @@@@@ @@@@@@@@@@@@@" puts_red "@ @@@@@ @@@@ @@@@" puts_red "@ @@@@@ @@@@ @@" puts_red "@ @@@@ @@@@@@ @" puts_red "@ @@@@@@@ @@@@@@ @" puts_red "@ @@ @@@@@@ @@@@@@ @" puts_red "@ @@@@ @@@@ @@" puts_red "@@ @@@@@ @@@@@ @@@@" puts_red "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" puts_red "@@@@@@@@ https://www.rubidium.io @@@@@@@@@" puts_red "@@@@@@@@@@@@@@ 85.4678 @@@@@@@@@@@@@@@@@@" puts_red "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" puts "" puts "" # Checks for unstagged commits return_message = "There are unstaged commits. Do you want to continue?" return if !run("git diff --no-patch --exit-code") && no?(return_message) # TEMPLATE START # frozen_string_literal: true def yarn(lib) run("yarn add #{lib}") end run("yarn install") generate(:controller, 'bootstrap', 'index') yarn 'jquery' yarn 'popper.js' yarn 'bootstrap' inject_into_file 'config/webpack/environment.js', after: "const { environment } = require('@rails/webpacker')\n" do <<~EOF const webpack = require('webpack') environment.plugins.append('Provide', new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery', Popper: ['popper.js', 'default'] })) EOF end inject_into_file 'app/javascript/packs/application.js', after: "require(\"channels\")\n" do <<~EOF import 'bootstrap/dist/js/bootstrap' import 'bootstrap/dist/css/bootstrap' EOF end inject_into_file 'app/views/bootstrap/index.html.erb', after: "

Find me in app/views/bootstrap/index.html.erb

\n" do <<~EOF
Loading...
EOF end say "all done. start your server and navigate to http://localhost:3000/bootstrap/index to test that it's working" # TEMPLATE END puts "" puts "" puts_green "Template Name: Bootstrap v4" puts_green "By: Dave Kimura (https://www.rubidium.io/profiles/dave-kimura)" puts_green "https://www.rubidium.io/templates/bootstrap-v4"