├── .codeclimate.yml ├── .eslintignore ├── .eslintrc.cjs ├── .github ├── dependabot.yml └── workflows │ ├── ci.yml │ ├── lint.yml │ └── security.yml ├── .gitignore ├── .rspec ├── .rubocop.yml ├── .ruby-version ├── .slim-lint.yml ├── .slugignore ├── .stylelintrc ├── CHANGELOG.md ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── Procfile ├── README.md ├── Rakefile ├── THIRD-PARTY-LICENSES ├── VERSION ├── app.json ├── app ├── assets │ ├── config │ │ └── manifest.js │ ├── images │ │ └── .keep │ └── stylesheets │ │ └── application.css ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── controllers │ ├── application_controller.rb │ ├── concerns │ │ └── .keep │ └── pages_controller.rb ├── helpers │ └── application_helper.rb ├── javascript │ ├── channels │ │ ├── consumer.js │ │ └── index.js │ ├── images │ │ └── .keep │ ├── packs │ │ ├── application.js │ │ └── application.scss │ ├── src │ │ ├── .keep │ │ ├── bootstrap.js │ │ └── fontawesome.js │ └── stylesheets │ │ ├── bootstrap-variables-dark.scss │ │ ├── bootstrap-variables.scss │ │ ├── bootstrap.scss │ │ └── turbo-progress-bar.scss ├── jobs │ └── application_job.rb ├── mailers │ └── application_mailer.rb ├── models │ ├── application_record.rb │ └── concerns │ │ └── .keep └── views │ ├── layouts │ ├── application.html.slim │ ├── mailer.html.slim │ └── mailer.text.erb │ ├── pages │ ├── hello_world.html.slim │ └── home.html.slim │ └── shared │ ├── _footer.html.slim │ └── _navbar.html.slim ├── bin ├── bundle ├── rails ├── rake ├── setup ├── shakapacker ├── shakapacker-dev-server └── spring ├── config.ru ├── config ├── application.rb ├── boot.rb ├── cable.yml ├── credentials.yml.enc ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── application_controller_renderer.rb │ ├── backtrace_silencers.rb │ ├── content_security_policy.rb │ ├── cookies_serializer.rb │ ├── feature_policy.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── permissions_policy.rb │ └── wrap_parameters.rb ├── locales │ └── en.yml ├── newrelic.yml ├── puma.rb ├── routes.rb ├── shakapacker.yml ├── spring.rb ├── storage.yml └── webpack │ ├── development.js │ └── webpack.config.js ├── db ├── schema.rb └── seeds.rb ├── lib ├── assets │ └── .keep └── tasks │ ├── .keep │ ├── lint.rake │ ├── rubocop.rake │ ├── slim_lint.rake │ └── yarn_linters.rake ├── log └── .keep ├── package.json ├── postcss.config.js ├── public ├── 404.html ├── 422.html ├── 500.html ├── favicon.ico ├── launcher-icon-180.png ├── launcher-icon-192.png ├── launcher-icon-512.png ├── manifest.json └── robots.txt ├── spec ├── rails_helper.rb ├── spec_helper.rb ├── support │ ├── capybara.rb │ ├── factory_bot.rb │ ├── mailer_macros.rb │ ├── selenium_browser_error_reporter.rb │ └── shoulda_matchers.rb └── system │ └── pages_spec.rb ├── storage └── .keep ├── tmp ├── .keep └── pids │ └── .keep ├── vendor └── .keep └── yarn.lock /.codeclimate.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | exclude_patterns: 3 | - 'config/' 4 | - 'db/' 5 | - '**/node_modules/' 6 | - '**/spec/' 7 | - '**/vendor/' 8 | - 'postcss.config.js' 9 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /app/assets/config/manifest.js 2 | /app/assets/javascript/**/vendor/*.js 3 | /config/**/*.js 4 | -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: [ 4 | 'standard' 5 | ], 6 | settings: { 7 | 'import/resolver': { 8 | node: { 9 | paths: ['app/javascript'] 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | schedule: 6 | interval: weekly 7 | - package-ecosystem: bundler 8 | directory: "/" 9 | schedule: 10 | interval: weekly 11 | open-pull-requests-limit: 10 12 | groups: 13 | rubocop: 14 | patterns: 15 | - "rubocop*" 16 | ignore: 17 | - dependency-name: rails 18 | versions: ">= 7.0.0" 19 | - dependency-name: rspec-rails 20 | versions: ">= 7.0.0" 21 | - dependency-name: turbo-rails 22 | versions: ">= 2.0.13" 23 | - package-ecosystem: npm 24 | directory: "/" 25 | schedule: 26 | interval: weekly 27 | open-pull-requests-limit: 10 28 | groups: 29 | babel: 30 | patterns: 31 | - "@babel/*" 32 | fontawesome: 33 | patterns: 34 | - "@fortawesome/*" 35 | rails: 36 | patterns: 37 | - "@rails/*" 38 | webpack: 39 | patterns: 40 | - "webpack*" 41 | ignore: 42 | - dependency-name: "@rails/*" 43 | versions: ">= 7.0.0" 44 | - dependency-name: "@types/express" 45 | versions: ">= 5.0.0" 46 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | # TODO: Don't do this! Use GitHub's encrypted secrets and set the value of the 4 | # variable as ${{ secrets.RAILS_MASTER_KEY }} 5 | # Ref: https://docs.github.com/en/actions/reference/encrypted-secrets 6 | env: 7 | RAILS_MASTER_KEY: 02a9ea770b4985659e8ce92699f218dc 8 | 9 | on: 10 | push: 11 | branches: [ main ] 12 | pull_request: 13 | branches: [ main ] 14 | 15 | permissions: 16 | contents: read 17 | 18 | jobs: 19 | test: 20 | name: Ruby specs 21 | runs-on: ubuntu-latest 22 | 23 | env: 24 | DATABASE_URL: postgres://postgres:postgres@localhost/ruby3_rails6_bootstrap_heroku_test 25 | RAILS_ENV: test 26 | 27 | services: 28 | db: 29 | image: postgres:12 30 | ports: ['5432:5432'] 31 | env: 32 | POSTGRES_PASSWORD: postgres 33 | 34 | options: >- 35 | --health-cmd pg_isready 36 | --health-interval 10s 37 | --health-timeout 5s 38 | --health-retries 5 39 | 40 | steps: 41 | - uses: actions/checkout@v4 42 | - name: Set up Ruby 43 | uses: ruby/setup-ruby@v1 44 | with: 45 | ruby-version: .ruby-version 46 | bundler-cache: true 47 | rubygems: latest 48 | - name: Set up Node 49 | uses: actions/setup-node@v4 50 | with: 51 | node-version: '22' 52 | cache: 'yarn' 53 | - name: Yarn 54 | run: yarn 55 | - name: Set up Database 56 | run: bundle exec rails db:prepare 57 | - name: Run specs 58 | run: bundle exec rake spec 59 | - name: Coveralls 60 | uses: coverallsapp/github-action@v2 61 | with: 62 | github-token: ${{ secrets.github_token }} 63 | path-to-lcov: 'coverage/lcov.info' 64 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | permissions: 10 | contents: read 11 | 12 | jobs: 13 | lint: 14 | name: Lint 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v4 19 | - name: Set up Ruby 20 | uses: ruby/setup-ruby@v1 21 | with: 22 | ruby-version: .ruby-version 23 | bundler-cache: true 24 | rubygems: latest 25 | - name: Set up Node 26 | uses: actions/setup-node@v4 27 | with: 28 | node-version: '22' 29 | cache: 'yarn' 30 | - name: Yarn 31 | run: yarn 32 | - name: Run lints 33 | run: bundle exec rake lint 34 | -------------------------------------------------------------------------------- /.github/workflows/security.yml: -------------------------------------------------------------------------------- 1 | name: Security Audits 2 | 3 | on: 4 | schedule: 5 | - cron: '30 8 * * 5' 6 | 7 | permissions: 8 | contents: read 9 | 10 | jobs: 11 | bundle_audit: 12 | name: Bundle audit 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | - name: Set up Ruby 18 | uses: ruby/setup-ruby@v1 19 | with: 20 | ruby-version: .ruby-version 21 | bundler-cache: false 22 | - name: Bundle audit 23 | run: | 24 | gem install bundler-audit 25 | bundle audit check --update 26 | 27 | bundle_leak: 28 | name: Bundle leak 29 | runs-on: ubuntu-latest 30 | 31 | steps: 32 | - uses: actions/checkout@v4 33 | - name: Set up Ruby 34 | uses: ruby/setup-ruby@v1 35 | with: 36 | ruby-version: .ruby-version 37 | bundler-cache: false 38 | rubygems: latest 39 | - name: Bundle leak 40 | run: | 41 | gem install bundler-leak 42 | bundle leak check --update 43 | 44 | yarn_audit: 45 | name: Yarn audit 46 | runs-on: ubuntu-latest 47 | 48 | steps: 49 | - uses: actions/checkout@v4 50 | - name: Set up Node 51 | uses: actions/setup-node@v4 52 | with: 53 | node-version: '22' 54 | - name: Yarn audit 55 | run: | 56 | yarn audit 57 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore all logfiles and tempfiles. 11 | /log/* 12 | /tmp/* 13 | !/log/.keep 14 | !/tmp/.keep 15 | !/tmp/pids/.keep 16 | 17 | # Ignore uploaded files in development. 18 | /storage/* 19 | !/storage/.keep 20 | 21 | /public/assets 22 | .byebug_history 23 | 24 | # Ignore master key for decrypting credentials and more. 25 | /config/master.key 26 | 27 | /public/packs 28 | /public/packs-test 29 | /node_modules 30 | /yarn-error.log 31 | yarn-debug.log* 32 | .yarn-integrity 33 | 34 | /coverage/* 35 | /spec/examples.txt 36 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | plugins: 2 | - rubocop-capybara 3 | - rubocop-factory_bot 4 | - rubocop-performance 5 | - rubocop-rails 6 | - rubocop-rspec 7 | - rubocop-rspec_rails 8 | 9 | AllCops: 10 | TargetRailsVersion: 6.1 11 | TargetRubyVersion: 3.0 12 | NewCops: enable 13 | DisplayStyleGuide: true 14 | ExtraDetails: true 15 | Exclude: 16 | - '.git/**/*' 17 | - 'bin/*' 18 | - 'db/**/*' 19 | - 'log/**/*' 20 | - 'node_modules/**/*' 21 | - 'public/**/*' 22 | - 'tmp/**/*' 23 | - 'vendor/**/*' 24 | 25 | Layout/LineLength: 26 | Enabled: false 27 | 28 | Metrics/BlockLength: 29 | Enabled: false 30 | 31 | Metrics/MethodLength: 32 | Exclude: 33 | - 'spec/**/*' 34 | 35 | Metrics/ModuleLength: 36 | Exclude: 37 | - 'spec/**/*' 38 | 39 | RSpec/DescribeClass: 40 | Exclude: 41 | - 'spec/features/**/*' 42 | - 'spec/requests/**/*' 43 | - 'spec/system/**/*' 44 | 45 | Style/Documentation: 46 | Enabled: false 47 | 48 | Style/IfUnlessModifier: 49 | Enabled: false 50 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 3.1.7 2 | -------------------------------------------------------------------------------- /.slim-lint.yml: -------------------------------------------------------------------------------- 1 | exclude: 2 | - 'vendor/bundle/**/*.slim' 3 | 4 | linters: 5 | LineLength: 6 | enabled: false 7 | -------------------------------------------------------------------------------- /.slugignore: -------------------------------------------------------------------------------- 1 | spec 2 | CHANGELOG.md 3 | LICENSE 4 | README.md 5 | THIRD-PARTY-LICENSES 6 | VERSION 7 | -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "stylelint-config-twbs-bootstrap" 4 | ], 5 | "plugins": [ 6 | "stylelint-order" 7 | ], 8 | "rules": { 9 | "at-rule-empty-line-before": ["always", { 10 | "except": ["after-same-name", "first-nested"], 11 | "ignore": ["after-comment"] 12 | }], 13 | "declaration-empty-line-before": ["always", { 14 | "except": ["first-nested"], 15 | "ignore": ["after-comment", "after-declaration"] 16 | }], 17 | "rule-empty-line-before": ["always", { 18 | "except": ["first-nested"], 19 | "ignore": ["after-comment"] 20 | }], 21 | "selector-class-pattern": "^[a-z][a-z0-9\\-_]*[a-z0-9]$", 22 | "@stylistic/block-closing-brace-empty-line-before": "never" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 3.0.0 / 2020-12-27 4 | 5 | * [FEATURE] First public release 6 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 5 | 6 | gem 'rails', '6.1.7.10' 7 | 8 | gem 'bootsnap', '~> 1.18', require: false 9 | gem 'concurrent-ruby', '< 1.3.5' # rails/rails#54260 10 | gem 'newrelic_rpm', '~> 9.19' 11 | gem 'pg', '~> 1.4.6' 12 | gem 'puma', '~> 6.6' 13 | gem 'shakapacker', '8.3.0' 14 | gem 'slim-rails', '~> 3.7' 15 | gem 'turbo-rails', '~> 2.0' 16 | 17 | group :development, :test do 18 | gem 'byebug', platforms: %i[mri mingw x64_mingw] 19 | gem 'factory_bot_rails' 20 | gem 'faker' 21 | gem 'pry' 22 | gem 'pry-byebug' 23 | gem 'pry-rails' 24 | gem 'rspec-rails' 25 | gem 'rubocop', require: false 26 | gem 'rubocop-capybara', require: false 27 | gem 'rubocop-factory_bot', require: false 28 | gem 'rubocop-performance', require: false 29 | gem 'rubocop-rails', require: false 30 | gem 'rubocop-rspec', require: false 31 | gem 'rubocop-rspec_rails', require: false 32 | gem 'slim_lint', require: false 33 | end 34 | 35 | group :development do 36 | gem 'listen' 37 | gem 'spring', '~> 4.2.0' # TODO: investigate issue 38 | gem 'spring-commands-rspec' 39 | gem 'spring-watcher-listen' 40 | gem 'web-console' 41 | end 42 | 43 | group :test do 44 | gem 'capybara' 45 | gem 'email_spec' 46 | gem 'selenium-webdriver' 47 | gem 'shoulda-matchers' 48 | gem 'simplecov', require: false 49 | gem 'simplecov-lcov', require: false 50 | gem 'webmock', require: false 51 | end 52 | 53 | group :production do 54 | gem 'rack-timeout', '~> 0.7.0' 55 | end 56 | 57 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 58 | gem 'tzinfo-data', '~> 1.2019', platforms: %i[mingw mswin x64_mingw jruby] 59 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actioncable (6.1.7.10) 5 | actionpack (= 6.1.7.10) 6 | activesupport (= 6.1.7.10) 7 | nio4r (~> 2.0) 8 | websocket-driver (>= 0.6.1) 9 | actionmailbox (6.1.7.10) 10 | actionpack (= 6.1.7.10) 11 | activejob (= 6.1.7.10) 12 | activerecord (= 6.1.7.10) 13 | activestorage (= 6.1.7.10) 14 | activesupport (= 6.1.7.10) 15 | mail (>= 2.7.1) 16 | actionmailer (6.1.7.10) 17 | actionpack (= 6.1.7.10) 18 | actionview (= 6.1.7.10) 19 | activejob (= 6.1.7.10) 20 | activesupport (= 6.1.7.10) 21 | mail (~> 2.5, >= 2.5.4) 22 | rails-dom-testing (~> 2.0) 23 | actionpack (6.1.7.10) 24 | actionview (= 6.1.7.10) 25 | activesupport (= 6.1.7.10) 26 | rack (~> 2.0, >= 2.0.9) 27 | rack-test (>= 0.6.3) 28 | rails-dom-testing (~> 2.0) 29 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 30 | actiontext (6.1.7.10) 31 | actionpack (= 6.1.7.10) 32 | activerecord (= 6.1.7.10) 33 | activestorage (= 6.1.7.10) 34 | activesupport (= 6.1.7.10) 35 | nokogiri (>= 1.8.5) 36 | actionview (6.1.7.10) 37 | activesupport (= 6.1.7.10) 38 | builder (~> 3.1) 39 | erubi (~> 1.4) 40 | rails-dom-testing (~> 2.0) 41 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 42 | activejob (6.1.7.10) 43 | activesupport (= 6.1.7.10) 44 | globalid (>= 0.3.6) 45 | activemodel (6.1.7.10) 46 | activesupport (= 6.1.7.10) 47 | activerecord (6.1.7.10) 48 | activemodel (= 6.1.7.10) 49 | activesupport (= 6.1.7.10) 50 | activestorage (6.1.7.10) 51 | actionpack (= 6.1.7.10) 52 | activejob (= 6.1.7.10) 53 | activerecord (= 6.1.7.10) 54 | activesupport (= 6.1.7.10) 55 | marcel (~> 1.0) 56 | mini_mime (>= 1.1.0) 57 | activesupport (6.1.7.10) 58 | concurrent-ruby (~> 1.0, >= 1.0.2) 59 | i18n (>= 1.6, < 2) 60 | minitest (>= 5.1) 61 | tzinfo (~> 2.0) 62 | zeitwerk (~> 2.3) 63 | addressable (2.8.7) 64 | public_suffix (>= 2.0.2, < 7.0) 65 | ast (2.4.3) 66 | base64 (0.3.0) 67 | bigdecimal (3.2.2) 68 | bindex (0.8.1) 69 | bootsnap (1.18.6) 70 | msgpack (~> 1.2) 71 | builder (3.3.0) 72 | byebug (12.0.0) 73 | capybara (3.40.0) 74 | addressable 75 | matrix 76 | mini_mime (>= 0.1.3) 77 | nokogiri (~> 1.11) 78 | rack (>= 1.6.0) 79 | rack-test (>= 0.6.3) 80 | regexp_parser (>= 1.5, < 3.0) 81 | xpath (~> 3.2) 82 | childprocess (5.1.0) 83 | logger (~> 1.5) 84 | coderay (1.1.3) 85 | concurrent-ruby (1.3.4) 86 | crack (1.0.0) 87 | bigdecimal 88 | rexml 89 | crass (1.0.6) 90 | date (3.4.1) 91 | diff-lcs (1.6.2) 92 | docile (1.4.1) 93 | email_spec (2.3.0) 94 | htmlentities (~> 4.3.3) 95 | launchy (>= 2.1, < 4.0) 96 | mail (~> 2.7) 97 | erubi (1.13.1) 98 | factory_bot (6.5.3) 99 | activesupport (>= 6.1.0) 100 | factory_bot_rails (6.4.4) 101 | factory_bot (~> 6.5) 102 | railties (>= 5.0.0) 103 | faker (3.5.1) 104 | i18n (>= 1.8.11, < 2) 105 | ffi (1.17.2) 106 | ffi (1.17.2-x86_64-linux-gnu) 107 | globalid (1.2.1) 108 | activesupport (>= 6.1) 109 | hashdiff (1.2.0) 110 | htmlentities (4.3.4) 111 | i18n (1.14.7) 112 | concurrent-ruby (~> 1.0) 113 | json (2.12.2) 114 | language_server-protocol (3.17.0.5) 115 | launchy (3.1.1) 116 | addressable (~> 2.8) 117 | childprocess (~> 5.0) 118 | logger (~> 1.6) 119 | lint_roller (1.1.0) 120 | listen (3.9.0) 121 | rb-fsevent (~> 0.10, >= 0.10.3) 122 | rb-inotify (~> 0.9, >= 0.9.10) 123 | logger (1.7.0) 124 | loofah (2.24.1) 125 | crass (~> 1.0.2) 126 | nokogiri (>= 1.12.0) 127 | mail (2.8.1) 128 | mini_mime (>= 0.1.1) 129 | net-imap 130 | net-pop 131 | net-smtp 132 | marcel (1.0.4) 133 | matrix (0.4.2) 134 | method_source (1.1.0) 135 | mini_mime (1.1.5) 136 | mini_portile2 (2.8.9) 137 | minitest (5.25.5) 138 | msgpack (1.8.0) 139 | net-imap (0.5.8) 140 | date 141 | net-protocol 142 | net-pop (0.1.2) 143 | net-protocol 144 | net-protocol (0.2.2) 145 | timeout 146 | net-smtp (0.5.1) 147 | net-protocol 148 | newrelic_rpm (9.19.0) 149 | nio4r (2.7.4) 150 | nokogiri (1.18.8) 151 | mini_portile2 (~> 2.8.2) 152 | racc (~> 1.4) 153 | nokogiri (1.18.8-x86_64-linux-gnu) 154 | racc (~> 1.4) 155 | package_json (0.1.0) 156 | parallel (1.27.0) 157 | parser (3.3.8.0) 158 | ast (~> 2.4.1) 159 | racc 160 | pg (1.4.6) 161 | prism (1.4.0) 162 | pry (0.15.2) 163 | coderay (~> 1.1) 164 | method_source (~> 1.0) 165 | pry-byebug (3.11.0) 166 | byebug (~> 12.0) 167 | pry (>= 0.13, < 0.16) 168 | pry-rails (0.3.11) 169 | pry (>= 0.13.0) 170 | public_suffix (6.0.2) 171 | puma (6.6.0) 172 | nio4r (~> 2.0) 173 | racc (1.8.1) 174 | rack (2.2.17) 175 | rack-proxy (0.7.7) 176 | rack 177 | rack-test (2.2.0) 178 | rack (>= 1.3) 179 | rack-timeout (0.7.0) 180 | rails (6.1.7.10) 181 | actioncable (= 6.1.7.10) 182 | actionmailbox (= 6.1.7.10) 183 | actionmailer (= 6.1.7.10) 184 | actionpack (= 6.1.7.10) 185 | actiontext (= 6.1.7.10) 186 | actionview (= 6.1.7.10) 187 | activejob (= 6.1.7.10) 188 | activemodel (= 6.1.7.10) 189 | activerecord (= 6.1.7.10) 190 | activestorage (= 6.1.7.10) 191 | activesupport (= 6.1.7.10) 192 | bundler (>= 1.15.0) 193 | railties (= 6.1.7.10) 194 | sprockets-rails (>= 2.0.0) 195 | rails-dom-testing (2.3.0) 196 | activesupport (>= 5.0.0) 197 | minitest 198 | nokogiri (>= 1.6) 199 | rails-html-sanitizer (1.6.2) 200 | loofah (~> 2.21) 201 | nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) 202 | railties (6.1.7.10) 203 | actionpack (= 6.1.7.10) 204 | activesupport (= 6.1.7.10) 205 | method_source 206 | rake (>= 12.2) 207 | thor (~> 1.0) 208 | rainbow (3.1.1) 209 | rake (13.3.0) 210 | rb-fsevent (0.11.2) 211 | rb-inotify (0.11.1) 212 | ffi (~> 1.0) 213 | regexp_parser (2.10.0) 214 | rexml (3.4.1) 215 | rspec-core (3.13.4) 216 | rspec-support (~> 3.13.0) 217 | rspec-expectations (3.13.5) 218 | diff-lcs (>= 1.2.0, < 2.0) 219 | rspec-support (~> 3.13.0) 220 | rspec-mocks (3.13.5) 221 | diff-lcs (>= 1.2.0, < 2.0) 222 | rspec-support (~> 3.13.0) 223 | rspec-rails (6.1.5) 224 | actionpack (>= 6.1) 225 | activesupport (>= 6.1) 226 | railties (>= 6.1) 227 | rspec-core (~> 3.13) 228 | rspec-expectations (~> 3.13) 229 | rspec-mocks (~> 3.13) 230 | rspec-support (~> 3.13) 231 | rspec-support (3.13.4) 232 | rubocop (1.76.1) 233 | json (~> 2.3) 234 | language_server-protocol (~> 3.17.0.2) 235 | lint_roller (~> 1.1.0) 236 | parallel (~> 1.10) 237 | parser (>= 3.3.0.2) 238 | rainbow (>= 2.2.2, < 4.0) 239 | regexp_parser (>= 2.9.3, < 3.0) 240 | rubocop-ast (>= 1.45.0, < 2.0) 241 | ruby-progressbar (~> 1.7) 242 | unicode-display_width (>= 2.4.0, < 4.0) 243 | rubocop-ast (1.45.1) 244 | parser (>= 3.3.7.2) 245 | prism (~> 1.4) 246 | rubocop-capybara (2.22.1) 247 | lint_roller (~> 1.1) 248 | rubocop (~> 1.72, >= 1.72.1) 249 | rubocop-factory_bot (2.27.1) 250 | lint_roller (~> 1.1) 251 | rubocop (~> 1.72, >= 1.72.1) 252 | rubocop-performance (1.25.0) 253 | lint_roller (~> 1.1) 254 | rubocop (>= 1.75.0, < 2.0) 255 | rubocop-ast (>= 1.38.0, < 2.0) 256 | rubocop-rails (2.32.0) 257 | activesupport (>= 4.2.0) 258 | lint_roller (~> 1.1) 259 | rack (>= 1.1) 260 | rubocop (>= 1.75.0, < 2.0) 261 | rubocop-ast (>= 1.44.0, < 2.0) 262 | rubocop-rspec (3.6.0) 263 | lint_roller (~> 1.1) 264 | rubocop (~> 1.72, >= 1.72.1) 265 | rubocop-rspec_rails (2.31.0) 266 | lint_roller (~> 1.1) 267 | rubocop (~> 1.72, >= 1.72.1) 268 | rubocop-rspec (~> 3.5) 269 | ruby-progressbar (1.13.0) 270 | rubyzip (2.4.1) 271 | selenium-webdriver (4.32.0) 272 | base64 (~> 0.2) 273 | logger (~> 1.4) 274 | rexml (~> 3.2, >= 3.2.5) 275 | rubyzip (>= 1.2.2, < 3.0) 276 | websocket (~> 1.0) 277 | semantic_range (3.1.0) 278 | shakapacker (8.3.0) 279 | activesupport (>= 5.2) 280 | package_json 281 | rack-proxy (>= 0.6.1) 282 | railties (>= 5.2) 283 | semantic_range (>= 2.3.0) 284 | shoulda-matchers (6.5.0) 285 | activesupport (>= 5.2.0) 286 | simplecov (0.22.0) 287 | docile (~> 1.1) 288 | simplecov-html (~> 0.11) 289 | simplecov_json_formatter (~> 0.1) 290 | simplecov-html (0.13.1) 291 | simplecov-lcov (0.8.0) 292 | simplecov_json_formatter (0.1.4) 293 | slim (5.2.1) 294 | temple (~> 0.10.0) 295 | tilt (>= 2.1.0) 296 | slim-rails (3.7.0) 297 | actionpack (>= 3.1) 298 | railties (>= 3.1) 299 | slim (>= 3.0, < 6.0, != 5.0.0) 300 | slim_lint (0.33.0) 301 | rexml (~> 3.2) 302 | rubocop (>= 1.0, < 2.0) 303 | slim (>= 3.0, < 6.0) 304 | spring (4.2.1) 305 | spring-commands-rspec (1.0.4) 306 | spring (>= 0.9.1) 307 | spring-watcher-listen (2.1.0) 308 | listen (>= 2.7, < 4.0) 309 | spring (>= 4) 310 | sprockets (4.2.2) 311 | concurrent-ruby (~> 1.0) 312 | logger 313 | rack (>= 2.2.4, < 4) 314 | sprockets-rails (3.5.2) 315 | actionpack (>= 6.1) 316 | activesupport (>= 6.1) 317 | sprockets (>= 3.0.0) 318 | temple (0.10.3) 319 | thor (1.3.2) 320 | tilt (2.6.0) 321 | timeout (0.4.3) 322 | turbo-rails (2.0.12) 323 | actionpack (>= 6.0.0) 324 | railties (>= 6.0.0) 325 | tzinfo (2.0.6) 326 | concurrent-ruby (~> 1.0) 327 | unicode-display_width (3.1.4) 328 | unicode-emoji (~> 4.0, >= 4.0.4) 329 | unicode-emoji (4.0.4) 330 | web-console (4.2.1) 331 | actionview (>= 6.0.0) 332 | activemodel (>= 6.0.0) 333 | bindex (>= 0.4.0) 334 | railties (>= 6.0.0) 335 | webmock (3.25.1) 336 | addressable (>= 2.8.0) 337 | crack (>= 0.3.2) 338 | hashdiff (>= 0.4.0, < 2.0.0) 339 | websocket (1.2.11) 340 | websocket-driver (0.8.0) 341 | base64 342 | websocket-extensions (>= 0.1.0) 343 | websocket-extensions (0.1.5) 344 | xpath (3.2.0) 345 | nokogiri (~> 1.8) 346 | zeitwerk (2.6.18) 347 | 348 | PLATFORMS 349 | ruby 350 | x86_64-linux 351 | 352 | DEPENDENCIES 353 | bootsnap (~> 1.18) 354 | byebug 355 | capybara 356 | concurrent-ruby (< 1.3.5) 357 | email_spec 358 | factory_bot_rails 359 | faker 360 | listen 361 | newrelic_rpm (~> 9.19) 362 | pg (~> 1.4.6) 363 | pry 364 | pry-byebug 365 | pry-rails 366 | puma (~> 6.6) 367 | rack-timeout (~> 0.7.0) 368 | rails (= 6.1.7.10) 369 | rspec-rails 370 | rubocop 371 | rubocop-capybara 372 | rubocop-factory_bot 373 | rubocop-performance 374 | rubocop-rails 375 | rubocop-rspec 376 | rubocop-rspec_rails 377 | selenium-webdriver 378 | shakapacker (= 8.3.0) 379 | shoulda-matchers 380 | simplecov 381 | simplecov-lcov 382 | slim-rails (~> 3.7) 383 | slim_lint 384 | spring (~> 4.2.0) 385 | spring-commands-rspec 386 | spring-watcher-listen 387 | turbo-rails (~> 2.0) 388 | tzinfo-data (~> 1.2019) 389 | web-console 390 | webmock 391 | 392 | BUNDLED WITH 393 | 2.6.9 394 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2023, diowa 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec puma -C config/puma.rb 2 | release: bundle exec rails db:migrate 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rails 6 Starter App 2 | [![Build Status](https://github.com/diowa/ruby3-rails6-bootstrap-heroku/actions/workflows/ci.yml/badge.svg)](https://github.com/diowa/ruby3-rails6-bootstrap-heroku/actions) 3 | [![Code Climate](https://codeclimate.com/github/diowa/ruby3-rails6-bootstrap-heroku/badges/gpa.svg)](https://codeclimate.com/github/diowa/ruby3-rails6-bootstrap-heroku) 4 | [![Coverage Status](https://coveralls.io/repos/github/diowa/ruby3-rails6-bootstrap-heroku/badge.svg?branch=main)](https://coveralls.io/github/diowa/ruby3-rails6-bootstrap-heroku?branch=main) 5 | 6 | [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) 7 | 8 | This is an opinionated starter web application based on the following technology stack: 9 | * [Ruby 3.1.7][:ruby-url] 10 | * [Rails 6.1.7.10][:ruby-on-rails-url] 11 | * [Webpack 5][:webpack-url] (via [Shakapacker][:shakapacker-url]) 12 | * [Yarn][:yarn-url] 13 | * [Puma][:puma-url] 14 | * [PostgreSQL][:postgresql-url] 15 | * [Redis][:redis-url] 16 | * [RSpec][:rspec-url] 17 | * [Bootstrap 5.3.6][:bootstrap-url] 18 | * [Autoprefixer][:autoprefixer-url] 19 | * [Font Awesome 6.7.2 SVG][:fontawesome-url] 20 | * [Slim][:slim-url] 21 | * [RuboCop][:rubocop-url] 22 | * [RuboCop RSpec][:rubocop-rspec-url] 23 | * [Slim-Lint][:slim-lint-url] 24 | * [stylelint][:stylelint-url] 25 | 26 | [:autoprefixer-url]: https://github.com/postcss/autoprefixer 27 | [:bootstrap-url]: https://getbootstrap.com/ 28 | [:fontawesome-url]: https://fontawesome.com/ 29 | [:postgresql-url]: https://www.postgresql.org/ 30 | [:puma-url]: https://puma.io/ 31 | [:redis-url]: https://redis.io/ 32 | [:rspec-url]: https://rspec.info/ 33 | [:rubocop-rspec-url]: https://github.com/backus/rubocop-rspec 34 | [:rubocop-url]: https://github.com/bbatsov/rubocop 35 | [:ruby-on-rails-url]: https://rubyonrails.org/ 36 | [:ruby-url]: https://www.ruby-lang.org/en/ 37 | [:shakapacker-url]: https://github.com/shakacode/shakapacker 38 | [:slim-lint-url]: https://github.com/sds/slim-lint 39 | [:slim-url]: http://slim-lang.com/ 40 | [:stylelint-url]: https://stylelint.io/ 41 | [:webpack-url]: https://webpack.js.org/ 42 | [:yarn-url]: https://yarnpkg.com/lang/en/ 43 | 44 | Starter App is deployable on [Heroku](https://www.heroku.com/). Demo: https://ruby3-rails6-bootstrap-heroku.herokuapp.com/ 45 | 46 | ```Gemfile``` also contains a set of useful gems for performance, security, api building... 47 | 48 | ### Thread safety 49 | 50 | We assume that this application is thread safe. If your application is not thread safe or you don't know, please set the minimum and maximum number of threads usable by puma on Heroku to 1: 51 | 52 | ```sh 53 | $ heroku config:set RAILS_MAX_THREADS=1 54 | ``` 55 | 56 | ### Master Key 57 | 58 | Rails 5.2 introduced [encrypted credentials](https://edgeguides.rubyonrails.org/5_2_release_notes.html#credentials). 59 | 60 | The master key used by this repository is: 61 | 62 | ``` 63 | 02a9ea770b4985659e8ce92699f218dc 64 | ``` 65 | 66 | **DO NOT SHARE YOUR MASTER KEY. CHANGE THIS MASTER KEY IF YOU ARE GOING TO USE THIS REPO FOR YOUR OWN PROJECT.** 67 | 68 | ### Heroku Platform API 69 | 70 | This application supports fast setup and deploy via [app.json](https://devcenter.heroku.com/articles/app-json-schema): 71 | 72 | ```sh 73 | $ curl -n -X POST https://api.heroku.com/app-setups \ 74 | -H "Content-Type:application/json" \ 75 | -H "Accept:application/vnd.heroku+json; version=3" \ 76 | -d '{"source_blob": { "url":"https://github.com/diowa/ruby3-rails6-bootstrap-heroku/tarball/main/"} }' 77 | ``` 78 | 79 | More information: [Setting Up Apps using the Platform API](https://devcenter.heroku.com/articles/setting-up-apps-using-the-heroku-platform-api) 80 | 81 | ### Recommended add-ons 82 | 83 | Heroku's [Production Check](https://blog.heroku.com/introducing_production_check) recommends the use of the following add-ons, here in the free version: 84 | 85 | ```sh 86 | $ heroku addons:create newrelic:wayne # App monitoring 87 | $ heroku config:set NEW_RELIC_APP_NAME="Rails 6 Starter App" # Set newrelic app name 88 | $ heroku addons:create papertrail:choklad # Log monitoring 89 | ``` 90 | 91 | ### Tuning Ruby's RGenGC 92 | 93 | Generational GC (called RGenGC) was introduced from Ruby 2.1.0. RGenGC reduces marking time dramatically (about x10 faster). However, RGenGC introduce huge memory consumption. This problem has impact especially for small memory machines. 94 | 95 | Ruby 2.1.1 introduced new environment variable RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR to control full GC timing. By setting this variable to a value lower than the default of 2 (we are using the suggested value of 1.3) you can indirectly force the garbage collector to perform more major GCs, which reduces heap growth. 96 | 97 | ```sh 98 | $ heroku config:set RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.3 99 | ``` 100 | 101 | More information: [Change the full GC timing](https://bugs.ruby-lang.org/issues/9607) 102 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Add your own tasks in files placed in lib/tasks ending in .rake, 4 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 5 | 6 | require_relative 'config/application' 7 | 8 | Rails.application.load_tasks 9 | -------------------------------------------------------------------------------- /THIRD-PARTY-LICENSES: -------------------------------------------------------------------------------- 1 | airbrake is licensed under the MIT License 2 | 3 | Autoprefixer Rails is licensed under the MIT License 4 | 5 | better_errors is licensed under the MIT License 6 | 7 | binding_of_caller is licensed under the MIT License 8 | 9 | Bootstrap is licensed under the MIT License 10 | 11 | bullet is licensed under the MIT License 12 | 13 | byebug is licensed under the MIT License 14 | 15 | Capybara is licensed under the MIT License 16 | 17 | Email Spec is licensed under the MIT License 18 | 19 | factory_bot_rails is licensed under the MIT License 20 | 21 | faker is licensed under the MIT License 22 | 23 | FontAwesome font is licensed under the SIL Open Font License 24 | 25 | FontAwesome is licensed under the MIT License 26 | 27 | FontAwesome pictograms are licensed under the CC BY 3.0 License 28 | 29 | kaminari is licensed under the MIT License 30 | 31 | meta_request is licensed under the MIT License 32 | 33 | newrelic_rpm is licensed under the MIT, Ruby and New Relic licenses 34 | 35 | pg is licensed under the BSD and Ruby licenses 36 | 37 | pry is licensed under the MIT License 38 | 39 | pry-byebug is licensed under the MIT License 40 | 41 | pry-rails is licensed under the MIT License 42 | 43 | puma is licensed under the BSD 3-Clause License 44 | 45 | Rack::Timeout is licensed under the MIT License 46 | 47 | Rails is licensed under the MIT License 48 | 49 | rspec is licensed under the MIT License 50 | 51 | rspec-rails is licensed under the MIT License 52 | 53 | RuboCop is licensed under the MIT License 54 | 55 | RuboCop RSpec is licensed under the MIT License 56 | 57 | sass-rails is licensed under the MIT License 58 | 59 | Secure Headers is licensed under the MIT License 60 | 61 | simplecov is licensed under the MIT License 62 | 63 | Slim-Lint is licensed under the MIT License 64 | 65 | slim-rails is licensed under the MIT License 66 | 67 | Spring is licensed under the MIT License 68 | 69 | spring_commands_rspec is licensed under the MIT License 70 | 71 | uglifier is licensed under the MIT License 72 | 73 | Web Console is licensed under the MIT License 74 | 75 | webmock is licensed under the MIT License 76 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 3.0.0 2 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Rails 6 Starter App", 3 | "description": "An opinionated starter application based on Ruby 3.0, Rails 6.1, Webpack 5, Yarn, and Bootstrap 5", 4 | "keywords": [ 5 | "Ruby 3.0", 6 | "Rails 6.1", 7 | "Webpack 5", 8 | "Bootstrap 5", 9 | "Font Awesome 6" 10 | ], 11 | "website": "https://ruby3-rails6-bootstrap-heroku.herokuapp.com/", 12 | "repository": "https://github.com/diowa/ruby3-rails6-bootstrap-heroku", 13 | "success_url": "/", 14 | "scripts": { 15 | "postdeploy": "bundle exec rails db:schema:load db:seed" 16 | }, 17 | "env": { 18 | "RAILS_MASTER_KEY": { 19 | "description": "Encryption key to decrypt credentials file", 20 | "value": "02a9ea770b4985659e8ce92699f218dc" 21 | }, 22 | "RAILS_ENV": "production", 23 | "RAILS_SERVE_STATIC_FILES": "enabled", 24 | "RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR": { 25 | "description": "Reduces RGenGC's memory consumption", 26 | "value": "1.3" 27 | }, 28 | "NEW_RELIC_APP_NAME": { 29 | "description": "Sets the name of your application as it will appear on the New Relic dashboard.", 30 | "value": "Rails 6 Starter App" 31 | }, 32 | "AIRBRAKE_HOST": { 33 | "description": "Airbrake host. (OPTIONAL)", 34 | "required": false 35 | } 36 | }, 37 | "addons": [ 38 | "heroku-postgresql:hobby-dev", 39 | "papertrail", 40 | "newrelic", 41 | "heroku-redis:hobby-dev" 42 | ], 43 | "buildpacks": [ 44 | { 45 | "url": "https://github.com/heroku/heroku-buildpack-activestorage-preview" 46 | }, 47 | { 48 | "url": "heroku/nodejs" 49 | }, 50 | { 51 | "url": "heroku/ruby" 52 | } 53 | ] 54 | } 55 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .css 3 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's 6 | * vendor/assets/stylesheets directory can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the 9 | * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS 10 | * files in this directory. Styles in this file should be added after the last require_* statement. 11 | * It is generally better to create a new file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ApplicationCable 4 | class Channel < ActionCable::Channel::Base 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ApplicationCable 4 | class Connection < ActionCable::Connection::Base 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationController < ActionController::Base 4 | end 5 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/pages_controller.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class PagesController < ApplicationController 4 | end 5 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module ApplicationHelper 4 | def page_title(title) 5 | content_for(:title) { title.to_s } 6 | end 7 | 8 | def page_meta_description(meta_description) 9 | content_for(:meta_description) { meta_description.to_s } 10 | end 11 | 12 | def yield_or_default(section, default = '') 13 | content_for?(section) ? content_for(section) : default 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /app/javascript/channels/consumer.js: -------------------------------------------------------------------------------- 1 | // Action Cable provides the framework to deal with WebSockets in Rails. 2 | // You can generate new channels where WebSocket features live using the `rails generate channel` command. 3 | 4 | import { createConsumer } from '@rails/actioncable' 5 | 6 | export default createConsumer() 7 | -------------------------------------------------------------------------------- /app/javascript/channels/index.js: -------------------------------------------------------------------------------- 1 | // Load all the channels within this directory and all subdirectories. 2 | // Channel files must be named *_channel.js. 3 | 4 | const channels = require.context('.', true, /_channel\.js$/) 5 | channels.keys().forEach(channels) 6 | -------------------------------------------------------------------------------- /app/javascript/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/app/javascript/images/.keep -------------------------------------------------------------------------------- /app/javascript/packs/application.js: -------------------------------------------------------------------------------- 1 | // This file is automatically compiled by Webpack, along with any other files 2 | // present in this directory. You're encouraged to place your actual application logic in 3 | // a relevant structure within app/javascript and only use these pack files to reference 4 | // that code so it'll be compiled. 5 | 6 | import '@hotwired/turbo-rails' 7 | 8 | import 'src/bootstrap.js' 9 | import 'src/fontawesome.js' 10 | 11 | require('@rails/activestorage').start() 12 | require('channels') 13 | -------------------------------------------------------------------------------- /app/javascript/packs/application.scss: -------------------------------------------------------------------------------- 1 | @import "stylesheets/bootstrap"; 2 | @import "stylesheets/turbo-progress-bar"; 3 | -------------------------------------------------------------------------------- /app/javascript/src/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/app/javascript/src/.keep -------------------------------------------------------------------------------- /app/javascript/src/bootstrap.js: -------------------------------------------------------------------------------- 1 | /* Copied from the source code of Bootstrap: */ 2 | /* https://github.com/twbs/bootstrap/blob/v5.3.0/js/index.umd.js */ 3 | 4 | import Alert from 'bootstrap/js/src/alert' 5 | import Button from 'bootstrap/js/src/button' 6 | import Carousel from 'bootstrap/js/src/carousel' 7 | import Collapse from 'bootstrap/js/src/collapse' 8 | import Dropdown from 'bootstrap/js/src/dropdown' 9 | import Modal from 'bootstrap/js/src/modal' 10 | import Offcanvas from 'bootstrap/js/src/offcanvas' 11 | import Popover from 'bootstrap/js/src/popover' 12 | import ScrollSpy from 'bootstrap/js/src/scrollspy' 13 | import Tab from 'bootstrap/js/src/tab' 14 | import Toast from 'bootstrap/js/src/toast' 15 | import Tooltip from 'bootstrap/js/src/tooltip' 16 | 17 | export default { 18 | Alert, 19 | Button, 20 | Carousel, 21 | Collapse, 22 | Dropdown, 23 | Modal, 24 | Offcanvas, 25 | Popover, 26 | ScrollSpy, 27 | Tab, 28 | Toast, 29 | Tooltip 30 | } 31 | -------------------------------------------------------------------------------- /app/javascript/src/fontawesome.js: -------------------------------------------------------------------------------- 1 | import { config, library, dom } from '@fortawesome/fontawesome-svg-core' 2 | 3 | import { 4 | faGithub 5 | } from '@fortawesome/free-brands-svg-icons' 6 | 7 | // Prevents flicker when using Turbo 8 | // Ref: https://github.com/FortAwesome/Font-Awesome/issues/11924 9 | config.mutateApproach = 'sync' 10 | 11 | library.add( 12 | faGithub 13 | ) 14 | 15 | dom.watch() 16 | -------------------------------------------------------------------------------- /app/javascript/stylesheets/bootstrap-variables-dark.scss: -------------------------------------------------------------------------------- 1 | // New variables 2 | 3 | // Overrides 4 | 5 | @import "bootstrap/scss/variables-dark"; 6 | -------------------------------------------------------------------------------- /app/javascript/stylesheets/bootstrap-variables.scss: -------------------------------------------------------------------------------- 1 | // New variables 2 | 3 | $rails-red: #e00000; 4 | 5 | // Overrides 6 | 7 | $color-mode-type: media-query; 8 | $primary: $rails-red; 9 | 10 | @import "bootstrap/scss/variables"; 11 | -------------------------------------------------------------------------------- /app/javascript/stylesheets/bootstrap.scss: -------------------------------------------------------------------------------- 1 | /* Full copy of node_modules/bootstrap/scss/bootstrap.scss */ 2 | 3 | @import "bootstrap/scss/mixins/banner"; 4 | 5 | @include bsBanner(""); 6 | 7 | // Configuration 8 | @import "bootstrap/scss/functions"; 9 | @import "bootstrap-variables"; 10 | @import "bootstrap-variables-dark"; 11 | @import "bootstrap/scss/maps"; 12 | @import "bootstrap/scss/mixins"; 13 | @import "bootstrap/scss/utilities"; 14 | 15 | // Layout & components 16 | @import "bootstrap/scss/root"; 17 | @import "bootstrap/scss/reboot"; 18 | @import "bootstrap/scss/type"; 19 | @import "bootstrap/scss/images"; 20 | @import "bootstrap/scss/containers"; 21 | @import "bootstrap/scss/grid"; 22 | @import "bootstrap/scss/tables"; 23 | @import "bootstrap/scss/forms"; 24 | @import "bootstrap/scss/buttons"; 25 | @import "bootstrap/scss/transitions"; 26 | @import "bootstrap/scss/dropdown"; 27 | @import "bootstrap/scss/button-group"; 28 | @import "bootstrap/scss/nav"; 29 | @import "bootstrap/scss/navbar"; 30 | @import "bootstrap/scss/card"; 31 | @import "bootstrap/scss/accordion"; 32 | @import "bootstrap/scss/breadcrumb"; 33 | @import "bootstrap/scss/pagination"; 34 | @import "bootstrap/scss/badge"; 35 | @import "bootstrap/scss/alert"; 36 | @import "bootstrap/scss/progress"; 37 | @import "bootstrap/scss/list-group"; 38 | @import "bootstrap/scss/close"; 39 | @import "bootstrap/scss/toasts"; 40 | @import "bootstrap/scss/modal"; 41 | @import "bootstrap/scss/tooltip"; 42 | @import "bootstrap/scss/popover"; 43 | @import "bootstrap/scss/carousel"; 44 | @import "bootstrap/scss/spinners"; 45 | @import "bootstrap/scss/offcanvas"; 46 | @import "bootstrap/scss/placeholders"; 47 | 48 | // Helpers 49 | @import "bootstrap/scss/helpers"; 50 | 51 | // Utilities 52 | @import "bootstrap/scss/utilities/api"; 53 | -------------------------------------------------------------------------------- /app/javascript/stylesheets/turbo-progress-bar.scss: -------------------------------------------------------------------------------- 1 | .turbo-progress-bar { 2 | height: 2px; 3 | background-color: $progress-bar-bg; 4 | } 5 | -------------------------------------------------------------------------------- /app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationJob < ActiveJob::Base 4 | # Automatically retry jobs that encountered a deadlock 5 | # retry_on ActiveRecord::Deadlocked 6 | 7 | # Most jobs are safe to ignore if the underlying records are no longer available 8 | # discard_on ActiveJob::DeserializationError 9 | end 10 | -------------------------------------------------------------------------------- /app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationMailer < ActionMailer::Base 4 | default from: 'from@example.com' 5 | layout 'mailer' 6 | end 7 | -------------------------------------------------------------------------------- /app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class ApplicationRecord < ActiveRecord::Base 4 | self.abstract_class = true 5 | end 6 | -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/views/layouts/application.html.slim: -------------------------------------------------------------------------------- 1 | doctype html 2 | html lang=I18n.locale data-default-lang=I18n.default_locale 3 | head 4 | title = yield_or_default :title, action_name.titlecase 5 | 6 | / Required meta tags 7 | meta charset='utf-8' 8 | meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no' 9 | meta name='description' content=yield(:meta_description) 10 | 11 | = csrf_meta_tags 12 | = csp_meta_tag 13 | = yield :head 14 | 15 | = stylesheet_pack_tag 'application', media: 'all', 'data-turbo-track': 'reload' 16 | 17 | / Web App manifest 18 | link href='/manifest.json' rel='manifest' 19 | meta content=t('app_name') name='Rails 6 Starter App' 20 | meta content='#e00000' name='theme-color' 21 | 22 | link href='launcher-icon-180.png' rel='apple-touch-icon' sizes='180x180' 23 | 24 | / Placed at the top of the document because of Turbo 25 | = javascript_pack_tag 'application', 'data-turbo-track': 'reload' 26 | 27 | body 28 | == render 'shared/navbar' 29 | 30 | .main-container.container = yield 31 | 32 | == render 'shared/footer' 33 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.html.slim: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | meta content='text/html; charset=utf-8' http-equiv='Content-Type' 5 | css: 6 | /* Email styles need to be inline */ 7 | body 8 | = yield 9 | -------------------------------------------------------------------------------- /app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /app/views/pages/hello_world.html.slim: -------------------------------------------------------------------------------- 1 | - page_title 'Hello World' 2 | 3 | h1.mt-3 4 | = yield :title 5 | -------------------------------------------------------------------------------- /app/views/pages/home.html.slim: -------------------------------------------------------------------------------- 1 | - page_title t('app_name') 2 | - page_meta_description t('meta_description') 3 | 4 | h1.mt-3 5 | = yield :title 6 | small< 3.0.0 7 | ul.list-inline.lead 8 | li.list-inline-item 9 | | Ruby 10 | small.text-body-secondary< 3.1.7 11 | li.list-inline-item 12 | | Rails 13 | small.text-body-secondary< 6.1.7.10 14 | li.list-inline-item 15 | | Bootstrap 16 | small.text-body-secondary< 5.3.6 17 | li.list-inline-item 18 | | Font Awesome (SVG) 19 | small.text-body-secondary< 6.7.2 20 | -------------------------------------------------------------------------------- /app/views/shared/_footer.html.slim: -------------------------------------------------------------------------------- 1 | footer.main-footer 2 | .container 3 | hr 4 | p 5 | = link_to 'https://github.com/diowa/ruby3-rails6-bootstrap-heroku' do 6 | span.fab.fa-github> aria-hidden='true' 7 | span.visually-hidden GitHub 8 | | diowa/ruby3-rails6-bootstrap-heroku 9 | -------------------------------------------------------------------------------- /app/views/shared/_navbar.html.slim: -------------------------------------------------------------------------------- 1 | nav.main-navbar.navbar.main-navbar.bg-body-tertiary.navbar-expand-lg 2 | .container 3 | = link_to t('app_name'), root_path, class: 'navbar-brand' 4 | button.navbar-toggler type='button' data-bs-toggle='collapse' data-bs-target='#main-navbar-collapse' aria-controls='main-navbar-collapse' aria-expanded='false' aria-label=t('.toggle_navigation') 5 | span.navbar-toggler-icon 6 | #main-navbar-collapse.collapse.navbar-collapse 7 | ul.navbar-nav.main-navbar-nav.ml-auto 8 | li.nav-item = link_to 'Hello World', hello_world_path, class: 'nav-link' 9 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'bundle' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require "rubygems" 12 | 13 | m = Module.new do 14 | module_function 15 | 16 | def invoked_as_script? 17 | File.expand_path($0) == File.expand_path(__FILE__) 18 | end 19 | 20 | def env_var_version 21 | ENV["BUNDLER_VERSION"] 22 | end 23 | 24 | def cli_arg_version 25 | return unless invoked_as_script? # don't want to hijack other binstubs 26 | return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` 27 | bundler_version = nil 28 | update_index = nil 29 | ARGV.each_with_index do |a, i| 30 | if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN 31 | bundler_version = a 32 | end 33 | next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ 34 | bundler_version = $1 35 | update_index = i 36 | end 37 | bundler_version 38 | end 39 | 40 | def gemfile 41 | gemfile = ENV["BUNDLE_GEMFILE"] 42 | return gemfile if gemfile && !gemfile.empty? 43 | 44 | File.expand_path("../../Gemfile", __FILE__) 45 | end 46 | 47 | def lockfile 48 | lockfile = 49 | case File.basename(gemfile) 50 | when "gems.rb" then gemfile.sub(/\.rb$/, gemfile) 51 | else "#{gemfile}.lock" 52 | end 53 | File.expand_path(lockfile) 54 | end 55 | 56 | def lockfile_version 57 | return unless File.file?(lockfile) 58 | lockfile_contents = File.read(lockfile) 59 | return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ 60 | Regexp.last_match(1) 61 | end 62 | 63 | def bundler_version 64 | @bundler_version ||= 65 | env_var_version || cli_arg_version || 66 | lockfile_version 67 | end 68 | 69 | def bundler_requirement 70 | return "#{Gem::Requirement.default}.a" unless bundler_version 71 | 72 | bundler_gem_version = Gem::Version.new(bundler_version) 73 | 74 | requirement = bundler_gem_version.approximate_recommendation 75 | 76 | return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0") 77 | 78 | requirement += ".a" if bundler_gem_version.prerelease? 79 | 80 | requirement 81 | end 82 | 83 | def load_bundler! 84 | ENV["BUNDLE_GEMFILE"] ||= gemfile 85 | 86 | activate_bundler 87 | end 88 | 89 | def activate_bundler 90 | gem_error = activation_error_handling do 91 | gem "bundler", bundler_requirement 92 | end 93 | return if gem_error.nil? 94 | require_error = activation_error_handling do 95 | require "bundler/version" 96 | end 97 | return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) 98 | warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" 99 | exit 42 100 | end 101 | 102 | def activation_error_handling 103 | yield 104 | nil 105 | rescue StandardError, LoadError => e 106 | e 107 | end 108 | end 109 | 110 | m.load_bundler! 111 | 112 | if m.invoked_as_script? 113 | load Gem.bin_path("bundler", "bundle") 114 | end 115 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | load File.expand_path("spring", __dir__) 3 | APP_PATH = File.expand_path('../config/application', __dir__) 4 | require_relative "../config/boot" 5 | require "rails/commands" 6 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | load File.expand_path("spring", __dir__) 3 | require_relative "../config/boot" 4 | require "rake" 5 | Rake.application.run 6 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "fileutils" 3 | 4 | # path to your application root. 5 | APP_ROOT = File.expand_path('..', __dir__) 6 | 7 | def system!(*args) 8 | system(*args) || abort("\n== Command #{args} failed ==") 9 | end 10 | 11 | FileUtils.chdir APP_ROOT do 12 | # This script is a way to set up or update your development environment automatically. 13 | # This script is idempotent, so that you can run it at any time and get an expectable outcome. 14 | # Add necessary setup steps to this file. 15 | 16 | puts '== Installing dependencies ==' 17 | system! 'gem install bundler --conservative' 18 | system('bundle check') || system!('bundle install') 19 | 20 | # Install JavaScript dependencies 21 | system!("yarn install") 22 | 23 | # puts "\n== Copying sample files ==" 24 | # unless File.exist?('config/database.yml') 25 | # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' 26 | # end 27 | 28 | puts "\n== Preparing database ==" 29 | system! 'bin/rails db:prepare' 30 | 31 | puts "\n== Removing old logs and tempfiles ==" 32 | system! 'bin/rails log:clear tmp:clear' 33 | 34 | puts "\n== Restarting application server ==" 35 | system! 'bin/rails restart' 36 | end 37 | -------------------------------------------------------------------------------- /bin/shakapacker: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ENV["RAILS_ENV"] ||= "development" 4 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) 5 | 6 | require "bundler/setup" 7 | require "shakapacker" 8 | require "shakapacker/webpack_runner" 9 | 10 | APP_ROOT = File.expand_path("..", __dir__) 11 | Dir.chdir(APP_ROOT) do 12 | Shakapacker::WebpackRunner.run(ARGV) 13 | end 14 | -------------------------------------------------------------------------------- /bin/shakapacker-dev-server: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ENV["RAILS_ENV"] ||= "development" 4 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) 5 | 6 | require "bundler/setup" 7 | require "shakapacker" 8 | require "shakapacker/dev_server_runner" 9 | 10 | APP_ROOT = File.expand_path("..", __dir__) 11 | Dir.chdir(APP_ROOT) do 12 | Shakapacker::DevServerRunner.run(ARGV) 13 | end 14 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"]) 3 | gem "bundler" 4 | require "bundler" 5 | 6 | # Load Spring without loading other gems in the Gemfile, for speed. 7 | Bundler.locked_gems&.specs&.find { |spec| spec.name == "spring" }&.tap do |spring| 8 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 9 | gem "spring", spring.version 10 | require "spring/binstub" 11 | rescue Gem::LoadError 12 | # Ignore when Spring is not installed. 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # This file is used by Rack-based servers to start the application. 4 | 5 | require_relative 'config/environment' 6 | 7 | run Rails.application 8 | Rails.application.load_server 9 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require_relative 'boot' 4 | 5 | require 'rails' 6 | # Pick the frameworks you want: 7 | require 'active_model/railtie' 8 | require 'active_job/railtie' 9 | require 'active_record/railtie' 10 | require 'active_storage/engine' 11 | require 'action_controller/railtie' 12 | require 'action_mailer/railtie' 13 | require 'action_mailbox/engine' 14 | require 'action_text/engine' 15 | require 'action_view/railtie' 16 | require 'action_cable/engine' 17 | # require "sprockets/railtie" 18 | # require "rails/test_unit/railtie" 19 | 20 | # Require the gems listed in Gemfile, including any gems 21 | # you've limited to :test, :development, or :production. 22 | Bundler.require(*Rails.groups) 23 | 24 | module Ruby3Rails6BootstrapHeroku 25 | class Application < Rails::Application 26 | # Initialize configuration defaults for originally generated Rails version. 27 | config.load_defaults 6.1 28 | 29 | # Configuration for the application, engines, and railties goes here. 30 | # 31 | # These settings can be overridden in specific environments using the files 32 | # in config/environments, which are processed later. 33 | # 34 | # config.time_zone = "Central Time (US & Canada)" 35 | # config.eager_load_paths << Rails.root.join("extras") 36 | 37 | config.generators do |g| 38 | g.javascripts false 39 | g.stylesheets false 40 | g.test_framework :rspec, 41 | view_specs: false, 42 | helper_specs: false, 43 | routing_specs: false, 44 | request_specs: false, 45 | controller_specs: false 46 | end 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 4 | 5 | require 'bundler/setup' # Set up gems listed in the Gemfile. 6 | require 'bootsnap/setup' # Speed up boot time by caching expensive operations. 7 | -------------------------------------------------------------------------------- /config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: redis 3 | url: redis://localhost:6379/1 4 | 5 | test: 6 | adapter: test 7 | 8 | production: 9 | adapter: redis 10 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 11 | channel_prefix: ruby3_rails6_bootstrap_heroku_production 12 | -------------------------------------------------------------------------------- /config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | agZ9/YcTAyjfckPyFBmPQld02QI5LKxgri5Z/ZwqWPV/egOI/1oX3sVi5NxvO5wVUYrUWer+aGRzfdTJpbFoRZbFJn6Wvzn63FGY/Jr2o3l4UVErDUiOt92qc6kzF24JKsNT83Y7YPkMWqnaRRsWf3Q90oUA+I0CeZvxCX+I1eW0fXXa36WYmcCDhbCmQrwvBSMC+ap27im7JYTKyVjxPimbeukmBXBm4N4D3xxmOWg8ucwriLoH1wo5JP5+Uaw3q5xC43hx3dEiqWZ+C6MqhI6NN6BzI1LQXm/AX8d8i+qHff31tJVlqZERaRUMb16nVAdytqZp55bWInwxD0K0NbOVz+0Ag1iJh06Y1PDh5sjEtU/YjMsuoyQN+K7nJu4cZz+1h5qjbmtBaycsruGx8Kh+vf2Fs+19tdvA--iH8LQ1oHBPRpEU5B--vgrHt+Mr81t52006m7goag== -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # PostgreSQL. Versions 9.3 and up are supported. 2 | # 3 | # Install the pg driver: 4 | # gem install pg 5 | # On macOS with Homebrew: 6 | # gem install pg -- --with-pg-config=/usr/local/bin/pg_config 7 | # On macOS with MacPorts: 8 | # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config 9 | # On Windows: 10 | # gem install pg 11 | # Choose the win32 build. 12 | # Install PostgreSQL and put its /bin directory on your path. 13 | # 14 | # Configure Using Gemfile 15 | # gem 'pg' 16 | # 17 | default: &default 18 | adapter: postgresql 19 | encoding: unicode 20 | # For details on connection pooling, see Rails configuration guide 21 | # https://guides.rubyonrails.org/configuring.html#database-pooling 22 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 23 | 24 | development: 25 | <<: *default 26 | database: ruby3_rails6_bootstrap_heroku_development 27 | 28 | # The specified database role being used to connect to postgres. 29 | # To create additional roles in postgres see `$ createuser --help`. 30 | # When left blank, postgres will use the default role. This is 31 | # the same name as the operating system user that initialized the database. 32 | #username: ruby3_rails6_bootstrap_heroku 33 | 34 | # The password associated with the postgres role (username). 35 | #password: 36 | 37 | # Connect on a TCP socket. Omitted by default since the client uses a 38 | # domain socket that doesn't need configuration. Windows does not have 39 | # domain sockets, so uncomment these lines. 40 | #host: localhost 41 | 42 | # The TCP port the server listens on. Defaults to 5432. 43 | # If your server runs on a different port number, change accordingly. 44 | #port: 5432 45 | 46 | # Schema search path. The server defaults to $user,public 47 | #schema_search_path: myapp,sharedapp,public 48 | 49 | # Minimum log levels, in increasing order: 50 | # debug5, debug4, debug3, debug2, debug1, 51 | # log, notice, warning, error, fatal, and panic 52 | # Defaults to warning. 53 | #min_messages: notice 54 | 55 | # Warning: The database defined as "test" will be erased and 56 | # re-generated from your development database when you run "rake". 57 | # Do not set this db to the same as development or production. 58 | test: 59 | <<: *default 60 | url: <%= ENV.fetch('DATABASE_URL', nil) %> 61 | database: ruby3_rails6_bootstrap_heroku_test 62 | 63 | # As with config/credentials.yml, you never want to store sensitive information, 64 | # like your database password, in your source code. If your source code is 65 | # ever seen by anyone, they now have access to your database. 66 | # 67 | # Instead, provide the password as a unix environment variable when you boot 68 | # the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database 69 | # for a full rundown on how to provide these environment variables in a 70 | # production deployment. 71 | # 72 | # On Heroku and other platform providers, you may have a full connection URL 73 | # available as an environment variable. For example: 74 | # 75 | # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" 76 | # 77 | # You can use this database configuration with: 78 | # 79 | # production: 80 | # url: <%= ENV['DATABASE_URL'] %> 81 | # 82 | production: 83 | <<: *default 84 | database: ruby3_rails6_bootstrap_heroku_production 85 | username: ruby3_rails6_bootstrap_heroku 86 | password: <%= ENV['RUBY3_RAILS6_BOOTSTRAP_HEROKU_DATABASE_PASSWORD'] %> 87 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Load the Rails application. 4 | require_relative 'application' 5 | 6 | # Initialize the Rails application. 7 | Rails.application.initialize! 8 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'active_support/core_ext/integer/time' 4 | 5 | Rails.application.configure do 6 | # Settings specified here will take precedence over those in config/application.rb. 7 | 8 | # In the development environment your application's code is reloaded any time 9 | # it changes. This slows down response time but is perfect for development 10 | # since you don't have to restart the web server when you make code changes. 11 | config.cache_classes = false 12 | 13 | # Do not eager load code on boot. 14 | config.eager_load = false 15 | 16 | # Show full error reports. 17 | config.consider_all_requests_local = true 18 | 19 | # Enable/disable caching. By default caching is disabled. 20 | # Run rails dev:cache to toggle caching. 21 | if Rails.root.join('tmp/caching-dev.txt').exist? 22 | config.action_controller.perform_caching = true 23 | config.action_controller.enable_fragment_cache_logging = true 24 | 25 | config.cache_store = :memory_store 26 | config.public_file_server.headers = { 27 | 'Cache-Control' => "public, max-age=#{2.days.to_i}" 28 | } 29 | else 30 | config.action_controller.perform_caching = false 31 | 32 | config.cache_store = :null_store 33 | end 34 | 35 | # Store uploaded files on the local file system (see config/storage.yml for options). 36 | config.active_storage.service = :local 37 | 38 | # Don't care if the mailer can't send. 39 | config.action_mailer.raise_delivery_errors = false 40 | 41 | config.action_mailer.perform_caching = false 42 | 43 | # Print deprecation notices to the Rails logger. 44 | config.active_support.deprecation = :log 45 | 46 | # Raise exceptions for disallowed deprecations. 47 | config.active_support.disallowed_deprecation = :raise 48 | 49 | # Tell Active Support which deprecation messages to disallow. 50 | config.active_support.disallowed_deprecation_warnings = [] 51 | 52 | # Raise an error on page load if there are pending migrations. 53 | config.active_record.migration_error = :page_load 54 | 55 | # Highlight code that triggered database queries in logs. 56 | config.active_record.verbose_query_logs = true 57 | 58 | # Raises error for missing translations. 59 | config.i18n.raise_on_missing_translations = true 60 | 61 | # Annotate rendered view with file names. 62 | config.action_view.annotate_rendered_view_with_filenames = true 63 | 64 | # Use an evented file watcher to asynchronously detect changes in source code, 65 | # routes, locales, etc. This feature depends on the listen gem. 66 | config.file_watcher = ActiveSupport::EventedFileUpdateChecker 67 | 68 | # Uncomment if you wish to allow Action Cable access from any origin. 69 | # config.action_cable.disable_request_forgery_protection = true 70 | end 71 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'active_support/core_ext/integer/time' 4 | 5 | Rails.application.configure do 6 | # Settings specified here will take precedence over those in config/application.rb. 7 | 8 | # Code is not reloaded between requests. 9 | config.cache_classes = true 10 | 11 | # Eager load code on boot. This eager loads most of Rails and 12 | # your application in memory, allowing both threaded web servers 13 | # and those relying on copy on write to perform better. 14 | # Rake tasks automatically ignore this option for performance. 15 | config.eager_load = true 16 | 17 | # Full error reports are disabled and caching is turned on. 18 | config.consider_all_requests_local = false 19 | config.action_controller.perform_caching = true 20 | 21 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] 22 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). 23 | # config.require_master_key = true 24 | 25 | # Disable serving static files from the `/public` folder by default since 26 | # Apache or NGINX already handles this. 27 | config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? 28 | 29 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 30 | # config.asset_host = 'http://assets.example.com' 31 | 32 | # Specifies the header that your server uses for sending files. 33 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 34 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 35 | 36 | # Store uploaded files on the local file system (see config/storage.yml for options). 37 | config.active_storage.service = :local 38 | 39 | # Mount Action Cable outside main process or domain. 40 | # config.action_cable.mount_path = nil 41 | # config.action_cable.url = 'wss://example.com/cable' 42 | # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] 43 | 44 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 45 | config.force_ssl = true 46 | 47 | # Include generic and useful information about system operation, but avoid logging too much 48 | # information to avoid inadvertent exposure of personally identifiable information (PII). 49 | config.log_level = :info 50 | 51 | # Prepend all log lines with the following tags. 52 | config.log_tags = [:request_id] 53 | 54 | # Use a different cache store in production. 55 | # config.cache_store = :mem_cache_store 56 | 57 | # Use a real queuing backend for Active Job (and separate queues per environment). 58 | # config.active_job.queue_adapter = :resque 59 | # config.active_job.queue_name_prefix = "ruby3_rails6_bootstrap_heroku_production" 60 | 61 | config.action_mailer.perform_caching = false 62 | 63 | # Ignore bad email addresses and do not raise email delivery errors. 64 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 65 | # config.action_mailer.raise_delivery_errors = false 66 | 67 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 68 | # the I18n.default_locale when a translation cannot be found). 69 | config.i18n.fallbacks = true 70 | 71 | # Send deprecation notices to registered listeners. 72 | config.active_support.deprecation = :notify 73 | 74 | # Log disallowed deprecations. 75 | config.active_support.disallowed_deprecation = :log 76 | 77 | # Tell Active Support which deprecation messages to disallow. 78 | config.active_support.disallowed_deprecation_warnings = [] 79 | 80 | # Use default logging formatter so that PID and timestamp are not suppressed. 81 | config.log_formatter = Logger::Formatter.new 82 | 83 | # Use a different logger for distributed setups. 84 | # require "syslog/logger" 85 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') 86 | 87 | if ENV['RAILS_LOG_TO_STDOUT'].present? 88 | logger = ActiveSupport::Logger.new($stdout) 89 | logger.formatter = config.log_formatter 90 | config.logger = ActiveSupport::TaggedLogging.new(logger) 91 | end 92 | 93 | # Do not dump schema after migrations. 94 | config.active_record.dump_schema_after_migration = false 95 | 96 | # Inserts middleware to perform automatic connection switching. 97 | # The `database_selector` hash is used to pass options to the DatabaseSelector 98 | # middleware. The `delay` is used to determine how long to wait after a write 99 | # to send a subsequent read to the primary. 100 | # 101 | # The `database_resolver` class is used by the middleware to determine which 102 | # database is appropriate to use based on the time delay. 103 | # 104 | # The `database_resolver_context` class is used by the middleware to set 105 | # timestamps for the last write to the primary. The resolver uses the context 106 | # class timestamps to determine how long to wait before reading from the 107 | # replica. 108 | # 109 | # By default Rails will store a last write timestamp in the session. The 110 | # DatabaseSelector middleware is designed as such you can define your own 111 | # strategy for connection switching and pass that into the middleware through 112 | # these configuration options. 113 | # config.active_record.database_selector = { delay: 2.seconds } 114 | # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver 115 | # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session 116 | end 117 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'active_support/core_ext/integer/time' 4 | 5 | # The test environment is used exclusively to run your application's 6 | # test suite. You never need to work with it otherwise. Remember that 7 | # your test database is "scratch space" for the test suite and is wiped 8 | # and recreated between test runs. Don't rely on the data there! 9 | 10 | Rails.application.configure do 11 | # Settings specified here will take precedence over those in config/application.rb. 12 | 13 | config.cache_classes = false 14 | config.action_view.cache_template_loading = true 15 | 16 | # Do not eager load code on boot. This avoids loading your whole application 17 | # just for the purpose of running a single test. If you are using a tool that 18 | # preloads Rails for running tests, you may have to set it to true. 19 | config.eager_load = false 20 | 21 | # Configure public file server for tests with Cache-Control for performance. 22 | config.public_file_server.enabled = true 23 | config.public_file_server.headers = { 24 | 'Cache-Control' => "public, max-age=#{1.hour.to_i}" 25 | } 26 | 27 | # Show full error reports and disable caching. 28 | config.consider_all_requests_local = true 29 | config.action_controller.perform_caching = false 30 | config.cache_store = :null_store 31 | 32 | # Raise exceptions instead of rendering exception templates. 33 | config.action_dispatch.show_exceptions = false 34 | 35 | # Disable request forgery protection in test environment. 36 | config.action_controller.allow_forgery_protection = false 37 | 38 | # Store uploaded files on the local file system in a temporary directory. 39 | config.active_storage.service = :test 40 | 41 | config.action_mailer.perform_caching = false 42 | 43 | # Tell Action Mailer not to deliver emails to the real world. 44 | # The :test delivery method accumulates sent emails in the 45 | # ActionMailer::Base.deliveries array. 46 | config.action_mailer.delivery_method = :test 47 | 48 | # Print deprecation notices to the stderr. 49 | config.active_support.deprecation = :stderr 50 | 51 | # Raise exceptions for disallowed deprecations. 52 | config.active_support.disallowed_deprecation = :raise 53 | 54 | # Tell Active Support which deprecation messages to disallow. 55 | config.active_support.disallowed_deprecation_warnings = [] 56 | 57 | # Raises error for missing translations. 58 | config.i18n.raise_on_missing_translations = true 59 | 60 | # Annotate rendered view with file names. 61 | # config.action_view.annotate_rendered_view_with_filenames = true 62 | end 63 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # ActiveSupport::Reloader.to_prepare do 6 | # ApplicationController.renderer.defaults.merge!( 7 | # http_host: 'example.org', 8 | # https: false 9 | # ) 10 | # end 11 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 6 | # Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } 7 | 8 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code 9 | # by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". 10 | Rails.backtrace_cleaner.remove_silencers! if ENV['BACKTRACE'] 11 | -------------------------------------------------------------------------------- /config/initializers/content_security_policy.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # Define an application-wide content security policy 6 | # For further information see the following documentation 7 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy 8 | 9 | # Rails.application.config.content_security_policy do |policy| 10 | # policy.default_src :self, :https 11 | # policy.font_src :self, :https, :data 12 | # policy.img_src :self, :https, :data 13 | # policy.object_src :none 14 | # policy.script_src :self, :https 15 | # policy.style_src :self, :https 16 | # # If you are using webpack-dev-server then specify webpack-dev-server host 17 | # policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development? 18 | 19 | # # Specify URI for violation reports 20 | # # policy.report_uri "/csp-violation-report-endpoint" 21 | # end 22 | 23 | # If you are using UJS then enable automatic nonce generation 24 | # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } 25 | 26 | # Set the nonce only to specific directives 27 | # Rails.application.config.content_security_policy_nonce_directives = %w(script-src) 28 | 29 | # Report CSP violations to a specified URI 30 | # For further information see the following documentation: 31 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only 32 | # Rails.application.config.content_security_policy_report_only = true 33 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # Specify a serializer for the signed and encrypted cookie jars. 6 | # Valid options are :json, :marshal, and :hybrid. 7 | Rails.application.config.action_dispatch.cookies_serializer = :json 8 | -------------------------------------------------------------------------------- /config/initializers/feature_policy.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Define an application-wide HTTP feature policy. For further 4 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 5 | # 6 | # Rails.application.config.feature_policy do |f| 7 | # f.camera :none 8 | # f.gyroscope :none 9 | # f.microphone :none 10 | # f.usb :none 11 | # f.fullscreen :self 12 | # f.payment :self, "https://secure.example.com" 13 | # end 14 | -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # Configure sensitive parameters which will be filtered from the log file. 6 | Rails.application.config.filter_parameters += %i[ 7 | passw secret token _key crypt salt certificate otp ssn 8 | ] 9 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # Add new inflection rules using the following format. Inflections 6 | # are locale specific, and you may define rules for as many different 7 | # locales as you wish. All of these examples are active by default: 8 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 9 | # inflect.plural /^(ox)$/i, '\1en' 10 | # inflect.singular /^(ox)en/i, '\1' 11 | # inflect.irregular 'person', 'people' 12 | # inflect.uncountable %w( fish sheep ) 13 | # end 14 | 15 | # These inflection rules are supported but not enabled by default: 16 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 17 | # inflect.acronym 'RESTful' 18 | # end 19 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # Add new mime types for use in respond_to blocks: 6 | # Mime::Type.register "text/richtext", :rtf 7 | -------------------------------------------------------------------------------- /config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Define an application-wide HTTP permissions policy. For further 4 | # information see https://developers.google.com/web/updates/2018/06/feature-policy 5 | # 6 | # Rails.application.config.permissions_policy do |f| 7 | # f.camera :none 8 | # f.gyroscope :none 9 | # f.microphone :none 10 | # f.usb :none 11 | # f.fullscreen :self 12 | # f.payment :self, "https://secure.example.com" 13 | # end 14 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Be sure to restart your server when you modify this file. 4 | 5 | # This file contains settings for ActionController::ParamsWrapper which 6 | # is enabled by default. 7 | 8 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 9 | ActiveSupport.on_load(:action_controller) do 10 | wrap_parameters format: [:json] 11 | end 12 | 13 | # To enable root element in JSON for ActiveRecord objects. 14 | # ActiveSupport.on_load(:active_record) do 15 | # self.include_root_in_json = true 16 | # end 17 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # The following keys must be escaped otherwise they will not be retrieved by 20 | # the default I18n backend: 21 | # 22 | # true, false, on, off, yes, no 23 | # 24 | # Instead, surround them with single quotes. 25 | # 26 | # en: 27 | # 'true': 'foo' 28 | # 29 | # To learn more, please read the Rails Internationalization guide 30 | # available at https://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | app_name: "Rails 6 Starter App" 34 | meta_description: "An opinionated starter application based on Ruby 3.0, Rails 6.1, Webpack 5, Yarn, and Bootstrap 5" 35 | shared: 36 | navbar: 37 | toggle_navigation: "Toggle Navigation" 38 | -------------------------------------------------------------------------------- /config/newrelic.yml: -------------------------------------------------------------------------------- 1 | # 2 | # This file configures the New Relic Agent. New Relic monitors Ruby, Java, 3 | # .NET, PHP, Python, Node, and Go applications with deep visibility and low 4 | # overhead. For more information, visit www.newrelic.com. 5 | 6 | # Generated March 10, 2023, for version 9.0.0 7 | # 8 | # For full documentation of agent configuration options, please refer to 9 | # https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration 10 | 11 | common: &default_settings 12 | # Required license key associated with your New Relic account. 13 | license_key: <%= ENV["NEW_RELIC_LICENSE_KEY"] %> 14 | 15 | # Your application name. Renaming here affects where data displays in New 16 | # Relic. For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications 17 | app_name: <%= ENV["NEW_RELIC_APP_NAME"] %> 18 | 19 | # To disable the agent regardless of other settings, uncomment the following: 20 | # agent_enabled: false 21 | 22 | # Logging level for log/newrelic_agent.log; options are error, warn, info, or 23 | # debug. 24 | log_level: info 25 | 26 | # All of the following configuration options are optional. Review them, and 27 | # uncomment or edit them if they appear relevant to your application needs. 28 | 29 | # An array of ActiveSupport custom events names to subscribe to and provide 30 | # instrumentation for. For example, 31 | # - my.custom.event 32 | # - another.event 33 | # - a.third.event 34 | # active_support_custom_events_names: "" 35 | 36 | # If `true`, all logging-related features for the agent can be enabled or disabled 37 | # independently. If `false`, all logging-related features are disabled. 38 | # application_logging.enabled: true 39 | 40 | # If `true`, the agent captures log records emitted by this application. 41 | # application_logging.forwarding.enabled: true 42 | 43 | # Defines the maximum number of log records to buffer in memory at a time. 44 | # application_logging.forwarding.max_samples_stored: 10000 45 | 46 | # If `true`, the agent captures metrics related to logging for this application. 47 | # application_logging.metrics.enabled: true 48 | 49 | # If `true`, the agent decorates logs with metadata to link to entities, hosts, traces, and spans. 50 | # application_logging.local_decorating.enabled: false 51 | 52 | # If `true`, the agent will report source code level metrics for traced methods 53 | # see: https://docs.newrelic.com/docs/apm/agents/ruby-agent/features/ruby-codestream-integration/ 54 | # code_level_metrics.enabled: true 55 | 56 | # If true, enables transaction event sampling. 57 | # transaction_events.enabled: true 58 | 59 | # Defines the maximum number of request events reported from a single harvest. 60 | # transaction_events.max_samples_stored: 1200 61 | 62 | # Prefix of attributes to exclude from all destinations. Allows * as wildcard at 63 | # end. 64 | # attributes_exclude: [] 65 | 66 | # Prefix of attributes to include in all destinations. Allows * as wildcard at 67 | # end. 68 | # attributes_include: [] 69 | 70 | # If true, enables capture of attributes for all destinations. 71 | # attributes.enabled: true 72 | 73 | # If true, enables an audit log which logs communications with the New Relic 74 | # collector. 75 | # audit_log.enabled: false 76 | 77 | # List of allowed endpoints to include in audit log. 78 | # audit_log.endpoints: [".*"] 79 | 80 | # Specifies a path to the audit log file (including the filename). 81 | # audit_log.path: "/audit_log" 82 | 83 | # Specify a list of constants that should prevent the agent from starting 84 | # automatically. Separate individual constants with a comma ,. 85 | # For example, Rails::Console,UninstrumentedBackgroundJob. 86 | # autostart.denylisted_constants: "rails::console" 87 | 88 | # Defines a comma-delimited list of executables that the agent should not 89 | # instrument. For example, rake,my_ruby_script.rb. 90 | # autostart.denylisted_executables: "irb,rspec" 91 | 92 | # Defines a comma-delimited list of Rake tasks that the agent should not 93 | # instrument. For example, assets:precompile,db:migrate. 94 | # autostart.denylisted_rake_tasks: "about,assets:clean,assets:clobber,assets:environment,assets:precompile,assets:precompile:all,db:create,db:drop,db:fixtures:load,db:migrate,db:migrate:status,db:rollback,db:schema:cache:clear,db:schema:cache:dump,db:schema:dump,db:schema:load,db:seed,db:setup,db:structure:dump,db:version,doc:app,log:clear,middleware,notes,notes:custom,rails:template,rails:update,routes,secret,spec,spec:features,spec:requests,spec:controllers,spec:helpers,spec:models,spec:views,spec:routing,spec:rcov,stats,test,test:all,test:all:db,test:recent,test:single,test:uncommitted,time:zones:all,tmp:clear,tmp:create,shakapacker:compile" 95 | 96 | # Backports the faster Active Record connection lookup introduced in Rails 6, 97 | # which improves agent performance when instrumenting Active Record. Note that 98 | # this setting may not be compatible with other gems that patch Active Record. 99 | # backport_fast_active_record_connection_lookup: false 100 | 101 | # If true, the agent captures attributes from browser monitoring. 102 | # browser_monitoring.attributes.enabled: false 103 | 104 | # Prefix of attributes to exclude from browser monitoring. Allows * as wildcard 105 | # at end. 106 | # browser_monitoring.attributes.exclude: [] 107 | 108 | # Prefix of attributes to include in browser monitoring. Allows * as wildcard at 109 | # end. 110 | # browser_monitoring.attributes.include: [] 111 | 112 | # This is true by default, this enables auto-injection of the JavaScript header 113 | # for page load timing (sometimes referred to as real user monitoring or RUM). 114 | # browser_monitoring.auto_instrument: true 115 | 116 | # Manual override for the path to your local CA bundle. This CA bundle will be 117 | # used to validate the SSL certificate presented by New Relic's data collection 118 | # service. 119 | # ca_bundle_path: nil 120 | 121 | # Enable or disable the capture of memcache keys from transaction traces. 122 | # capture_memcache_keys: false 123 | 124 | # When true, the agent captures HTTP request parameters and attaches them to 125 | # transaction traces, traced errors, and TransactionError events. When using the 126 | # capture_params setting, the Ruby agent will not attempt to filter secret 127 | # information. Recommendation: To filter secret information from request 128 | # parameters,use the attributes.include setting instead. For more information, 129 | # see the Ruby attribute examples. 130 | # capture_params: false 131 | 132 | # If true, the agent will clear Tracer::State in Agent.drop_buffered_data. 133 | # clear_transaction_state_after_fork: false 134 | 135 | # Path to newrelic.yml. If undefined, the agent checks the following directories 136 | # (in order): config/newrelic.yml, newrelic.yml, $HOME/.newrelic/newrelic.yml 137 | # and $HOME/newrelic.yml. 138 | # config_path: newrelic.yml 139 | 140 | # If true, enables cross application tracing. Cross application tracing is now 141 | # deprecated, and disabled by default. Distributed tracing is replacing cross 142 | # application tracing as the default means of tracing between services. 143 | # To continue using it, set `cross_application_tracer.enabled: true` and 144 | # `distributed_tracing.enabled: false` 145 | # cross_application_tracer.enabled: false 146 | 147 | # If false, custom attributes will not be sent on New Relic Insights events. 148 | # custom_attributes.enabled: true 149 | 150 | # If true, the agent captures New Relic Insights custom events. 151 | # custom_insights_events.enabled: true 152 | 153 | # Specify a maximum number of custom Insights events to buffer in memory at a 154 | # time. 155 | # custom_insights_events.max_samples_stored: 3000 156 | 157 | # If false, the agent will not add database_name parameter to transaction or # 158 | # slow sql traces. 159 | # datastore_tracer.database_name_reporting.enabled: true 160 | 161 | # If false, the agent will not report datastore instance metrics, nor add host 162 | # or port_path_or_id parameters to transaction or slow SQL traces. 163 | # datastore_tracer.instance_reporting.enabled: true 164 | 165 | # If true, disables Action Cable instrumentation. 166 | # disable_action_cable_instrumentation: false 167 | 168 | # If true, disables Action Mailbox instrumentation. 169 | # disable_action_mailbox: false 170 | 171 | # If true, disables Action Mailer instrumentation. 172 | # disable_action_mailer: false 173 | 174 | # If true, disables instrumentation for Active Record 4+ 175 | # disable_active_record_notifications: false 176 | 177 | # If true, disables Active Storage instrumentation. 178 | # disable_active_storage: false 179 | 180 | # If true, disables Active Support instrumentation. 181 | # disable_active_support: false 182 | 183 | # If true, disables Active Job instrumentation. 184 | # disable_activejob: false 185 | 186 | # If true, disables Active Record instrumentation. 187 | # disable_active_record_instrumentation: false 188 | 189 | # If true, the agent won't sample the CPU usage of the host process. 190 | # disable_cpu_sampler: false 191 | 192 | # If true, disables ActiveSupport custom events instrumentation. 193 | # disable_custom_events_instrumentation: false 194 | 195 | # If true, the agent won't measure the depth of Delayed Job queues. 196 | # disable_delayed_job_sampler: false 197 | 198 | # If true, disables the use of GC::Profiler to measure time spent in garbage 199 | # collection 200 | # disable_gc_profiler: false 201 | 202 | # If true, the agent won't sample the memory usage of the host process. 203 | # disable_memory_sampler: false 204 | 205 | # If true, the agent won't wrap third-party middlewares in instrumentation 206 | # (regardless of whether they are installed via Rack::Builder or Rails). 207 | # disable_middleware_instrumentation: false 208 | 209 | # If true, disables the collection of sampler metrics. Sampler metrics are 210 | # metrics that are not event-based (such as CPU time or memory usage). 211 | # disable_samplers: false 212 | 213 | # If true, disables Sequel instrumentation. 214 | # disable_sequel_instrumentation: false 215 | 216 | # If true, disables Sidekiq instrumentation. 217 | # disable_sidekiq: false 218 | 219 | # If true, disables agent middleware for Sinatra. This middleware is responsible 220 | # for advanced feature support such as distributed tracing, page load 221 | # timing, and error collection. 222 | # disable_sinatra_auto_middleware: false 223 | 224 | # If true, disables view instrumentation. 225 | # disable_view_instrumentation: false 226 | 227 | # If true, the agent won't sample performance measurements from the Ruby VM. 228 | # disable_vm_sampler: false 229 | 230 | # Distributed tracing tracks and observes service requests as they flow through distributed systems. 231 | # With distributed tracing data, you can quickly pinpoint failures or performance issues and fix them. 232 | # distributed_tracing.enabled: true 233 | 234 | # If true, the agent captures attributes from error collection. 235 | # error_collector.attributes.enabled: false 236 | 237 | # Prefix of attributes to exclude from error collection. 238 | # Allows * as wildcard at end. 239 | # error_collector.attributes.exclude: [] 240 | 241 | # Prefix of attributes to include in error collection. 242 | # Allows * as wildcard at end. 243 | # error_collector.attributes.include: [] 244 | 245 | # If true, the agent collects TransactionError events. 246 | # error_collector.capture_events: true 247 | 248 | # If true, the agent captures traced errors and error count metrics. 249 | # error_collector.enabled: true 250 | 251 | # A list of error classes that the agent should treat as expected. 252 | # error_collector.expected_classes: [] 253 | 254 | # A map of error classes to a list of messages. When an error of one of the 255 | # classes specified here occurs, if its error message contains one of the 256 | # strings corresponding to it here, that error will be treated as expected. 257 | # error_collector.expected_messages: {} 258 | 259 | # A comma separated list of status codes, possibly including ranges. Errors 260 | # associated with these status codes, where applicable, will be treated as 261 | # expected. 262 | # error_collector.expected_status_codes: "" 263 | 264 | # A list of error classes that the agent should ignore. 265 | # error_collector.ignore_classes: [] 266 | 267 | # A map of error classes to a list of messages. When an error of one of the 268 | # classes specified here occurs, if its error message contains one of the 269 | # strings corresponding to it here, that error will be ignored. 270 | # error_collector.ignore_messages: "" 271 | 272 | # A comma separated list of status codes, possibly including ranges. Errors 273 | # associated with these status codes, where applicable, will be ignored. 274 | # error_collector.ignore_status_codes: "" 275 | 276 | # Defines the maximum number of frames in an error backtrace. Backtraces over 277 | # this amount are truncated at the beginning and end. 278 | # error_collector.max_backtrace_frames: 50 279 | 280 | # Defines the maximum number of TransactionError events sent to Insights per 281 | # harvest cycle. 282 | # error_collector.max_event_samples_stored: 100 283 | 284 | # Allows newrelic distributed tracing headers to be suppressed on outbound 285 | # requests. 286 | # exclude_newrelic_header: false 287 | 288 | # Forces the exit handler that sends all cached data to collector before 289 | # shutting down to be installed regardless of detecting scenarios where it 290 | # generally should not be. Known use-case for this option is where Sinatra is 291 | # running as an embedded service within another framework and the agent is 292 | # detecting the Sinatra app and skipping the at_exit handler as a result. 293 | # Sinatra classically runs the entire application in an at_exit block and would 294 | # otherwise misbehave if the Agent's at_exit handler was also installed in 295 | # those circumstances. Note: send_data_on_exit should also be set to true in 296 | # tandem with this setting. 297 | # force_install_exit_handler: false 298 | 299 | # Ordinarily the agent reports dyno names with a trailing dot and process ID 300 | # (for example, worker.3). You can remove this trailing data by specifying the 301 | # prefixes you want to report without trailing data (for example, worker). 302 | # heroku.dyno_name_prefixes_to_shorten: ["scheduler", "run"] 303 | 304 | # If true, the agent uses Heroku dyno names as the hostname. 305 | # heroku.use_dyno_names: true 306 | 307 | # If true, enables high security mode. Ensure that you understand the 308 | # implication of enabling high security mode before enabling this setting. 309 | # https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/high-security-mode/ 310 | # high_security: false 311 | 312 | # Configures the hostname for the Trace Observer Host. When configured, enables 313 | # tail-based sampling by sending all recorded spans to a Trace Observer for 314 | # further sampling decisions, irrespective of any usual agent sampling decision. 315 | # infinite_tracing.trace_observer.host: "" 316 | 317 | # Configures the TCP/IP port for the Trace Observer Host 318 | # infinite_tracing.trace_observer.port: 443 319 | 320 | # Configure the compression level for data sent to the Trace Observer 321 | # May be one of [none|low|medium|high] 322 | # 'high' is the default. Set the level to 'none' to disable compression 323 | # infinite_tracing.compression_level: high 324 | 325 | # If true (the default), data sent to the Trace Observer will be batched 326 | # instead of each span being sent individually 327 | # infinite_tracing.batching: true 328 | 329 | # Controls auto-instrumentation of bunny at start up. 330 | # May be one of [auto|prepend|chain|disabled]. 331 | # instrumentation.bunny: auto 332 | 333 | # Controls auto-instrumentation of Fiber at start up. 334 | # May be one of [auto|prepend|chain|disabled] 335 | # instrumentation.fiber: auto 336 | 337 | # Controls auto-instrumentation of concurrent_ruby at start up. 338 | # May be one of [auto|prepend|chain|disabled] 339 | # instrumentation.concurrent_ruby: auto 340 | 341 | # Controls auto-instrumentation of Curb at start up. 342 | # May be one of [auto|prepend|chain|disabled]. 343 | # instrumentation.curb: auto 344 | 345 | # Controls auto-instrumentation of Delayed Job at start up. 346 | # May be one of [auto|prepend|chain|disabled]. 347 | # instrumentation.delayed_job: auto 348 | 349 | # Controls auto-instrumentation of the elasticsearch library at start up. 350 | # May be one of [auto|prepend|chain|disabled]. 351 | # instrumentation.elasticsearch: auto 352 | 353 | # Controls auto-instrumentation of Excon at start up. 354 | # May be one of [enabled|disabled]. 355 | # instrumentation.excon: auto 356 | 357 | # Controls auto-instrumentation of Grape at start up. 358 | # May be one of [auto|prepend|chain|disabled]. 359 | # instrumentation.grape: auto 360 | 361 | # Controls auto-instrumentation of HTTPClient at start up. 362 | # May be one of [auto|prepend|chain|disabled]. 363 | # instrumentation.httpclient: auto 364 | 365 | # Controls auto-instrumentation of http.rb gem at start up. 366 | # May be one of [auto|prepend|chain|disabled]. 367 | # instrumentation.httprb: auto 368 | 369 | # Controls auto-instrumentation of the Ruby standard library Logger.rb. 370 | # May be one of [auto|prepend|chain|disabled]. 371 | # instrumentation.logger: auto 372 | 373 | # Controls auto-instrumentation of ActiveSupport::Logger at start up. 374 | # May be one of [auto|prepend|chain|disabled]. 375 | # instrumentation.active_support.logger: auto 376 | 377 | # Controls auto-instrumentation of memcache-client gem for Memcache at start up. 378 | # May be one of [auto|prepend|chain|disabled]. 379 | # instrumentation.memcache_client: auto 380 | 381 | # Controls auto-instrumentation of dalli gem for Memcache at start up. 382 | # May be one of [auto|prepend|chain|disabled]. 383 | # instrumentation.memcache: auto 384 | 385 | # Controls auto-instrumentation of memcached gem for Memcache at start up. 386 | # May be one of [auto|prepend|chain|disabled]. 387 | # instrumentation.memcached: auto 388 | 389 | # Controls auto-instrumentation of Mongo at start up. 390 | # May be one of [enabled|disabled]. 391 | # instrumentation.mongo: auto 392 | 393 | # Controls auto-instrumentation of Net::HTTP at start up. 394 | # May be one of [auto|prepend|chain|disabled]. 395 | # instrumentation.net_http: auto 396 | 397 | # Controls auto-instrumentation of Puma::Rack::URLMap at start up. 398 | # May be one of [auto|prepend|chain|disabled]. 399 | # instrumentation.puma_rack_urlmap: auto 400 | 401 | # Controls auto-instrumentation of Puma::Rack. When enabled, the agent hooks 402 | # into the to_app method in Puma::Rack::Builder to find gems to instrument 403 | # during application startup. May be one of [auto|prepend|chain|disabled]. 404 | # instrumentation.puma_rack: auto 405 | 406 | # Controls auto-instrumentation of Rack::URLMap at start up. 407 | # May be one of [auto|prepend|chain|disabled]. 408 | # instrumentation.rack_urlmap: auto 409 | 410 | # Controls auto-instrumentation of Rack. When enabled, the agent hooks into the 411 | # to_app method in Rack::Builder to find gems to instrument during application 412 | # startup. May be one of [auto|prepend|chain|disabled]. 413 | # instrumentation.rack: auto 414 | 415 | # Controls auto-instrumentation of rake at start up. 416 | # May be one of [auto|prepend|chain|disabled]. 417 | # instrumentation.rake: auto 418 | 419 | # Controls auto-instrumentation of Redis at start up. 420 | # May be one of [auto|prepend|chain|disabled]. 421 | # instrumentation.redis: auto 422 | 423 | # Controls auto-instrumentation of resque at start up. 424 | # May be one of [auto|prepend|chain|disabled]. 425 | # instrumentation.resque: auto 426 | 427 | # Controls auto-instrumentation of Sinatra at start up. 428 | # May be one of [auto|prepend|chain|disabled]. 429 | # instrumentation.sinatra: auto 430 | 431 | # Controls auto-instrumentation of Tilt at start up. 432 | # May be one of [auto|prepend|chain|disabled]. 433 | # instrumentation.tilt: auto 434 | 435 | # Controls auto-instrumentation of Typhoeus at start up. 436 | # May be one of [auto|prepend|chain|disabled]. 437 | # instrumentation.typhoeus: auto 438 | 439 | # Controls auto-instrumentation of the Thread class at start up to allow the agent to correctly nest spans inside of an asynchronous transaction. 440 | # May be one of [auto|prepend|chain|disabled]. 441 | # instrumentation.thread: auto 442 | 443 | # Controls auto-instrumentation of the Thread class at start up to automatically add tracing to all Threads created in the application. 444 | # instrumentation.thread.tracing: true 445 | 446 | # Controls auto-instrumentation of gRPC clients at start up. 447 | # May be one of [auto|prepend|chain|disabled]. 448 | # instrumentation.grpc_client: auto 449 | 450 | # Controls auto-instrumentation of gRPC servers at start up. 451 | # May be one of [auto|prepend|chain|disabled]. 452 | # instrumentation.grpc_server: auto 453 | 454 | # Specifies a list of hostname patterns separated by commas that will match 455 | # gRPC hostnames that traffic is to be ignored by New Relic for. 456 | # New Relic's gRPC client instrumentation will ignore traffic streamed to a 457 | # host matching any of these patterns, and New Relic's gRPC server 458 | # instrumentation will ignore traffic for a server running on a host whose 459 | # hostname matches any of these patterns. By default, no traffic is ignored 460 | # when gRPC instrumentation is itself enabled. 461 | # For example, "private.com$,exception.*" 462 | # instrumentation.grpc.host_denylist: "" 463 | 464 | # A dictionary of label names and values that will be applied to the data sent 465 | # from this agent. May also be expressed as a semicolon-delimited ; string of 466 | # colon-separated : pairs. 467 | # For example,Server:One;Data Center:Primary. 468 | # labels: "" 469 | 470 | # Defines a name for the log file. 471 | # log_file_name: "newrelic_agent.log" 472 | 473 | # Defines a path to the agent log file, excluding the filename. 474 | # log_file_path: "log/" 475 | 476 | # Specifies a marshaller for transmitting data to the New Relic collector. 477 | # Currently json is the only valid value for this setting. 478 | # marshaller: json 479 | 480 | # If true, the agent will collect metadata about messages and attach them as 481 | # segment parameters. 482 | # message_tracer.segment_parameters.enabled: true 483 | 484 | # If true, the agent captures Mongo queries in transaction traces. 485 | # mongo.capture_queries: true 486 | 487 | # If true, the agent obfuscates Mongo queries in transaction traces. 488 | # mongo.obfuscate_queries: true 489 | 490 | # If true, the agent captures Elasticsearch queries in transaction traces. 491 | # elasticsearch.capture_queries: true 492 | 493 | # If true, the agent obfuscates Elasticsearch queries in transaction traces. 494 | # elasticsearch.obfuscate_queries: true 495 | 496 | # When true, the agent transmits data about your app to the New Relic collector. 497 | # monitor_mode: true 498 | 499 | # If true, uses Module#prepend rather than alias_method for Active Record 500 | # instrumentation. 501 | # prepend_active_record_instrumentation: false 502 | 503 | # Specify a custom host name for display in the New Relic UI 504 | # Be be aware that you cannot rename a hostname, so please rename 505 | # process_host.display_name: "default hostname" 506 | 507 | # Defines a host for communicating with the New Relic collector via a proxy 508 | # server. 509 | # proxy_host: nil 510 | 511 | # Defines a password for communicating with the New Relic collector via a proxy 512 | # server. 513 | # proxy_pass: nil 514 | 515 | # Defines a port for communicating with the New Relic collector via a proxy 516 | # server. 517 | # proxy_port: nil 518 | 519 | # Defines a user for communicating with the New Relic collector via a proxy 520 | # server. 521 | # proxy_user: nil 522 | 523 | # Timeout for waiting on connect to complete before a rake task 524 | # rake.connect_timeout: 10 525 | 526 | # Specify an array of Rake tasks to automatically instrument. 527 | # This configuration option converts the Array to a RegEx list. 528 | # If you'd like to allow all tasks by default, use `rake.tasks: [.+]`. 529 | # Rake tasks will not be instrumented unless they're added to this list. 530 | # For more information, visit the (New Relic Rake Instrumentation docs)[/docs/apm/agents/ruby-agent/background-jobs/rake-instrumentation]. 531 | # rake.tasks: [] 532 | 533 | # Define transactions you want the agent to ignore, by specifying a list of 534 | # patterns matching the URI you want to ignore. 535 | # rules.ignore_url_regexes: [] 536 | 537 | # Applies Language Agent Security Policy settings. 538 | # security_policies_token: "" 539 | 540 | # If true, enables the exit handler that sends data to the New Relic collector 541 | # before shutting down. 542 | # send_data_on_exit: true 543 | 544 | # If true, the agent collects slow SQL queries. 545 | # slow_sql.enabled: false 546 | 547 | # If true, the agent collects explain plans in slow SQL queries. If this setting 548 | # is omitted, the transaction_tracer.explain.enabled setting will be applied as 549 | # the default setting for explain plans in slow SQL as well. 550 | # slow_sql.explain_enabled: false 551 | 552 | # Specify a threshold in seconds. The agent collects slow SQL queries and 553 | # explain plans that exceed this threshold. 554 | # slow_sql.explain_threshold: 1.0 555 | 556 | # Defines an obfuscation level for slow SQL queries. 557 | # Valid options are obfuscated, raw, or none. 558 | # slow_sql.record_sql: none 559 | 560 | # Generate a longer sql_id for slow SQL traces. sql_id is used for aggregation 561 | # of similar queries. 562 | # slow_sql.use_longer_sql_id: false 563 | 564 | # If true, the agent captures attributes on span events. 565 | # span_events_attributes.enabled: true 566 | 567 | # Defines the maximum number of span events reported from a single harvest. 568 | # This can be any integer between 1 and 10000. Increasing this value may impact 569 | # memory usage. 570 | # span_events.max_samples_stored: 2000 571 | 572 | # Prefix of attributes to exclude from span events. Allows * as wildcard at end. 573 | # span_events.attributes.exclude: [] 574 | 575 | # Prefix of attributes to include on span events. Allows * as wildcard at end. 576 | # span_events.attributes.include: [] 577 | 578 | # If true, enables span event sampling. 579 | # span_events.enabled: true 580 | 581 | # Sets the maximum number of span events to buffer when streaming to the trace 582 | # observer. 583 | # span_events.queue_size: 10000 584 | 585 | # Specify a list of exceptions you do not want the agent to strip when 586 | # strip_exception_messages is true. Separate exceptions with a comma. For 587 | # example, "ImportantException,PreserveMessageException". 588 | # strip_exception_messages.allowed_classes: "" 589 | 590 | # If true, the agent strips messages from all exceptions except those in the 591 | # allowlist. Enabled automatically in high security mode. 592 | # strip_exception_messages.enabled: true 593 | 594 | # When set to true, forces a synchronous connection to the New Relic collector 595 | # during application startup. For very short-lived processes, this helps ensure # the New Relic agent has time to report. 596 | # sync_startup: false 597 | 598 | # If true, enables use of the thread profiler. 599 | # thread_profiler.enabled: false 600 | 601 | # Defines the maximum number of seconds the agent should spend attempting to 602 | # connect to the collector. 603 | # timeout: 120 604 | 605 | # If true, the agent captures attributes from transaction events. 606 | # transaction_events_attributes.enabled: false 607 | 608 | # Prefix of attributes to exclude from transaction events. 609 | # Allows * as wildcard at end. 610 | # transaction_events.attributes.exclude: [] 611 | 612 | # Prefix of attributes to include in transaction events. 613 | # Allows * as wildcard at end. 614 | # transaction_events.attributes.include: [] 615 | 616 | # If true, the agent captures attributes on transaction segments. 617 | # transaction_segments_attributes.enabled: true 618 | 619 | # Prefix of attributes to exclude from transaction segments. 620 | # Allows * as wildcard at end. 621 | # transaction_segments.attributes.exclude: [] 622 | 623 | # Prefix of attributes to include on transaction segments. 624 | # Allows * as wildcard at end. 625 | # transaction_segments.attributes.include: [] 626 | 627 | # If true, the agent captures attributes from transaction traces. 628 | # transaction_tracer.attributes.enabled: false 629 | 630 | # Prefix of attributes to exclude from transaction traces. 631 | # Allows * as wildcard at end. 632 | # transaction_tracer.attributes.exclude: [] 633 | 634 | # Prefix of attributes to include in transaction traces. 635 | # Allows * as wildcard at end. 636 | # transaction_tracer.attributes.include: [] 637 | 638 | # If true, enables collection of transaction traces. 639 | # transaction_tracer.enabled: true 640 | 641 | # Threshold (in seconds) above which the agent will collect explain plans. 642 | # Relevant only when explain.enabled is true. 643 | # transaction_tracer.explain_threshold: 0.5 644 | 645 | # If true, enables the collection of explain plans in transaction traces. 646 | # This setting will also apply to explain plans in slow SQL traces if 647 | # slow_sql.explain enabled is not set separately. 648 | # transaction_tracer.explain.enabled: true 649 | 650 | # Maximum number of transaction trace nodes to record in a single transaction 651 | # trace. 652 | # transaction_tracer.limit_segments: 4000 653 | 654 | # If true, the agent records Redis command arguments in transaction traces. 655 | # transaction_tracer.record_redis_arguments: false 656 | 657 | # Obfuscation level for SQL queries reported in transaction trace nodes. 658 | # By default, this is set to obfuscated, which strips out the numeric and string 659 | # literals. If you do not want the agent to capture query information, set this 660 | # to 'none'. If you want the agent to capture all query information in its 661 | # original form, set this to 'raw'. When you enable high security mode this is 662 | # automatically set to 'obfuscated' 663 | # transaction_tracer.record_sql: 'obfuscated' 664 | 665 | # Specify a threshold in seconds. The agent includes stack traces in transaction 666 | # trace nodes when the stack trace duration exceeds this threshold. 667 | # transaction_tracer.stack_trace_threshold: 0.5 668 | 669 | # Specify a threshold in seconds. Transactions with a duration longer than this 670 | # threshold are eligible for transaction traces. Specify a float value or the 671 | # string apdex_f. 672 | # transaction_tracer.transaction_threshold: 1.0 673 | 674 | # If true, the agent automatically detects that it is running in an AWS 675 | # environment. 676 | # utilization.detect_aws: true 677 | 678 | # If true, the agent automatically detects that it is running in an Azure 679 | # environment. 680 | # utilization.detect_azure: true 681 | 682 | # If true, the agent automatically detects that it is running in Docker. 683 | # utilization.detect_docker: true 684 | 685 | # If true, the agent automatically detects that it is running in an Google Cloud 686 | # Platform environment. 687 | # utilization.detect_gcp: true 688 | 689 | # If true, the agent automatically detects that it is running in Kubernetes. 690 | # utilization.detect_kubernetes: true 691 | 692 | # If true, the agent automatically detects that it is running in a Pivotal Cloud Foundry environment. 693 | # utilization.detect_pcf: true 694 | 695 | # Environment-specific settings are in this section. 696 | # RAILS_ENV or RACK_ENV (as appropriate) is used to determine the environment. 697 | # If your application has other named environments, configure them here. 698 | development: 699 | <<: *default_settings 700 | app_name: <%= ENV["NEW_RELIC_APP_NAME"] %> (Development) 701 | 702 | test: 703 | <<: *default_settings 704 | # It doesn't make sense to report to New Relic from automated test runs. 705 | monitor_mode: false 706 | 707 | production: 708 | <<: *default_settings 709 | -------------------------------------------------------------------------------- /config/puma.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # Puma can serve each request in a thread from an internal thread pool. 4 | # The `threads` method setting takes two numbers: a minimum and maximum. 5 | # Any libraries that use thread pools should be configured to match 6 | # the maximum value specified for Puma. Default is set to 5 threads for minimum 7 | # and maximum; this matches the default thread size of Active Record. 8 | # 9 | max_threads_count = ENV.fetch('RAILS_MAX_THREADS', 5) 10 | min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count } 11 | threads min_threads_count, max_threads_count 12 | 13 | # Specifies the `worker_timeout` threshold that Puma will use to wait before 14 | # terminating a worker in development environments. 15 | # 16 | worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development' 17 | 18 | # Specifies the `port` that Puma will listen on to receive requests; default is 3000. 19 | # 20 | port ENV.fetch('PORT', 3000) 21 | 22 | # Specifies the `environment` that Puma will run in. 23 | # 24 | environment ENV.fetch('RAILS_ENV', 'development') 25 | 26 | # Specifies the `pidfile` that Puma will use. 27 | pidfile ENV.fetch('PIDFILE', 'tmp/pids/server.pid') 28 | 29 | # Specifies the number of `workers` to boot in clustered mode. 30 | # Workers are forked web server processes. If using threads and workers together 31 | # the concurrency of the application would be max `threads` * `workers`. 32 | # Workers do not work on JRuby or Windows (both of which do not support 33 | # processes). 34 | # 35 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 36 | 37 | # Use the `preload_app!` method when specifying a `workers` number. 38 | # This directive tells Puma to first boot the application and load code 39 | # before forking the application. This takes advantage of Copy On Write 40 | # process behavior so workers use less memory. 41 | # 42 | # preload_app! 43 | 44 | # Allow puma to be restarted by `rails restart` command. 45 | plugin :tmp_restart 46 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Rails.application.routes.draw do 4 | # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html 5 | 6 | root 'pages#home' 7 | get :hello_world, to: 'pages#hello_world' 8 | end 9 | -------------------------------------------------------------------------------- /config/shakapacker.yml: -------------------------------------------------------------------------------- 1 | # Note: You must restart bin/shakapacker-dev-server for changes to take effect 2 | # This file contains the defaults used by shakapacker. 3 | 4 | default: &default 5 | source_path: app/javascript 6 | 7 | # You can have a subdirectory of the source_path, like 'packs' (recommended). 8 | # Alternatively, you can use '/' to use the whole source_path directory. 9 | # Notice that this is a relative path to source_path 10 | source_entry_path: packs 11 | 12 | # If nested_entries is true, then we'll pick up subdirectories within the source_entry_path. 13 | # You cannot set this option to true if you set source_entry_path to '/' 14 | nested_entries: true 15 | 16 | # While using a File-System-based automated bundle generation feature, miscellaneous warnings suggesting css order 17 | # conflicts may arise due to the mini-css-extract-plugin. For projects where css ordering has been mitigated through 18 | # consistent use of scoping or naming conventions, the css order warnings can be disabled by setting 19 | # css_extract_ignore_order_warnings to true 20 | css_extract_ignore_order_warnings: false 21 | 22 | public_root_path: public 23 | public_output_path: packs 24 | cache_path: tmp/shakapacker 25 | webpack_compile_output: true 26 | # See https://github.com/shakacode/shakapacker#deployment 27 | shakapacker_precompile: true 28 | 29 | # Location for manifest.json, defaults to {public_output_path}/manifest.json if unset 30 | # manifest_path: public/packs/manifest.json 31 | 32 | # Additional paths webpack should look up modules 33 | # ['app/assets', 'engine/foo/app/assets'] 34 | additional_paths: [] 35 | 36 | # Reload manifest.json on all requests so we reload latest compiled packs 37 | cache_manifest: false 38 | 39 | # Select loader to use, available options are 'babel' (default), 'swc' or 'esbuild' 40 | webpack_loader: 'babel' 41 | 42 | # Raises an error if there is a mismatch in the shakapacker gem and npm package being used 43 | ensure_consistent_versioning: true 44 | 45 | # Select whether the compiler will use SHA digest ('digest' option) or most most recent modified timestamp ('mtime') to determine freshness 46 | compiler_strategy: digest 47 | 48 | # Select whether the compiler will always use a content hash and not just in production 49 | # Don't use contentHash except for production for performance 50 | # https://webpack.js.org/guides/build-performance/#avoid-production-specific-tooling 51 | useContentHash: false 52 | 53 | # Setting the asset host here will override Rails.application.config.asset_host. 54 | # Here, you can set different asset_host per environment. Note that 55 | # SHAKAPACKER_ASSET_HOST will override both configurations. 56 | # asset_host: custom-path 57 | 58 | development: 59 | <<: *default 60 | compile: true 61 | compiler_strategy: mtime 62 | 63 | # Reference: https://webpack.js.org/configuration/dev-server/ 64 | # Keys not described there are documented inline and in https://github.com/shakacode/shakapacker/ 65 | dev_server: 66 | # For running dev server with https, set `server: https`. 67 | # server: https 68 | 69 | host: localhost 70 | port: 3035 71 | # Hot Module Replacement updates modules while the application is running without a full reload 72 | # Used instead of the `hot` key in https://webpack.js.org/configuration/dev-server/#devserverhot 73 | hmr: false 74 | # If HMR is on, CSS will by inlined by delivering it as part of the script payload via style-loader. Be sure 75 | # that you add style-loader to your project dependencies. 76 | # 77 | # If you want to instead deliver CSS via with the mini-css-extract-plugin, set inline_css to false. 78 | # In that case, style-loader is not needed as a dependency. 79 | # 80 | # mini-css-extract-plugin is a required dependency in both cases. 81 | inline_css: true 82 | # Defaults to the inverse of hmr. Uncomment to manually set this. 83 | # live_reload: true 84 | client: 85 | # Should we show a full-screen overlay in the browser when there are compiler errors or warnings? 86 | overlay: true 87 | # May also be a string 88 | # webSocketURL: 89 | # hostname: '0.0.0.0' 90 | # pathname: '/ws' 91 | # port: 8080 92 | # Should we use gzip compression? 93 | compress: true 94 | # Note that apps that do not check the host are vulnerable to DNS rebinding attacks 95 | allowed_hosts: 'auto' 96 | # Shows progress and colorizes output of bin/shakapacker[-dev-server] 97 | pretty: true 98 | headers: 99 | 'Access-Control-Allow-Origin': '*' 100 | static: 101 | watch: 102 | ignored: '**/node_modules/**' 103 | 104 | test: 105 | <<: *default 106 | compile: true 107 | 108 | # Compile test packs to a separate directory 109 | public_output_path: packs-test 110 | 111 | production: 112 | <<: *default 113 | 114 | # Production depends on precompilation of packs prior to booting for performance. 115 | compile: false 116 | 117 | # Use content hash for naming assets. Cannot be overridden by for production. 118 | useContentHash: true 119 | 120 | # Cache manifest.json for performance 121 | cache_manifest: true 122 | -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Spring.watch( 4 | '.ruby-version', 5 | '.rbenv-vars', 6 | 'tmp/restart.txt', 7 | 'tmp/caching-dev.txt' 8 | ) 9 | -------------------------------------------------------------------------------- /config/storage.yml: -------------------------------------------------------------------------------- 1 | test: 2 | service: Disk 3 | root: <%= Rails.root.join("tmp/storage") %> 4 | 5 | local: 6 | service: Disk 7 | root: <%= Rails.root.join("storage") %> 8 | 9 | # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) 10 | # amazon: 11 | # service: S3 12 | # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> 13 | # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> 14 | # region: us-east-1 15 | # bucket: your_own_bucket 16 | 17 | # Remember not to checkin your GCS keyfile to a repository 18 | # google: 19 | # service: GCS 20 | # project: your_project 21 | # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> 22 | # bucket: your_own_bucket 23 | 24 | # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) 25 | # microsoft: 26 | # service: AzureStorage 27 | # storage_account_name: your_account_name 28 | # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> 29 | # container: your_container_name 30 | 31 | # mirror: 32 | # service: Mirror 33 | # primary: local 34 | # mirrors: [ amazon, google, microsoft ] 35 | -------------------------------------------------------------------------------- /config/webpack/development.js: -------------------------------------------------------------------------------- 1 | const ESLintPlugin = require('eslint-webpack-plugin') 2 | const StyleLintPlugin = require('stylelint-webpack-plugin') 3 | 4 | module.exports = { 5 | envSpecificConfig: { 6 | plugins: [ 7 | new ESLintPlugin({ 8 | failOnError: false, 9 | files: 'app/javascript/**/*.js', 10 | exclude: 'app/javascript/**/vendor/*.js' 11 | }), 12 | new StyleLintPlugin({ 13 | failOnError: false, 14 | files: 'app/javascript/**/*.(s(c|a)ss|css)' 15 | }) 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /config/webpack/webpack.config.js: -------------------------------------------------------------------------------- 1 | const { env, generateWebpackConfig, merge } = require('shakapacker') 2 | const { existsSync } = require('fs') 3 | const { resolve } = require('path') 4 | 5 | const webpack = require('webpack') 6 | 7 | let customConfig = { 8 | module: { 9 | rules: [ 10 | { 11 | test: /\.scss$/, 12 | use: [ 13 | { loader: 'resolve-url-loader' }, 14 | { loader: 'sass-loader', options: { sourceMap: true } } 15 | ] 16 | } 17 | ] 18 | } 19 | } 20 | 21 | const path = resolve(__dirname, `${env.nodeEnv}.js`) 22 | 23 | if (existsSync(path)) { 24 | console.log(`Loading ENV specific webpack configuration file ${path}`) 25 | const { envSpecificConfig } = require(path) 26 | customConfig = merge(customConfig, envSpecificConfig) 27 | } 28 | 29 | const webpackConfig = generateWebpackConfig() 30 | module.exports = merge(webpackConfig, customConfig) 31 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # This file is the source Rails uses to define your schema when running `bin/rails 6 | # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to 7 | # be faster and is potentially less error prone than running all of your 8 | # migrations from scratch. Old migrations may fail to apply correctly if those 9 | # migrations use external dependencies or application code. 10 | # 11 | # It's strongly recommended that you check this file into your version control system. 12 | 13 | ActiveRecord::Schema.define(version: 0) do 14 | 15 | # These are extensions that must be enabled in order to support this database 16 | enable_extension "plpgsql" 17 | 18 | end 19 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) 7 | # Character.create(name: 'Luke', movie: movies.first) 8 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/lib/tasks/.keep -------------------------------------------------------------------------------- /lib/tasks/lint.rake: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | desc 'Run all available code linters' 4 | task :lint 5 | 6 | task(:default).prerequisites.unshift task(:lint) 7 | -------------------------------------------------------------------------------- /lib/tasks/rubocop.rake: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | if %w[development test].include? Rails.env 4 | require 'rubocop/rake_task' 5 | RuboCop::RakeTask.new 6 | 7 | task(:lint).sources.unshift :rubocop 8 | end 9 | -------------------------------------------------------------------------------- /lib/tasks/slim_lint.rake: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | if %w[development test].include? Rails.env 4 | require 'slim_lint/rake_task' 5 | SlimLint::RakeTask.new 6 | 7 | task(:lint).sources.push :slim_lint 8 | end 9 | -------------------------------------------------------------------------------- /lib/tasks/yarn_linters.rake: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | namespace :yarn do 4 | # rubocop:disable Rails/RakeEnvironment 5 | task :run, %i[command] do |_, args| 6 | # Install only production deps when for not usual envs. 7 | valid_node_envs = %w[test development production] 8 | node_env = ENV.fetch('NODE_ENV') do 9 | valid_node_envs.include?(Rails.env) ? Rails.env : 'production' 10 | end 11 | 12 | system( 13 | { 'NODE_ENV' => node_env }, 14 | "yarn #{args[:command]}", 15 | exception: true 16 | ) 17 | rescue Errno::ENOENT 18 | warn 'bin/yarn was not found.' 19 | exit 1 20 | end 21 | 22 | desc 'Run `bin/yarn stylelint app/**/*.{scss,css}`' 23 | task :stylelint do 24 | Rake::Task['yarn:run'].execute(command: "stylelint #{Dir.glob('app/**/*.{scss,css}').join(' ')}") 25 | end 26 | 27 | desc 'Run `bin/yarn eslint`' 28 | task :eslint do 29 | Rake::Task['yarn:run'].execute(command: 'eslint app/**/*.js') 30 | end 31 | # rubocop:enable Rails/RakeEnvironment 32 | end 33 | 34 | task(:lint).sources.push 'yarn:stylelint' 35 | task(:lint).sources.push 'yarn:eslint' 36 | -------------------------------------------------------------------------------- /log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/log/.keep -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ruby3_rails6_bootstrap_heroku", 3 | "private": true, 4 | "version": "1.0.0", 5 | "engines": { 6 | "node": ">= 20.0", 7 | "yarn": "^1.22.22" 8 | }, 9 | "packageManager": "yarn@1.22.22", 10 | "dependencies": { 11 | "@babel/core": "^7.27.4", 12 | "@babel/plugin-transform-runtime": "^7.27.4", 13 | "@babel/preset-env": "^7.27.2", 14 | "@babel/runtime": "^7.27.6", 15 | "@fortawesome/fontawesome-svg-core": "^6.7.2", 16 | "@fortawesome/free-brands-svg-icons": "^6.7.2", 17 | "@fortawesome/free-regular-svg-icons": "^6.7.2", 18 | "@fortawesome/free-solid-svg-icons": "^6.7.2", 19 | "@hotwired/turbo-rails": "^8.0.16", 20 | "@popperjs/core": "^2.11.8", 21 | "@rails/actioncable": "6.1.710", 22 | "@rails/activestorage": "6.1.710", 23 | "babel-loader": "^10.0.0", 24 | "babel-plugin-macros": "^3.1.0", 25 | "bootstrap": "^5.3.6", 26 | "compression-webpack-plugin": "^11.1.0", 27 | "css-loader": "^7.1.2", 28 | "css-minimizer-webpack-plugin": "^7.0.0", 29 | "exports-loader": "^5.0.0", 30 | "mini-css-extract-plugin": "^2.9.2", 31 | "postcss": "^8.5.4", 32 | "postcss-flexbugs-fixes": "^5.0.2", 33 | "postcss-import": "^16.1.0", 34 | "postcss-loader": "^8.1.1", 35 | "postcss-preset-env": "^10.2.1", 36 | "resolve-url-loader": "^5.0.0", 37 | "sass": "1.77.6", 38 | "sass-loader": "^16.0.5", 39 | "shakapacker": "8.3.0", 40 | "style-loader": "^4.0.0", 41 | "terser-webpack-plugin": "^5.3.12", 42 | "webpack": "^5.99.9", 43 | "webpack-assets-manifest": "^6.2.1", 44 | "webpack-cli": "^6.0.1", 45 | "webpack-merge": "^6.0.1" 46 | }, 47 | "devDependencies": { 48 | "@babel/eslint-parser": "^7.27.5", 49 | "@types/express": "^4.17.21", 50 | "@webpack-cli/serve": "^3.0.1", 51 | "eslint": "^8.57.1", 52 | "eslint-config-standard": "^17.1.0", 53 | "eslint-plugin-import": "^2.31.0", 54 | "eslint-plugin-n": "^16.6.2", 55 | "eslint-plugin-promise": "^6.6.0", 56 | "eslint-webpack-plugin": "^5.0.2", 57 | "stylelint": "16.20.0", 58 | "stylelint-config-twbs-bootstrap": "^16.0.0", 59 | "stylelint-order": "^6.0.4", 60 | "stylelint-scss": "^6.12.0", 61 | "stylelint-webpack-plugin": "^5.0.1", 62 | "webpack-dev-server": "^5.2.2" 63 | }, 64 | "babel": { 65 | "presets": [ 66 | "./node_modules/shakapacker/package/babel/preset.js" 67 | ] 68 | }, 69 | "browserslist": [ 70 | ">= 0.5%", 71 | "last 2 major versions", 72 | "not dead", 73 | "Chrome >= 60", 74 | "Firefox >= 60", 75 | "Firefox ESR", 76 | "iOS >= 12", 77 | "Safari >= 12", 78 | "not Explorer <= 11" 79 | ] 80 | } 81 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('postcss-import'), 4 | require('postcss-flexbugs-fixes'), 5 | require('postcss-preset-env')({ 6 | autoprefixer: { 7 | flexbox: 'no-2009' 8 | }, 9 | stage: 3 10 | }) 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/public/favicon.ico -------------------------------------------------------------------------------- /public/launcher-icon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/public/launcher-icon-180.png -------------------------------------------------------------------------------- /public/launcher-icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/public/launcher-icon-192.png -------------------------------------------------------------------------------- /public/launcher-icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/public/launcher-icon-512.png -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "StarterApp", 3 | "name": "Rails 6 Starter App", 4 | "icons": [ 5 | { 6 | "src": "launcher-icon-192.png", 7 | "type": "image/png", 8 | "sizes": "192x192" 9 | }, 10 | { 11 | "src": "launcher-icon-512.png", 12 | "type": "image/png", 13 | "sizes": "512x512" 14 | } 15 | ], 16 | "background_color": "#e00000", 17 | "display": "minimal-ui", 18 | "start_url": ".", 19 | "theme_color": "#e00000" 20 | } 21 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /spec/rails_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | # This file is copied to spec/ when you run 'rails generate rspec:install' 4 | require 'spec_helper' 5 | ENV['RAILS_ENV'] ||= 'test' 6 | require_relative '../config/environment' 7 | # Prevent database truncation if the environment is production 8 | abort('The Rails environment is running in production mode!') if Rails.env.production? 9 | require 'rspec/rails' 10 | # Add additional requires below this line. Rails is not loaded until this point! 11 | require 'capybara/rspec' 12 | require 'webmock/rspec' 13 | 14 | WebMock.disable_net_connect! allow: %w[localhost 127.0.0.1 *.lvh.me lvh.me] 15 | 16 | # Requires supporting ruby files with custom matchers and macros, etc, in 17 | # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are 18 | # run as spec files by default. This means that files in spec/support that end 19 | # in _spec.rb will both be required and run as specs, causing the specs to be 20 | # run twice. It is recommended that you do not name files matching this glob to 21 | # end with _spec.rb. You can configure this pattern with the --pattern 22 | # option on the command line or in ~/.rspec, .rspec or `.rspec-local`. 23 | # 24 | # The following line is provided for convenience purposes. It has the downside 25 | # of increasing the boot-up time by auto-requiring all files in the support 26 | # directory. Alternatively, in the individual `*_spec.rb` files, manually 27 | # require only the support files necessary. 28 | # 29 | Rails.root.glob('spec/support/**/*.rb').sort.each { |f| require f } 30 | 31 | # Checks for pending migrations and applies them before tests are run. 32 | # If you are not using ActiveRecord, you can remove these lines. 33 | begin 34 | ActiveRecord::Migration.maintain_test_schema! 35 | rescue ActiveRecord::PendingMigrationError => e 36 | abort e.to_s.strip 37 | end 38 | RSpec.configure do |config| 39 | # Allow to use `t` instead of `I18n.t` in specs 40 | config.include AbstractController::Translation 41 | 42 | # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures 43 | config.fixture_path = Rails.root.join('spec/fixtures') 44 | 45 | # If you're not using ActiveRecord, or you'd prefer not to run each of your 46 | # examples within a transaction, remove the following line or assign false 47 | # instead of true. 48 | config.use_transactional_fixtures = true 49 | 50 | # You can uncomment this line to turn off ActiveRecord support entirely. 51 | # config.use_active_record = false 52 | 53 | # RSpec Rails can automatically mix in different behaviours to your tests 54 | # based on their file location, for example enabling you to call `get` and 55 | # `post` in specs under `spec/controllers`. 56 | # 57 | # You can disable this behaviour by removing the line below, and instead 58 | # explicitly tag your specs with their type, e.g.: 59 | # 60 | # RSpec.describe UsersController, type: :controller do 61 | # # ... 62 | # end 63 | # 64 | # The different available types are documented in the features, such as in 65 | # https://rspec.info/features/6-0/rspec-rails 66 | config.infer_spec_type_from_file_location! 67 | 68 | # Filter lines from Rails gems in backtraces. 69 | config.filter_rails_from_backtrace! 70 | # arbitrary gems may also be filtered via: 71 | # config.filter_gems_from_backtrace("gem name") 72 | 73 | config.before(:each, type: :system) do 74 | driven_by :rack_test 75 | end 76 | 77 | config.before(:each, :js, type: :system) do 78 | driven_by :custom_chrome 79 | SeleniumBrowserErrorReporter.clear_error_logs!(page) 80 | end 81 | 82 | config.after(:each, :js, type: :system) do |spec| 83 | SeleniumBrowserErrorReporter.call(page) unless spec.metadata.fetch(:allow_js_errors, false) 84 | end 85 | end 86 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'simplecov' 4 | 5 | SimpleCov.start 'rails' do 6 | if ENV['CI'] 7 | require 'simplecov-lcov' 8 | 9 | SimpleCov::Formatter::LcovFormatter.config do |c| 10 | c.report_with_single_file = true 11 | c.single_report_path = 'coverage/lcov.info' 12 | end 13 | 14 | formatter SimpleCov::Formatter::LcovFormatter 15 | end 16 | end 17 | 18 | # This file was generated by the `rails generate rspec:install` command. Conventionally, all 19 | # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. 20 | # The generated `.rspec` file contains `--require spec_helper` which will cause 21 | # this file to always be loaded, without a need to explicitly require it in any 22 | # files. 23 | # 24 | # Given that it is always loaded, you are encouraged to keep this file as 25 | # light-weight as possible. Requiring heavyweight dependencies from this file 26 | # will add to the boot time of your test suite on EVERY test run, even for an 27 | # individual file that may not need all of that loaded. Instead, consider making 28 | # a separate helper file that requires the additional dependencies and performs 29 | # the additional setup, and require it from the spec files that actually need 30 | # it. 31 | # 32 | # See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration 33 | RSpec.configure do |config| 34 | # rspec-expectations config goes here. You can use an alternate 35 | # assertion/expectation library such as wrong or the stdlib/minitest 36 | # assertions if you prefer. 37 | config.expect_with :rspec do |expectations| 38 | # This option will default to `true` in RSpec 4. It makes the `description` 39 | # and `failure_message` of custom matchers include text for helper methods 40 | # defined using `chain`, e.g.: 41 | # be_bigger_than(2).and_smaller_than(4).description 42 | # # => "be bigger than 2 and smaller than 4" 43 | # ...rather than: 44 | # # => "be bigger than 2" 45 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true 46 | end 47 | 48 | # rspec-mocks config goes here. You can use an alternate test double 49 | # library (such as bogus or mocha) by changing the `mock_with` option here. 50 | config.mock_with :rspec do |mocks| 51 | # Prevents you from mocking or stubbing a method that does not exist on 52 | # a real object. This is generally recommended, and will default to 53 | # `true` in RSpec 4. 54 | mocks.verify_partial_doubles = true 55 | end 56 | 57 | # This option will default to `:apply_to_host_groups` in RSpec 4 (and will 58 | # have no way to turn it off -- the option exists only for backwards 59 | # compatibility in RSpec 3). It causes shared context metadata to be 60 | # inherited by the metadata hash of host groups and examples, rather than 61 | # triggering implicit auto-inclusion in groups with matching metadata. 62 | config.shared_context_metadata_behavior = :apply_to_host_groups 63 | 64 | # This allows you to limit a spec run to individual examples or groups 65 | # you care about by tagging them with `:focus` metadata. When nothing 66 | # is tagged with `:focus`, all examples get run. RSpec also provides 67 | # aliases for `it`, `describe`, and `context` that include `:focus` 68 | # metadata: `fit`, `fdescribe` and `fcontext`, respectively. 69 | config.filter_run_when_matching :focus 70 | 71 | # Allows RSpec to persist some state between runs in order to support 72 | # the `--only-failures` and `--next-failure` CLI options. We recommend 73 | # you configure your source control system to ignore this file. 74 | config.example_status_persistence_file_path = 'spec/examples.txt' 75 | 76 | # Limits the available syntax to the non-monkey patched syntax that is 77 | # recommended. For more details, see: 78 | # https://rspec.info/features/3-12/rspec-core/configuration/zero-monkey-patching-mode/ 79 | config.disable_monkey_patching! 80 | 81 | # Many RSpec users commonly either run the entire suite or an individual 82 | # file, and it's useful to allow more verbose output when running an 83 | # individual spec file. 84 | if config.files_to_run.one? 85 | # Use the documentation formatter for detailed output, 86 | # unless a formatter has already been configured 87 | # (e.g. via a command-line flag). 88 | config.default_formatter = 'doc' 89 | end 90 | 91 | # Print the 10 slowest examples and example groups at the 92 | # end of the spec run, to help surface which specs are running 93 | # particularly slow. 94 | config.profile_examples = 10 95 | 96 | # Run specs in random order to surface order dependencies. If you find an 97 | # order dependency and want to debug it, you can fix the order by providing 98 | # the seed, which is printed after each run. 99 | # --seed 1234 100 | config.order = :random 101 | 102 | # Seed global randomization in this process using the `--seed` CLI option. 103 | # Setting this allows you to use `--seed` to deterministically reproduce 104 | # test failures related to randomization by passing the same `--seed` value 105 | # as the one that triggered the failure. 106 | Kernel.srand config.seed 107 | end 108 | -------------------------------------------------------------------------------- /spec/support/capybara.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Capybara.register_driver :custom_chrome do |app| 4 | opts = Selenium::WebDriver::Chrome::Options.new 5 | 6 | # See https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md 7 | # See https://github.com/puppeteer/puppeteer/blob/main/packages/puppeteer-core/src/node/ChromeLauncher.ts#L169C10-L169C32 8 | disabled_features = [ 9 | 'Translate', 10 | 'AcceptCHFrame', # crbug.com/1348106 11 | 'BackForwardCache', 12 | 'MediaRouter', 13 | 'OptimizationHints', 14 | 'ProcessPerSiteUpToMainFrameThreshold' # crbug.com/1492053 15 | ] 16 | 17 | enabled_features = [ 18 | 'NetworkServiceInProcess2' 19 | ] 20 | 21 | opts.add_argument('allow-pre-commit-input') 22 | opts.add_argument('disable-background-networking') 23 | opts.add_argument('disable-background-timer-throttling') 24 | opts.add_argument('disable-backgrounding-occluded-windows') 25 | opts.add_argument('disable-breakpad') 26 | opts.add_argument('disable-client-side-phishing-detection') 27 | opts.add_argument('disable-component-extensions-with-background-pages') 28 | opts.add_argument('disable-component-update') 29 | opts.add_argument('disable-default-apps') 30 | opts.add_argument('disable-dev-shm-usage') 31 | opts.add_argument('disable-extensions') 32 | opts.add_argument('disable-field-trial-config') # https://source.chromium.org/chromium/chromium/src/+/main:testing/variations/README.md 33 | opts.add_argument("disable-features=#{disabled_features.join(',')}") 34 | opts.add_argument('disable-hang-monitor') 35 | opts.add_argument('disable-infobars') 36 | opts.add_argument('disable-ipc-flooding-protection') 37 | opts.add_argument('disable-popup-blocking') 38 | opts.add_argument('disable-prompt-on-repost') 39 | opts.add_argument('disable-renderer-backgrounding') 40 | opts.add_argument('disable-search-engine-choice-screen') 41 | opts.add_argument('disable-sync') 42 | opts.add_argument('enable-automation') 43 | # TODO(sadym): remove 'enable-blink-features=IdleDetection' once 44 | # IdleDetection is turned on by default. 45 | opts.add_argument('enable-blink-features=IdleDetection') 46 | opts.add_argument("enable-features=#{enabled_features.join(',')}") 47 | opts.add_argument('export-tagged-pdf') 48 | opts.add_argument('force-color-profile=srgb') 49 | opts.add_argument('metrics-recording-only') 50 | opts.add_argument('no-first-run') 51 | opts.add_argument('password-store=basic') 52 | opts.add_argument('use-mock-keychain') 53 | 54 | opts.add_argument('no-sandbox') 55 | opts.add_argument('disable-gpu') 56 | opts.add_argument('window-size=1024,768') 57 | 58 | unless ActiveModel::Type::Boolean::FALSE_VALUES.include?(ENV['HEADLESS']) 59 | opts.add_argument('headless=new') 60 | opts.add_argument('hide-scrollbars') 61 | opts.add_argument('mute-audio') 62 | end 63 | 64 | Capybara::Selenium::Driver.new(app, browser: :chrome, options: opts) 65 | end 66 | 67 | Capybara.configure do |config| 68 | config.default_max_wait_time = 10 69 | config.default_driver = :custom_chrome 70 | config.javascript_driver = :custom_chrome 71 | config.disable_animation = true 72 | end 73 | -------------------------------------------------------------------------------- /spec/support/factory_bot.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | RSpec.configure do |config| 4 | config.include FactoryBot::Syntax::Methods 5 | end 6 | -------------------------------------------------------------------------------- /spec/support/mailer_macros.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module MailerMacros 4 | def last_email 5 | ActionMailer::Base.deliveries.last 6 | end 7 | 8 | def reset_emails 9 | ActionMailer::Base.deliveries = [] 10 | end 11 | end 12 | 13 | RSpec.configure do |config| 14 | config.include MailerMacros 15 | 16 | config.before do 17 | reset_emails 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /spec/support/selenium_browser_error_reporter.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class SeleniumBrowserErrorReporter 4 | SEVERE_LOG_LEVEL = 'SEVERE' 5 | 6 | def self.call(page) 7 | new(page).report! 8 | end 9 | 10 | def self.clear_error_logs!(page) 11 | new(page).clear_error_logs! 12 | end 13 | 14 | def initialize(page) 15 | self.page = page 16 | end 17 | 18 | def report! 19 | raise error_messages if severe_errors.any? 20 | end 21 | 22 | def clear_error_logs! 23 | logs.clear 24 | end 25 | 26 | private 27 | 28 | attr_accessor :page 29 | 30 | def error_report_for(errors) 31 | errors 32 | .map(&:message) 33 | .map { |message| message.gsub('\\n', "\n") } 34 | .join("\n\n") 35 | end 36 | 37 | def logs 38 | @logs ||= page.driver.browser.manage.logs.get(:browser) 39 | end 40 | 41 | def severe_errors 42 | @severe_errors ||= logs.select { |log| log.level == SEVERE_LOG_LEVEL } 43 | end 44 | 45 | def errors_description 46 | if severe_errors.one? 47 | 'There was 1 JavaScript error:' 48 | else 49 | "There were #{severe_errors.size} JavaScript errors:" 50 | end 51 | end 52 | 53 | def error_messages 54 | [errors_description, error_report_for(severe_errors)].join "\n\n" 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /spec/support/shoulda_matchers.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Shoulda::Matchers.configure do |config| 4 | config.integrate do |with| 5 | with.test_framework :rspec 6 | with.library :rails 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /spec/system/pages_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rails_helper' 4 | 5 | RSpec.describe 'Pages' do 6 | describe 'Home' do 7 | it 'has application name in title' do 8 | visit root_path 9 | 10 | expect(page).to have_title t('app_name') 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /storage/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/storage/.keep -------------------------------------------------------------------------------- /tmp/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/tmp/.keep -------------------------------------------------------------------------------- /tmp/pids/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/tmp/pids/.keep -------------------------------------------------------------------------------- /vendor/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby3-rails6-bootstrap-heroku/3a030592baf1e47927b6e5835983d72591ec32c8/vendor/.keep --------------------------------------------------------------------------------