Sha256: 9217ab93f3cd6ecef71b5aa1a77c35f36c1ea939619eee0fb426eef6d38e5b96

Contents?: true

Size: 1.47 KB

Versions: 24

Compression:

Stored size: 1.47 KB

Contents

# frozen_string_literal: true

# Rails 7 using Tailwind CSS and Reusable Styles

require 'pry'

self.local_template_path = File.join(File.dirname(__FILE__), File.basename(__FILE__, '.*'))

gac 'base rails 7 image created'

add_controller('home', 'index', 'bootstrap', 'tailwind')
route("root 'home#index'")

css_install('tailwind')
css_install('bootstrap')

force_copy

copy_file   'home/index.html.erb'       , 'app/views/home/index.html.erb'
copy_file   'home/bootstrap.html.erb'   , 'app/views/home/bootstrap.html.erb'
copy_file   'home/tailwind.html.erb'    , 'app/views/home/tailwind.html.erb'
copy_file   'home/_example.html.erb'    , 'app/views/home/_example.html.erb'
copy_file   'home/home_controller.rb'   , 'app/controllers/home_controller.rb'

copy_file   'application.html.erb'      , 'app/views/layouts/application.html.erb'
copy_file   'application_controller.rb' , 'app/controllers/application_controller.rb'
copy_file   'application.tailwind.css'  , 'app/assets/stylesheets/application.tailwind.css'
copy_file   'Procfile.dev'              , 'Procfile.dev'

replacement_script = <<-JSON
    "build:css_bootstrap": "sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application_bootstrap.css --no-source-map --load-path=node_modules",
    "build:css_tailwind": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application_tailwind.css --minify"
JSON

gsub_file   'package.json', /^(.*?)"build:css"(.*?)$/, replacement_script


Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rails_app_generator-0.2.0 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.28 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.27 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.26 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.25 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.24 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.23 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.22 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.21 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.20 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.19 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.18 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.17 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.16 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.15 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.14 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.13 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.12 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.11 after_templates/rag_tailwind_emulating_bootstrap.rb
rails_app_generator-0.1.10 after_templates/rag_tailwind_emulating_bootstrap.rb