# Rails Application Template # Apply all uncommitted changes # Download custom .rubocop.yml from URL get 'https://gist.gyozaguy.dev/GyozaGuy/cdd6fa0cc913430d8951de685f840e6a/raw/HEAD/.rubocop.yml', '.rubocop.yml' # Remove omakase rubocop gem and add standard rubocop gsub_file 'Gemfile', /^\s+# Omakase Ruby styling.*\n\s+gem ['"]rubocop-rails-omakase['"], require: false\n/m, '' insert_into_file 'Gemfile', " gem 'rubocop'\n", after: "group :development do\n" # Define custom git source shorthand :gg # This allows gems to be specified with `gem 'name', gg: 'repo'` syntax insert_into_file 'Gemfile', "\ngit_source(:gg) { |repo| \"https://git.gyozaguy.com/\#{repo}.git\" }\n", after: 'source "https://rubygems.org"' # Add dumpling gem using the custom :gg git source shorthand # This will fetch the gem from https://git.gyozaguy.com/GyozaGuy/dumpling.git gem 'dumpling', gg: 'GyozaGuy/dumpling' # Create application_layout.rb file 'app/views/layouts/application_layout.rb', <<~RUBY class Layouts::ApplicationLayout < Components::Layout def view_template(&) doctype html(**locale_props, **theme_props(theme: 'dark')) { head { title { "\#{content_for(:page_title) || 'Loading...'} :: Replace Me" } default_meta link(href: '/icon.png', rel: 'icon', type: 'image/png') link(href: '/icon.svg', rel: 'icon', type: 'image/svg+xml') link(href: '/icon.png', rel: 'apple-touch-icon') default_stylesheets default_javascript } body(id: page_id) { main(&) } } end end RUBY # Modify application_controller.rb gsub_file 'app/controllers/application_controller.rb', 'class ApplicationController < ActionController::Base', 'class ApplicationController < Dumpling::ApplicationController' # Run RuboCop auto-correct to standardize quotes and other style issues after_bundle do say 'Running RuboCop auto-correct to standardize quotes and other style issues...' run 'bundle exec rubocop -a' say 'RuboCop auto-correction completed!' end # Remove default application.html.erb layout as we're using application_layout.rb instead remove_file 'app/views/layouts/application.html.erb' puts 'Template applied successfully!' puts 'Remember to run bundle install to update your gems'