├── .browserslistrc ├── .codeclimate.yml ├── .github ├── dependabot.yml └── workflows │ ├── ci.yml │ └── lint.yml ├── .gitignore ├── .rspec ├── .rubocop.yml ├── .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 │ └── javascripts │ │ └── channels │ │ └── .keep ├── channels │ └── application_cable │ │ ├── channel.rb │ │ └── connection.rb ├── controllers │ ├── application_controller.rb │ ├── concerns │ │ └── .keep │ └── pages_controller.rb ├── helpers │ └── application_helper.rb ├── javascript │ ├── images │ │ └── .keep │ ├── packs │ │ ├── application.js │ │ └── application.scss │ ├── src │ │ ├── .keep │ │ ├── bootstrap.js │ │ └── fontawesome.js │ └── stylesheets │ │ ├── bootstrap-variables.scss │ │ ├── bootstrap.scss │ │ └── turbolinks-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 ├── babel.config.js ├── bin ├── bundle ├── rails ├── rake ├── setup ├── spring ├── update ├── webpack ├── webpack-dev-server └── yarn ├── 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 │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ └── wrap_parameters.rb ├── locales │ └── en.yml ├── newrelic.yml ├── puma.rb ├── routes.rb ├── spring.rb ├── storage.yml ├── webpack │ ├── development.js │ ├── environment.js │ ├── production.js │ └── test.js └── webpacker.yml ├── 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 └── system │ └── pages_spec.rb ├── tmp ├── .keep └── pids │ └── .keep ├── vendor └── .keep └── yarn.lock /.browserslistrc: -------------------------------------------------------------------------------- 1 | >= 1% 2 | last 1 major version 3 | not dead 4 | Chrome >= 45 5 | Firefox >= 38 6 | Edge >= 12 7 | Explorer >= 10 8 | iOS >= 9 9 | Safari >= 9 10 | Android >= 4.4 11 | Opera >= 30 12 | -------------------------------------------------------------------------------- /.codeclimate.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | exclude_patterns: 3 | - 'config/' 4 | - 'db/' 5 | - 'dist/' 6 | - 'features/' 7 | - '**/node_modules/' 8 | - 'script/' 9 | - '**/spec/' 10 | - '**/test/' 11 | - '**/tests/' 12 | - 'Tests/' 13 | - '**/vendor/' 14 | - '**/*_test.go' 15 | - '**/*.d.ts' 16 | - 'babel.config.js' 17 | - 'postcss.config.js' 18 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | schedule: 6 | interval: weekly 7 | time: "04:00" 8 | - package-ecosystem: bundler 9 | directory: "/" 10 | schedule: 11 | interval: weekly 12 | time: "04:00" 13 | open-pull-requests-limit: 10 14 | ignore: 15 | - dependency-name: rails 16 | versions: 17 | - ">= 6" 18 | groups: 19 | rubocop: 20 | patterns: 21 | - "rubocop*" 22 | - package-ecosystem: npm 23 | directory: "/" 24 | schedule: 25 | interval: weekly 26 | time: "04:00" 27 | open-pull-requests-limit: 10 28 | ignore: 29 | - dependency-name: bootstrap 30 | versions: 31 | - ">= 5" 32 | - dependency-name: webpack 33 | versions: 34 | - ">= 5" 35 | - dependency-name: webpack-cli 36 | versions: 37 | - ">= 4" 38 | groups: 39 | babel: 40 | patterns: 41 | - "@babel/*" 42 | fontawesome: 43 | patterns: 44 | - "@fortawesome/*" 45 | rails: 46 | patterns: 47 | - "@rails/*" 48 | webpack: 49 | patterns: 50 | - "webpack*" 51 | -------------------------------------------------------------------------------- /.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: b8cc3ac9ab8a3280b03af3d29b2e50ca 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/ruby2-rails5-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 | - uses: nanasess/setup-chromedriver@v2 43 | - name: Set up Ruby 44 | uses: ruby/setup-ruby@v1 45 | with: 46 | ruby-version: '2.6.10' 47 | bundler-cache: true 48 | rubygems: latest 49 | - name: Set up Node 50 | uses: actions/setup-node@v4 51 | with: 52 | node-version: '16' 53 | cache: 'yarn' 54 | - name: Yarn 55 | run: yarn 56 | - name: Set up Database 57 | run: bundle exec rails db:create 58 | - name: Run specs 59 | run: bundle exec rake spec 60 | - name: Coveralls 61 | uses: coverallsapp/github-action@master 62 | with: 63 | github-token: ${{ secrets.github_token }} 64 | path-to-lcov: 'coverage/lcov.info' 65 | -------------------------------------------------------------------------------- /.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: '2.6.10' 23 | bundler-cache: true 24 | - name: Set up Node 25 | uses: actions/setup-node@v4 26 | with: 27 | node-version: '16' 28 | cache: 'yarn' 29 | - name: Yarn 30 | run: yarn 31 | - name: Run lints 32 | run: bundle exec rake lint 33 | -------------------------------------------------------------------------------- /.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 | 20 | /node_modules 21 | /yarn-error.log 22 | 23 | /public/assets 24 | .byebug_history 25 | 26 | # Ignore master key for decrypting credentials and more. 27 | /config/master.key 28 | 29 | /public/packs 30 | /public/packs-test 31 | /node_modules 32 | /yarn-error.log 33 | yarn-debug.log* 34 | .yarn-integrity 35 | 36 | /coverage/* 37 | /spec/examples.txt 38 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | require: 2 | - rubocop-capybara 3 | - rubocop-performance 4 | - rubocop-rails 5 | - rubocop-rspec 6 | 7 | AllCops: 8 | TargetRailsVersion: 5.2 9 | TargetRubyVersion: 2.6 10 | NewCops: enable 11 | DisplayStyleGuide: true 12 | ExtraDetails: true 13 | Exclude: 14 | - '.git/**/*' 15 | - 'bin/*' 16 | - 'db/**/*' 17 | - 'log/**/*' 18 | - 'node_modules/**/*' 19 | - 'public/**/*' 20 | - 'tmp/**/*' 21 | - 'vendor/**/*' 22 | 23 | Layout/LineLength: 24 | Enabled: false 25 | 26 | Metrics/BlockLength: 27 | Enabled: false 28 | 29 | Metrics/MethodLength: 30 | Exclude: 31 | - 'spec/**/*' 32 | 33 | Metrics/ModuleLength: 34 | Exclude: 35 | - 'spec/**/*' 36 | 37 | RSpec/DescribeClass: 38 | Exclude: 39 | - 'spec/features/**/*' 40 | - 'spec/requests/**/*' 41 | - 'spec/system/**/*' 42 | 43 | Style/Documentation: 44 | Enabled: false 45 | 46 | Style/IfUnlessModifier: 47 | Enabled: false 48 | -------------------------------------------------------------------------------- /.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 | "stylistic/block-closing-brace-empty-line-before": "never", 14 | "declaration-empty-line-before": ["always", { 15 | "except": ["first-nested"], 16 | "ignore": ["after-comment", "after-declaration"] 17 | }], 18 | "function-disallowed-list": [ 19 | "calc" 20 | ], 21 | "rule-empty-line-before": ["always", { 22 | "except": ["first-nested"], 23 | "ignore": ["after-comment"] 24 | }], 25 | "selector-class-pattern": "^[a-z][a-z0-9\\-_]*[a-z0-9]$" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 7.3.0 / 2021-04-28 4 | 5 | * [FEATURE] Ruby 2.6.7 6 | * [ENHANCEMENT] Update dependencies 7 | 8 | ## 7.2.0 / 2021-03-27 9 | 10 | * [FEATURE] Rails 5.2.5 11 | * [FEATURE] Font Awesome 5.15.3 12 | * [ENHANCEMENT] Update dependencies 13 | 14 | ## 7.1.0 / 2021-01-29 15 | 16 | * [FEATURE] Bootstrap 4.6.0 17 | * [FEATURE] Font Awesome 5.15.2 18 | * [ENHANCEMENT] Update dependencies 19 | 20 | ## 7.0.0 / 2020-12-27 21 | 22 | * [FEATURE] Bootstrap 4.5.3 23 | * [FEATURE] Change webpacker folder structure 24 | * [ENHANCEMENT] Update dependencies 25 | 26 | ## 6.2.0 / 2020-10-10 27 | 28 | * [FEATURE] Font Awesome 5.15.1 29 | * [BUGFIX] Fix Heroku app.json postdeploy script 30 | * [ENHANCEMENT] Update dependencies 31 | 32 | ## 6.1.0 / 2020-08-07 33 | 34 | * [FEATURE] Bootstrap 4.5.2 35 | * [FEATURE] Font Awesome 5.14.0 36 | * [ENHANCEMENT] Update dependencies 37 | 38 | ## 6.0.0 / 2020-06-13 39 | 40 | * [FEATURE] Ruby 2.6.6 41 | * [FEATURE] Rails 5.2.4.3 42 | * [FEATURE] Bootstrap 4.5.0 43 | * [ENHANCEMENT] Update dependencies 44 | 45 | ## 5.0.0 / 2020-05-05 46 | 47 | * [FEATURE] Responsive Typography 48 | * [FEATURE] jQuery 3.5.1 49 | * [ENHANCEMENT] Update dependencies 50 | 51 | ## 4.15.0 / 2020-04-10 52 | 53 | * [FEATURE] Ruby 2.7.1 54 | * [FEATURE] Rails 5.2.4.2 55 | * [FEATURE] Font Awesome 5.13.0 56 | * [ENHANCEMENT] Update dependencies 57 | 58 | ## 4.14.0 / 2019-12-25 59 | 60 | * [FEATURE] Rails 5.2.4.1 61 | 62 | ## 4.13.1 / 2019-12-25 63 | 64 | * [BUGFIX] Fix Homepage 65 | 66 | ## 4.13.0 / 2019-12-25 67 | 68 | * [FEATURE] Ruby 2.7 69 | * [ENHANCEMENT] Update dependencies 70 | 71 | ## 4.12.0 / 2019-12-11 72 | 73 | * [FEATURE] Font Awesome 5.12.0 74 | * [ENHANCEMENT] Update dependencies 75 | 76 | ## 4.11.0 / 2019-12-07 77 | 78 | * [FEATURE] Rails 5.2.4 79 | * [FEATURE] Bootstrap 4.4.1 80 | * [ENHANCEMENT] Update dependencies 81 | 82 | ## 4.10.0 / 2019-10-30 83 | 84 | * [FEATURE] Ruby 2.6.5 85 | * [FEATURE] Font Awesome 5.11.2 86 | * [ENHANCEMENT] Update dependencies 87 | 88 | ## 4.9.0 / 2019-09-01 89 | 90 | * [FEATURE] Ruby 2.6.4 91 | * [FEATURE] Font Awesome 5.10.2 92 | * [FEATURE] Add JavaScript Standard Style linter 93 | * [ENHANCEMENT] Speed up RuboCop analysis 94 | * [ENHANCEMENT] Update dependencies 95 | 96 | ## 4.8.0 / 2019-08-06 97 | 98 | * [FEATURE] Font Awesome 5.10.1 99 | * [ENHANCEMENT] Update dependencies 100 | 101 | ## 4.7.1 / 2019-04-30 102 | 103 | * [ENHANCEMENT] Update dependencies 104 | 105 | ## 4.7.0 / 2019-04-18 106 | 107 | * [FEATURE] Ruby 2.6.3 108 | * [ENHANCEMENT] Update dependencies 109 | 110 | ## 4.6.0 / 2019-03-22 111 | 112 | * [FEATURE] Rails 5.2.3 113 | * [ENHANCEMENT] Update dependencies 114 | 115 | ## 4.5.0 / 2019-03-22 116 | 117 | * [FEATURE] Font Awesome 5.8.1 118 | * [ENHANCEMENT] Update dependencies 119 | 120 | ## 4.4.0 / 2019-03-20 121 | 122 | * [FEATURE] Font Awesome 5.8.0 123 | * [ENHANCEMENT] Update dependencies 124 | 125 | ## 4.3.0 / 2019-03-14 126 | 127 | * [FEATURE] Ruby 2.6.2 128 | * [FEATURE] Bundler 2 129 | 130 | ## 4.2.0 / 2019-03-14 131 | 132 | * [FEATURE] Rails 5.2.2.1 133 | * [ENHANCEMENT] Update dependencies 134 | 135 | ## 4.1.0 / 2019-03-05 136 | 137 | * [FEATURE] Webpacker 4 138 | * [ENHANCEMENT] Update dependencies 139 | 140 | ## 4.0.1 / 2019-02-13 141 | 142 | * [FEATURE] Bootstrap 4.3.1 143 | 144 | ## 4.0.0 / 2019-02-13 145 | 146 | * [FEATURE] Responsive Font Sizes 147 | * [FEATURE] Font Awesome 5.7.2 148 | * [FEATURE] Bootstrap 4.3.0 149 | * [ENHANCEMENT] Update dependencies 150 | 151 | ## 3.3.1 / 2019-02-02 152 | 153 | * [FEATURE] Font Awesome 5.7.1 154 | * [ENHANCEMENT] Update dependencies 155 | 156 | ## 3.3.0 / 2019-01-31 157 | 158 | * [FEATURE] Ruby 2.6.1 159 | * [ENHANCEMENT] Update dependencies 160 | 161 | ## 3.2.0 / 2019-01-29 162 | 163 | * [FEATURE] Font Awesome 5.7.0 164 | * [ENHANCEMENT] Update dependencies 165 | 166 | ## 3.1.2 / 2019-01-03 167 | 168 | * [ENHANCEMENT] Update dependencies 169 | 170 | ## 3.1.1 / 2018-12-26 171 | 172 | * [BUGFIX] Fix Homepage 173 | 174 | ## 3.1.0 / 2018-12-26 175 | 176 | * [FEATURE] Ruby 2.6.0 177 | * [ENHANCEMENT] Update dependencies 178 | 179 | ## 3.0.0 / 2018-12-22 180 | 181 | * [FEATURE] Webpacker 4rc 182 | * [FEATURE] Bootstrap 4.2.1 183 | * [ENHANCEMENT] Update dependencies 184 | 185 | ## 2.7.3 / 2018-12-21 186 | 187 | * [BUGFIX] Fix Changelog 188 | * [BUGFIX] Fix Yarn 189 | 190 | ## 2.7.2 / 2018-12-21 191 | 192 | * [FEATURE] Update Font Awesome to 5.6.3 193 | * [ENHANCEMENT] Update dependencies 194 | 195 | ## 2.7.1 / 2018-12-12 196 | 197 | * [FEATURE] Update Font Awesome to 5.6.1 198 | * [BUGFIX] Fix homepage 199 | * [ENHANCEMENT] Update dependencies 200 | 201 | ## 2.7.0 / 2018-12-11 202 | 203 | * [FEATURE] Update Rails to 5.2.2 204 | * [FEATURE] Update Font Awesome to 5.6.0 205 | * [BUGFIX] Fix changelog 206 | * [ENHANCEMENT] Update dependencies 207 | 208 | ## 2.6.0 / 2018-11-03 209 | 210 | * [FEATURE] Update Font Awesome to 5.5.0 211 | * [ENHANCEMENT] Update dependencies 212 | 213 | ## 2.5.1 / 2018-10-30 214 | 215 | * [ENHANCEMENT] Update dependencies 216 | 217 | ## 2.5.0 / 2018-10-26 218 | 219 | * [FEATURE] Update Font Awesome to 5.4.2 220 | * [ENHANCEMENT] Update dependencies 221 | 222 | ## 2.4.0 / 2018-10-25 223 | 224 | * [FEATURE] Node 11 225 | * [ENHANCEMENT] Update dependencies 226 | 227 | ## 2.3.2 / 2018-10-20 228 | 229 | * [BUGFIX] Fix Travis build 230 | 231 | ## 2.3.1 / 2018-10-20 232 | 233 | * [BUGFIX] Fix Travis build 234 | 235 | ## 2.3.0 / 2018-10-20 236 | 237 | * [FEATURE] Ruby 2.5.3 238 | * [ENHANCEMENT] Update dependencies 239 | 240 | ## 2.2.0 / 2018-10-16 241 | 242 | * [FEATURE] Update Font Awesome to 5.4.1 243 | * [ENHANCEMENT] Update dependencies 244 | 245 | ## 2.1.0 / 2018-10-09 246 | 247 | * [FEATURE] Update Font Awesome to 5.4.0 248 | * [ENHANCEMENT] Update dependencies 249 | 250 | ## 2.0.1 / 2018-09-30 251 | 252 | * [ENHANCEMENT] Improve system tests 253 | * [ENHANCEMENT] Update dependencies 254 | 255 | ## 2.0.0 / 2018-09-26 256 | 257 | * [FEATURE] Use system tests 258 | * [FEATURE] Use headless Chrome instead of PhantomJS 259 | * [ENHANCEMENT] Update dependencies 260 | 261 | ## 1.5.1 / 2018-09-04 262 | 263 | * [BUGFIX] Fix Changelog 264 | * [ENHANCEMENT] Update dependencies 265 | 266 | ## 1.5.0 / 2018-09-03 267 | 268 | * [FEATURE] Update Font Awesome to 5.3.1 269 | * [ENHANCEMENT] Update dependencies 270 | 271 | ## 1.4.0 / 2018-08-08 272 | 273 | * [FEATURE] Update Rails to 5.2.1 274 | * [ENHANCEMENT] Update dependencies 275 | 276 | ## 1.3.1 / 2018-08-06 277 | 278 | * [ENHANCEMENT] Update dependencies 279 | 280 | ## 1.3.1 / 2018-08-02 281 | 282 | * [ENHANCEMENT] Update dependencies 283 | 284 | ## 1.3.0 / 2018-07-24 285 | 286 | * [FEATURE] Update Bootstrap to 4.1.3 287 | * [FEATURE] Update Font Awesome to 5.2.0 288 | * [ENHANCEMENT] Update dependencies 289 | 290 | ## 1.2.0 / 2018-07-22 291 | 292 | * [FEATURE] Raise exceptions when translations are missing (development, test) 293 | * [FEATURE] Allow to use `t` instead of `I18n.t` in specs 294 | * [ENHANCEMENT] Update dependencies 295 | 296 | ## 1.1.0 / 2018-07-18 297 | 298 | * [FEATURE] Update Font Awesome to 5.1.1 299 | * [ENHANCEMENT] Update dependencies 300 | 301 | ## 1.0.0 / 2018-07-13 302 | 303 | * [FEATURE] First public release 304 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | git_source(:github) { |repo| "https://github.com/#{repo}.git" } 5 | 6 | ruby '2.6.10' 7 | gem 'rails', '5.2.8.1' 8 | 9 | # Use postgresql as the database for Active Record 10 | gem 'pg', '~> 1.4.6' 11 | 12 | # Use Puma as the app server 13 | gem 'puma', '~> 6.4' 14 | 15 | # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker 16 | gem 'webpacker', '~> 5.4' 17 | 18 | # Reduces boot times through caching; required in config/boot.rb 19 | gem 'bootsnap', '~> 1.17', require: false 20 | 21 | # Template Engine 22 | gem 'slim-rails', '~> 3.6' 23 | 24 | # App monitoring 25 | gem 'newrelic_rpm', '~> 9.12' 26 | 27 | group :development, :test do 28 | gem 'byebug', '~> 11.1', platforms: %i[mri mingw x64_mingw] 29 | gem 'factory_bot', '6.4.4' # thoughtbot/factory_bot#1614 30 | gem 'factory_bot_rails', '~> 6.4' 31 | gem 'faker', '~> 2.22' 32 | gem 'pry', '~> 0.13.1' 33 | gem 'pry-byebug', '~> 3.9' 34 | gem 'pry-rails', '~> 0.3.9' 35 | gem 'rspec-rails', '~> 5.1' 36 | gem 'rubocop', '~> 1.50', require: false 37 | gem 'rubocop-performance', '~> 1.17', require: false 38 | gem 'rubocop-rails', '~> 2.19', require: false 39 | gem 'rubocop-rspec', '~> 2.20', require: false 40 | gem 'slim_lint', '~> 0.24.0', require: false 41 | end 42 | 43 | group :development do 44 | # gem 'better_errors', '~> 2.4' 45 | # gem 'binding_of_caller', '~> 0.7.3' 46 | # gem 'bullet', '~> 5.6' 47 | gem 'listen', '>= 3.0.5', '< 3.9' 48 | # gem 'meta_request', '~> 0.4.3' 49 | gem 'spring', '~> 2.1' 50 | gem 'spring-commands-rspec', '~> 1.0' 51 | gem 'spring-watcher-listen', '~> 2.0' 52 | gem 'web-console', '~> 3.7' 53 | end 54 | 55 | group :test do 56 | gem 'capybara', '~> 3.36' 57 | gem 'email_spec', '~> 2.2' 58 | gem 'selenium-webdriver', '~> 4.1' 59 | gem 'simplecov', '~> 0.22.0', require: false 60 | gem 'simplecov-lcov', '~> 0.8.0', require: false 61 | gem 'webmock', '~> 3.19', require: false 62 | end 63 | 64 | group :staging, :production do 65 | gem 'rack-timeout', '~> 0.6.3' 66 | end 67 | 68 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 69 | gem 'tzinfo-data', '~> 1.2019', platforms: %i[mingw mswin x64_mingw jruby] 70 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actioncable (5.2.8.1) 5 | actionpack (= 5.2.8.1) 6 | nio4r (~> 2.0) 7 | websocket-driver (>= 0.6.1) 8 | actionmailer (5.2.8.1) 9 | actionpack (= 5.2.8.1) 10 | actionview (= 5.2.8.1) 11 | activejob (= 5.2.8.1) 12 | mail (~> 2.5, >= 2.5.4) 13 | rails-dom-testing (~> 2.0) 14 | actionpack (5.2.8.1) 15 | actionview (= 5.2.8.1) 16 | activesupport (= 5.2.8.1) 17 | rack (~> 2.0, >= 2.0.8) 18 | rack-test (>= 0.6.3) 19 | rails-dom-testing (~> 2.0) 20 | rails-html-sanitizer (~> 1.0, >= 1.0.2) 21 | actionview (5.2.8.1) 22 | activesupport (= 5.2.8.1) 23 | builder (~> 3.1) 24 | erubi (~> 1.4) 25 | rails-dom-testing (~> 2.0) 26 | rails-html-sanitizer (~> 1.0, >= 1.0.3) 27 | activejob (5.2.8.1) 28 | activesupport (= 5.2.8.1) 29 | globalid (>= 0.3.6) 30 | activemodel (5.2.8.1) 31 | activesupport (= 5.2.8.1) 32 | activerecord (5.2.8.1) 33 | activemodel (= 5.2.8.1) 34 | activesupport (= 5.2.8.1) 35 | arel (>= 9.0) 36 | activestorage (5.2.8.1) 37 | actionpack (= 5.2.8.1) 38 | activerecord (= 5.2.8.1) 39 | marcel (~> 1.0.0) 40 | activesupport (5.2.8.1) 41 | concurrent-ruby (~> 1.0, >= 1.0.2) 42 | i18n (>= 0.7, < 2) 43 | minitest (~> 5.1) 44 | tzinfo (~> 1.1) 45 | addressable (2.8.7) 46 | public_suffix (>= 2.0.2, < 7.0) 47 | arel (9.0.0) 48 | ast (2.4.3) 49 | base64 (0.2.0) 50 | bigdecimal (3.1.9) 51 | bindex (0.8.1) 52 | bootsnap (1.18.6) 53 | msgpack (~> 1.2) 54 | builder (3.3.0) 55 | byebug (11.1.3) 56 | capybara (3.36.0) 57 | addressable 58 | matrix 59 | mini_mime (>= 0.1.3) 60 | nokogiri (~> 1.8) 61 | rack (>= 1.6.0) 62 | rack-test (>= 0.6.3) 63 | regexp_parser (>= 1.5, < 3.0) 64 | xpath (~> 3.2) 65 | childprocess (4.1.0) 66 | coderay (1.1.3) 67 | concurrent-ruby (1.3.5) 68 | crack (1.0.0) 69 | bigdecimal 70 | rexml 71 | crass (1.0.6) 72 | date (3.4.1) 73 | diff-lcs (1.6.2) 74 | docile (1.4.1) 75 | email_spec (2.3.0) 76 | htmlentities (~> 4.3.3) 77 | launchy (>= 2.1, < 4.0) 78 | mail (~> 2.7) 79 | erubi (1.13.1) 80 | factory_bot (6.4.4) 81 | activesupport (>= 5.0.0) 82 | factory_bot_rails (6.4.3) 83 | factory_bot (~> 6.4) 84 | railties (>= 5.0.0) 85 | faker (2.22.0) 86 | i18n (>= 1.8.11, < 2) 87 | ffi (1.17.2) 88 | globalid (1.1.0) 89 | activesupport (>= 5.0) 90 | hashdiff (1.1.2) 91 | htmlentities (4.3.4) 92 | i18n (1.14.7) 93 | concurrent-ruby (~> 1.0) 94 | json (2.7.6) 95 | launchy (2.5.2) 96 | addressable (~> 2.8) 97 | listen (3.8.0) 98 | rb-fsevent (~> 0.10, >= 0.10.3) 99 | rb-inotify (~> 0.9, >= 0.9.10) 100 | logger (1.7.0) 101 | loofah (2.24.1) 102 | crass (~> 1.0.2) 103 | nokogiri (>= 1.12.0) 104 | mail (2.8.1) 105 | mini_mime (>= 0.1.1) 106 | net-imap 107 | net-pop 108 | net-smtp 109 | marcel (1.0.4) 110 | matrix (0.4.2) 111 | method_source (1.1.0) 112 | mini_mime (1.1.5) 113 | mini_portile2 (2.8.9) 114 | minitest (5.25.4) 115 | msgpack (1.8.0) 116 | net-imap (0.3.9) 117 | date 118 | net-protocol 119 | net-pop (0.1.2) 120 | net-protocol 121 | net-protocol (0.2.2) 122 | timeout 123 | net-smtp (0.5.1) 124 | net-protocol 125 | newrelic_rpm (9.19.0) 126 | nio4r (2.7.4) 127 | nokogiri (1.13.10) 128 | mini_portile2 (~> 2.8.0) 129 | racc (~> 1.4) 130 | parallel (1.24.0) 131 | parser (3.3.8.0) 132 | ast (~> 2.4.1) 133 | racc 134 | pg (1.4.6) 135 | pry (0.13.1) 136 | coderay (~> 1.1) 137 | method_source (~> 1.0) 138 | pry-byebug (3.9.0) 139 | byebug (~> 11.0) 140 | pry (~> 0.13.0) 141 | pry-rails (0.3.11) 142 | pry (>= 0.13.0) 143 | public_suffix (5.1.1) 144 | puma (6.6.0) 145 | nio4r (~> 2.0) 146 | racc (1.8.1) 147 | rack (2.2.14) 148 | rack-proxy (0.7.7) 149 | rack 150 | rack-test (2.2.0) 151 | rack (>= 1.3) 152 | rack-timeout (0.6.3) 153 | rails (5.2.8.1) 154 | actioncable (= 5.2.8.1) 155 | actionmailer (= 5.2.8.1) 156 | actionpack (= 5.2.8.1) 157 | actionview (= 5.2.8.1) 158 | activejob (= 5.2.8.1) 159 | activemodel (= 5.2.8.1) 160 | activerecord (= 5.2.8.1) 161 | activestorage (= 5.2.8.1) 162 | activesupport (= 5.2.8.1) 163 | bundler (>= 1.3.0) 164 | railties (= 5.2.8.1) 165 | sprockets-rails (>= 2.0.0) 166 | rails-dom-testing (2.2.0) 167 | activesupport (>= 5.0.0) 168 | minitest 169 | nokogiri (>= 1.6) 170 | rails-html-sanitizer (1.5.0) 171 | loofah (~> 2.19, >= 2.19.1) 172 | railties (5.2.8.1) 173 | actionpack (= 5.2.8.1) 174 | activesupport (= 5.2.8.1) 175 | method_source 176 | rake (>= 0.8.7) 177 | thor (>= 0.19.0, < 2.0) 178 | rainbow (3.1.1) 179 | rake (13.2.1) 180 | rb-fsevent (0.11.2) 181 | rb-inotify (0.11.1) 182 | ffi (~> 1.0) 183 | regexp_parser (2.10.0) 184 | rexml (3.4.1) 185 | rspec-core (3.13.3) 186 | rspec-support (~> 3.13.0) 187 | rspec-expectations (3.13.4) 188 | diff-lcs (>= 1.2.0, < 2.0) 189 | rspec-support (~> 3.13.0) 190 | rspec-mocks (3.13.4) 191 | diff-lcs (>= 1.2.0, < 2.0) 192 | rspec-support (~> 3.13.0) 193 | rspec-rails (5.1.2) 194 | actionpack (>= 5.2) 195 | activesupport (>= 5.2) 196 | railties (>= 5.2) 197 | rspec-core (~> 3.10) 198 | rspec-expectations (~> 3.10) 199 | rspec-mocks (~> 3.10) 200 | rspec-support (~> 3.10) 201 | rspec-support (3.13.3) 202 | rubocop (1.50.2) 203 | json (~> 2.3) 204 | parallel (~> 1.10) 205 | parser (>= 3.2.0.0) 206 | rainbow (>= 2.2.2, < 4.0) 207 | regexp_parser (>= 1.8, < 3.0) 208 | rexml (>= 3.2.5, < 4.0) 209 | rubocop-ast (>= 1.28.0, < 2.0) 210 | ruby-progressbar (~> 1.7) 211 | unicode-display_width (>= 2.4.0, < 3.0) 212 | rubocop-ast (1.30.0) 213 | parser (>= 3.2.1.0) 214 | rubocop-capybara (2.18.0) 215 | rubocop (~> 1.41) 216 | rubocop-performance (1.17.1) 217 | rubocop (>= 1.7.0, < 2.0) 218 | rubocop-ast (>= 0.4.0) 219 | rubocop-rails (2.19.1) 220 | activesupport (>= 4.2.0) 221 | rack (>= 1.1) 222 | rubocop (>= 1.33.0, < 2.0) 223 | rubocop-rspec (2.20.0) 224 | rubocop (~> 1.33) 225 | rubocop-capybara (~> 2.17) 226 | ruby-progressbar (1.13.0) 227 | rubyzip (2.4.1) 228 | selenium-webdriver (4.1.0) 229 | childprocess (>= 0.5, < 5.0) 230 | rexml (~> 3.2, >= 3.2.5) 231 | rubyzip (>= 1.2.2) 232 | semantic_range (3.1.0) 233 | simplecov (0.22.0) 234 | docile (~> 1.1) 235 | simplecov-html (~> 0.11) 236 | simplecov_json_formatter (~> 0.1) 237 | simplecov-html (0.13.1) 238 | simplecov-lcov (0.8.0) 239 | simplecov_json_formatter (0.1.4) 240 | slim (5.2.1) 241 | temple (~> 0.10.0) 242 | tilt (>= 2.1.0) 243 | slim-rails (3.7.0) 244 | actionpack (>= 3.1) 245 | railties (>= 3.1) 246 | slim (>= 3.0, < 6.0, != 5.0.0) 247 | slim_lint (0.24.0) 248 | rubocop (>= 1.0, < 2.0) 249 | slim (>= 3.0, < 6.0) 250 | spring (2.1.1) 251 | spring-commands-rspec (1.0.4) 252 | spring (>= 0.9.1) 253 | spring-watcher-listen (2.0.1) 254 | listen (>= 2.7, < 4.0) 255 | spring (>= 1.2, < 3.0) 256 | sprockets (4.2.2) 257 | concurrent-ruby (~> 1.0) 258 | logger 259 | rack (>= 2.2.4, < 4) 260 | sprockets-rails (3.4.2) 261 | actionpack (>= 5.2) 262 | activesupport (>= 5.2) 263 | sprockets (>= 3.0.0) 264 | temple (0.10.3) 265 | thor (1.3.2) 266 | thread_safe (0.3.6) 267 | tilt (2.6.0) 268 | timeout (0.4.3) 269 | tzinfo (1.2.11) 270 | thread_safe (~> 0.1) 271 | unicode-display_width (2.6.0) 272 | web-console (3.7.0) 273 | actionview (>= 5.0) 274 | activemodel (>= 5.0) 275 | bindex (>= 0.4.0) 276 | railties (>= 5.0) 277 | webmock (3.25.1) 278 | addressable (>= 2.8.0) 279 | crack (>= 0.3.2) 280 | hashdiff (>= 0.4.0, < 2.0.0) 281 | webpacker (5.4.4) 282 | activesupport (>= 5.2) 283 | rack-proxy (>= 0.6.1) 284 | railties (>= 5.2) 285 | semantic_range (>= 2.3.0) 286 | websocket-driver (0.7.7) 287 | base64 288 | websocket-extensions (>= 0.1.0) 289 | websocket-extensions (0.1.5) 290 | xpath (3.2.0) 291 | nokogiri (~> 1.8) 292 | 293 | PLATFORMS 294 | ruby 295 | 296 | DEPENDENCIES 297 | bootsnap (~> 1.17) 298 | byebug (~> 11.1) 299 | capybara (~> 3.36) 300 | email_spec (~> 2.2) 301 | factory_bot (= 6.4.4) 302 | factory_bot_rails (~> 6.4) 303 | faker (~> 2.22) 304 | listen (>= 3.0.5, < 3.9) 305 | newrelic_rpm (~> 9.12) 306 | pg (~> 1.4.6) 307 | pry (~> 0.13.1) 308 | pry-byebug (~> 3.9) 309 | pry-rails (~> 0.3.9) 310 | puma (~> 6.4) 311 | rack-timeout (~> 0.6.3) 312 | rails (= 5.2.8.1) 313 | rspec-rails (~> 5.1) 314 | rubocop (~> 1.50) 315 | rubocop-performance (~> 1.17) 316 | rubocop-rails (~> 2.19) 317 | rubocop-rspec (~> 2.20) 318 | selenium-webdriver (~> 4.1) 319 | simplecov (~> 0.22.0) 320 | simplecov-lcov (~> 0.8.0) 321 | slim-rails (~> 3.6) 322 | slim_lint (~> 0.24.0) 323 | spring (~> 2.1) 324 | spring-commands-rspec (~> 1.0) 325 | spring-watcher-listen (~> 2.0) 326 | tzinfo-data (~> 1.2019) 327 | web-console (~> 3.7) 328 | webmock (~> 3.19) 329 | webpacker (~> 5.4) 330 | 331 | RUBY VERSION 332 | ruby 2.6.10p210 333 | 334 | BUNDLED WITH 335 | 2.4.22 336 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2020, 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 5 Starter App 2 | [](https://github.com/diowa/ruby2-rails5-bootstrap-heroku/actions) 3 | [](https://codeclimate.com/github/diowa/ruby2-rails5-bootstrap-heroku) 4 | [](https://coveralls.io/github/diowa/ruby2-rails5-bootstrap-heroku?branch=main) 5 | 6 | [](https://heroku.com/deploy) 7 | 8 | This is an opinionated starter web application based on the following technology stack: 9 | 10 | * [Ruby 2.6.10][1] 11 | * [Rails 5.2.8.1][2] 12 | * [Webpack 4][15] 13 | * [Yarn][16] 14 | * [Puma][3] 15 | * [PostgreSQL][4] 16 | * [RSpec][5] 17 | * [Bootstrap 4.6.2][8] 18 | * [Autoprefixer][9] 19 | * [Font Awesome 6.7.2 SVG][10] 20 | * [Slim][11] 21 | * [RuboCop][12] 22 | * [RuboCop RSpec][17] 23 | * [Slim-Lint][13] 24 | * [stylelint][14] 25 | 26 | [1]: https://www.ruby-lang.org/en/ 27 | [2]: https://rubyonrails.org/ 28 | [3]: https://puma.io/ 29 | [4]: https://www.postgresql.org/ 30 | [5]: https://rspec.info/ 31 | [8]: https://getbootstrap.com/ 32 | [9]: https://github.com/postcss/autoprefixer 33 | [10]: https://fontawesome.com/ 34 | [11]: http://slim-lang.com/ 35 | [12]: https://github.com/bbatsov/rubocop 36 | [13]: https://github.com/sds/slim-lint 37 | [14]: https://stylelint.io/ 38 | [15]: https://webpack.js.org/ 39 | [16]: https://yarnpkg.com/lang/en/ 40 | [17]: https://github.com/backus/rubocop-rspec 41 | 42 | Starter App is deployable on [Heroku](https://www.heroku.com/). Demo: https://ruby2-rails5-bootstrap-heroku.herokuapp.com/ 43 | 44 | ```Gemfile``` also contains a set of useful gems for performance, security, api building... 45 | 46 | ### Thread safety 47 | 48 | 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: 49 | 50 | ```sh 51 | $ heroku config:set RAILS_MAX_THREADS=1 52 | ``` 53 | 54 | ### Master Key 55 | 56 | Rails 5.2 introduced [encrypted credentials](https://edgeguides.rubyonrails.org/5_2_release_notes.html#credentials). 57 | 58 | The master key used by this repository is: 59 | 60 | ``` 61 | b8cc3ac9ab8a3280b03af3d29b2e50ca 62 | ``` 63 | 64 | **DO NOT SHARE YOUR MASTER KEY. CHANGE THIS MASTER KEY IF YOU ARE GOING TO USE THIS REPO FOR YOUR OWN PROJECT.** 65 | 66 | ### Heroku Platform API 67 | 68 | This application supports fast setup and deploy via [app.json](https://devcenter.heroku.com/articles/app-json-schema): 69 | 70 | ```sh 71 | $ curl -n -X POST https://api.heroku.com/app-setups \ 72 | -H "Content-Type:application/json" \ 73 | -H "Accept:application/vnd.heroku+json; version=3" \ 74 | -d '{"source_blob": { "url":"https://github.com/diowa/ruby2-rails5-bootstrap-heroku/tarball/main/"} }' 75 | ``` 76 | 77 | More information: [Setting Up Apps using the Platform API](https://devcenter.heroku.com/articles/setting-up-apps-using-the-heroku-platform-api) 78 | 79 | ### Recommended add-ons 80 | 81 | Heroku's [Production Check](https://blog.heroku.com/introducing_production_check) recommends the use of the following add-ons, here in the free version: 82 | 83 | ```sh 84 | $ heroku addons:create newrelic:wayne # App monitoring 85 | $ heroku config:set NEW_RELIC_APP_NAME="Rails 5 Starter App" # Set newrelic app name 86 | $ heroku addons:create papertrail:choklad # Log monitoring 87 | ``` 88 | 89 | ### Tuning Ruby's RGenGC 90 | 91 | 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. 92 | 93 | 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. 94 | 95 | ```sh 96 | $ heroku config:set RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.3 97 | ``` 98 | 99 | More information: [Change the full GC timing](https://bugs.ruby-lang.org/issues/9607) 100 | -------------------------------------------------------------------------------- /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 | jquery is licensed under the MIT License 30 | 31 | jquery-rails is licensed under the MIT License 32 | 33 | kaminari is licensed under the MIT License 34 | 35 | meta_request is licensed under the MIT License 36 | 37 | newrelic_rpm is licensed under the MIT, Ruby and New Relic licenses 38 | 39 | pg is licensed under the BSD and Ruby licenses 40 | 41 | pry is licensed under the MIT License 42 | 43 | pry-byebug is licensed under the MIT License 44 | 45 | pry-rails is licensed under the MIT License 46 | 47 | puma is licensed under the BSD 3-Clause License 48 | 49 | Rack::Timeout is licensed under the MIT License 50 | 51 | Rails is licensed under the MIT License 52 | 53 | rspec is licensed under the MIT License 54 | 55 | rspec-rails is licensed under the MIT License 56 | 57 | RuboCop is licensed under the MIT License 58 | 59 | RuboCop RSpec is licensed under the MIT License 60 | 61 | sass-rails is licensed under the MIT License 62 | 63 | Secure Headers is licensed under the MIT License 64 | 65 | simplecov is licensed under the MIT License 66 | 67 | Slim-Lint is licensed under the MIT License 68 | 69 | slim-rails is licensed under the MIT License 70 | 71 | Spring is licensed under the MIT License 72 | 73 | spring_commands_rspec is licensed under the MIT License 74 | 75 | uglifier is licensed under the MIT License 76 | 77 | Web Console is licensed under the MIT License 78 | 79 | webmock is licensed under the MIT License 80 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 7.3.0 2 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Rails 5 Starter App", 3 | "description": "An opinionated starter application based on Ruby 2.6, Rails 5.2, Webpack 4, Yarn and Bootstrap 4", 4 | "keywords": [ 5 | "Ruby 2.6", 6 | "Rails 5.2", 7 | "Webpack 4", 8 | "Bootstrap 4", 9 | "Font Awesome 5" 10 | ], 11 | "website": "https://ruby2-rails5-bootstrap-heroku.herokuapp.com/", 12 | "repository": "https://github.com/diowa/ruby2-rails5-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": "b8cc3ac9ab8a3280b03af3d29b2e50ca" 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 5 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 | ], 42 | "buildpacks": [ 43 | { 44 | "url": "https://github.com/heroku/heroku-buildpack-activestorage-preview" 45 | }, 46 | { 47 | "url": "heroku/nodejs" 48 | }, 49 | { 50 | "url": "heroku/ruby" 51 | } 52 | ] 53 | } 54 | -------------------------------------------------------------------------------- /app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../stylesheets .css 4 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby2-rails5-bootstrap-heroku/2a8b28b30b19ad7f4b404f0c14cd06e1bc38d75e/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/javascripts/channels/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby2-rails5-bootstrap-heroku/2a8b28b30b19ad7f4b404f0c14cd06e1bc38d75e/app/assets/javascripts/channels/.keep -------------------------------------------------------------------------------- /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/ruby2-rails5-bootstrap-heroku/2a8b28b30b19ad7f4b404f0c14cd06e1bc38d75e/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/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby2-rails5-bootstrap-heroku/2a8b28b30b19ad7f4b404f0c14cd06e1bc38d75e/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 'src/bootstrap.js' 7 | import 'src/fontawesome.js' 8 | 9 | RailsUjs.start() 10 | Turbolinks.start() 11 | -------------------------------------------------------------------------------- /app/javascript/packs/application.scss: -------------------------------------------------------------------------------- 1 | @import "stylesheets/bootstrap"; 2 | @import "stylesheets/turbolinks-progress-bar"; 3 | -------------------------------------------------------------------------------- /app/javascript/src/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby2-rails5-bootstrap-heroku/2a8b28b30b19ad7f4b404f0c14cd06e1bc38d75e/app/javascript/src/.keep -------------------------------------------------------------------------------- /app/javascript/src/bootstrap.js: -------------------------------------------------------------------------------- 1 | /* Copied from the source code of Bootstrap: */ 2 | /* https://github.com/twbs/bootstrap/blob/v4.6.1/js/index.js */ 3 | 4 | import 'bootstrap/js/dist/alert' 5 | import 'bootstrap/js/dist/button' 6 | import 'bootstrap/js/dist/carousel' 7 | import 'bootstrap/js/dist/collapse' 8 | import 'bootstrap/js/dist/dropdown' 9 | import 'bootstrap/js/dist/modal' 10 | import 'bootstrap/js/dist/popover' 11 | import 'bootstrap/js/dist/scrollspy' 12 | import 'bootstrap/js/dist/tab' 13 | import 'bootstrap/js/dist/toast' 14 | import 'bootstrap/js/dist/tooltip' 15 | import 'bootstrap/js/dist/util' 16 | -------------------------------------------------------------------------------- /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 Turbolinks 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.scss: -------------------------------------------------------------------------------- 1 | // New variables 2 | 3 | $rails-red: #e00000 !default; 4 | 5 | // Overrides 6 | 7 | $primary: $rails-red !default; 8 | 9 | @import "~bootstrap/scss/variables"; 10 | -------------------------------------------------------------------------------- /app/javascript/stylesheets/bootstrap.scss: -------------------------------------------------------------------------------- 1 | @import "~bootstrap/scss/functions"; 2 | @import "bootstrap-variables"; 3 | @import "~bootstrap/scss/mixins"; 4 | @import "~bootstrap/scss/root"; 5 | @import "~bootstrap/scss/print"; 6 | @import "~bootstrap/scss/reboot"; 7 | @import "~bootstrap/scss/type"; 8 | @import "~bootstrap/scss/images"; 9 | @import "~bootstrap/scss/code"; 10 | @import "~bootstrap/scss/grid"; 11 | @import "~bootstrap/scss/tables"; 12 | @import "~bootstrap/scss/forms"; 13 | @import "~bootstrap/scss/buttons"; 14 | @import "~bootstrap/scss/transitions"; 15 | @import "~bootstrap/scss/dropdown"; 16 | @import "~bootstrap/scss/button-group"; 17 | @import "~bootstrap/scss/input-group"; 18 | @import "~bootstrap/scss/custom-forms"; 19 | @import "~bootstrap/scss/nav"; 20 | @import "~bootstrap/scss/navbar"; 21 | @import "~bootstrap/scss/card"; 22 | @import "~bootstrap/scss/breadcrumb"; 23 | @import "~bootstrap/scss/pagination"; 24 | @import "~bootstrap/scss/badge"; 25 | @import "~bootstrap/scss/jumbotron"; 26 | @import "~bootstrap/scss/alert"; 27 | @import "~bootstrap/scss/progress"; 28 | @import "~bootstrap/scss/media"; 29 | @import "~bootstrap/scss/list-group"; 30 | @import "~bootstrap/scss/close"; 31 | @import "~bootstrap/scss/modal"; 32 | @import "~bootstrap/scss/tooltip"; 33 | @import "~bootstrap/scss/popover"; 34 | @import "~bootstrap/scss/carousel"; 35 | @import "~bootstrap/scss/utilities"; 36 | -------------------------------------------------------------------------------- /app/javascript/stylesheets/turbolinks-progress-bar.scss: -------------------------------------------------------------------------------- 1 | .turbolinks-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 | end 5 | -------------------------------------------------------------------------------- /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/ruby2-rails5-bootstrap-heroku/2a8b28b30b19ad7f4b404f0c14cd06e1bc38d75e/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-turbolinks-track': 'reload' 16 | 17 | / Web App manifest 18 | link href='/manifest.json' rel='manifest' 19 | meta content=t('app_name') name='Rails 5 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 'cause of turbolinks 25 | = javascript_pack_tag 'application', 'data-turbolinks-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< 7.2.0 7 | ul.list-inline.lead 8 | li.list-inline-item 9 | | Ruby 10 | small.text-muted< 2.6.10 11 | li.list-inline-item 12 | | Rails 13 | small.text-muted< 5.2.8.1 14 | li.list-inline-item 15 | | Bootstrap 16 | small.text-muted< 4.6.2 17 | li.list-inline-item 18 | | Font Awesome (SVG) 19 | small.text-muted< 6.4.0 20 | -------------------------------------------------------------------------------- /app/views/shared/_footer.html.slim: -------------------------------------------------------------------------------- 1 | footer.main-footer 2 | .container 3 | hr 4 | p 5 | = link_to 'https://github.com/diowa/ruby2-rails5-bootstrap-heroku' do 6 | span.fab.fa-github> aria-hidden='true' 7 | span.sr-only GitHub 8 | | diowa/ruby2-rails5-bootstrap-heroku 9 | -------------------------------------------------------------------------------- /app/views/shared/_navbar.html.slim: -------------------------------------------------------------------------------- 1 | nav.main-navbar.navbar.main-navbar.navbar-light.bg-light.navbar-expand-lg 2 | .container 3 | = link_to t('app_name'), root_path, class: 'navbar-brand' 4 | button.navbar-toggler.navbar-toggler-right type='button' data-toggle='collapse' data-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 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | var validEnv = ['development', 'test', 'production'] 3 | var currentEnv = api.env() 4 | var isDevelopmentEnv = api.env('development') 5 | var isProductionEnv = api.env('production') 6 | var isTestEnv = api.env('test') 7 | 8 | if (!validEnv.includes(currentEnv)) { 9 | throw new Error( 10 | 'Please specify a valid `NODE_ENV` or ' + 11 | '`BABEL_ENV` environment variables. Valid values are "development", ' + 12 | '"test", and "production". Instead, received: ' + 13 | JSON.stringify(currentEnv) + 14 | '.' 15 | ) 16 | } 17 | 18 | return { 19 | presets: [ 20 | isTestEnv && [ 21 | '@babel/preset-env', 22 | { 23 | targets: { 24 | node: 'current' 25 | } 26 | } 27 | ], 28 | (isProductionEnv || isDevelopmentEnv) && [ 29 | '@babel/preset-env', 30 | { 31 | forceAllTransforms: true, 32 | useBuiltIns: 'entry', 33 | corejs: 3, 34 | modules: false, 35 | exclude: ['transform-typeof-symbol'] 36 | } 37 | ] 38 | ].filter(Boolean), 39 | plugins: [ 40 | 'babel-plugin-macros', 41 | '@babel/plugin-syntax-dynamic-import', 42 | isTestEnv && 'babel-plugin-dynamic-import-node', 43 | '@babel/plugin-transform-destructuring', 44 | [ 45 | '@babel/plugin-proposal-class-properties', 46 | { 47 | loose: true 48 | } 49 | ], 50 | [ 51 | '@babel/plugin-proposal-object-rest-spread', 52 | { 53 | useBuiltIns: true 54 | } 55 | ], 56 | [ 57 | '@babel/plugin-proposal-private-methods', 58 | { 59 | loose: true 60 | } 61 | ], 62 | [ 63 | '@babel/plugin-proposal-private-property-in-object', 64 | { 65 | loose: true 66 | } 67 | ], 68 | [ 69 | '@babel/plugin-transform-runtime', 70 | { 71 | helpers: false, 72 | regenerator: true, 73 | corejs: false 74 | } 75 | ], 76 | [ 77 | '@babel/plugin-transform-regenerator', 78 | { 79 | async: false 80 | } 81 | ] 82 | ].filter(Boolean) 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | APP_PATH = File.expand_path('../config/application', __dir__) 8 | require_relative '../config/boot' 9 | require 'rails/commands' 10 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path('../spring', __FILE__) 4 | rescue LoadError => e 5 | raise unless e.message.include?('spring') 6 | end 7 | require_relative '../config/boot' 8 | require 'rake' 9 | Rake.application.run 10 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'fileutils' 3 | include FileUtils 4 | 5 | # path to your application root. 6 | APP_ROOT = File.expand_path('..', __dir__) 7 | 8 | def system!(*args) 9 | system(*args) || abort("\n== Command #{args} failed ==") 10 | end 11 | 12 | chdir APP_ROOT do 13 | # This script is a starting point to setup your application. 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 if using Yarn 21 | # system('bin/yarn') 22 | 23 | # puts "\n== Copying sample files ==" 24 | # unless File.exist?('config/database.yml') 25 | # cp 'config/database.yml.sample', 'config/database.yml' 26 | # end 27 | 28 | puts "\n== Preparing database ==" 29 | system! 'bin/rails db:setup' 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/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require 'rubygems' 8 | require 'bundler' 9 | 10 | lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) 11 | spring = lockfile.specs.detect { |spec| spec.name == "spring" } 12 | if spring 13 | Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path 14 | gem 'spring', spring.version 15 | require 'spring/binstub' 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /bin/update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'fileutils' 3 | include FileUtils 4 | 5 | # path to your application root. 6 | APP_ROOT = File.expand_path('..', __dir__) 7 | 8 | def system!(*args) 9 | system(*args) || abort("\n== Command #{args} failed ==") 10 | end 11 | 12 | chdir APP_ROOT do 13 | # This script is a way to update your development environment automatically. 14 | # Add necessary update 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 if using Yarn 21 | # system('bin/yarn') 22 | 23 | puts "\n== Updating database ==" 24 | system! 'bin/rails db:migrate' 25 | 26 | puts "\n== Removing old logs and tempfiles ==" 27 | system! 'bin/rails log:clear tmp:clear' 28 | 29 | puts "\n== Restarting application server ==" 30 | system! 'bin/rails restart' 31 | end 32 | -------------------------------------------------------------------------------- /bin/webpack: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" 4 | ENV["NODE_ENV"] ||= "development" 5 | 6 | require "pathname" 7 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", 8 | Pathname.new(__FILE__).realpath) 9 | 10 | require "bundler/setup" 11 | 12 | require "webpacker" 13 | require "webpacker/webpack_runner" 14 | 15 | APP_ROOT = File.expand_path("..", __dir__) 16 | Dir.chdir(APP_ROOT) do 17 | Webpacker::WebpackRunner.run(ARGV) 18 | end 19 | -------------------------------------------------------------------------------- /bin/webpack-dev-server: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" 4 | ENV["NODE_ENV"] ||= "development" 5 | 6 | require "pathname" 7 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", 8 | Pathname.new(__FILE__).realpath) 9 | 10 | require "bundler/setup" 11 | 12 | require "webpacker" 13 | require "webpacker/dev_server_runner" 14 | 15 | APP_ROOT = File.expand_path("..", __dir__) 16 | Dir.chdir(APP_ROOT) do 17 | Webpacker::DevServerRunner.run(ARGV) 18 | end 19 | -------------------------------------------------------------------------------- /bin/yarn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_ROOT = File.expand_path('..', __dir__) 3 | Dir.chdir(APP_ROOT) do 4 | begin 5 | exec "yarnpkg", *ARGV 6 | rescue Errno::ENOENT 7 | $stderr.puts "Yarn executable was not detected in the system." 8 | $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 9 | exit 1 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_view/railtie' 14 | require 'action_cable/engine' 15 | # require "sprockets/railtie" 16 | # require "rails/test_unit/railtie" 17 | 18 | # Require the gems listed in Gemfile, including any gems 19 | # you've limited to :test, :development, or :production. 20 | Bundler.require(*Rails.groups) 21 | 22 | module Ruby2Rails5BootstrapHeroku 23 | class Application < Rails::Application 24 | # Initialize configuration defaults for originally generated Rails version. 25 | config.load_defaults 5.2 26 | 27 | # Settings in config/environments/* take precedence over those specified here. 28 | # Application configuration can go into files in config/initializers 29 | # -- all .rb files in that directory are automatically loaded after loading 30 | # the framework and any gems in your application. 31 | 32 | # Don't generate system test files. 33 | config.generators.system_tests = nil 34 | 35 | config.generators do |g| 36 | g.test_framework false 37 | g.stylesheets false 38 | g.javascripts false 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /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: async 3 | 4 | test: 5 | adapter: async 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: ruby2-rails5-bootstrap-heroku_production 11 | -------------------------------------------------------------------------------- /config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | eaOwA0LNZfiySMfIB5up8YkGIlBuLkaNonKC5/fyDonfddeAfe+xXGpYDj/Wqr0QhhnaB715eweZ5Hu+mT7t/ARnn0gUr9ghAyDwVLCQVda+EeZ3OytaKr+vlDS+C+Sn/gxJkYipbBR4wfRveWH381MSUgsmOrQab9CNJdfmdURhissbFJ1y5ho/8X0BIaCfTcl7F5FhUNSdclljdO/bY9ocPZ9dTQSDxi+qcka6ba6iLf4eyoXNSkLQjMj/VqjvPTg09MrqMt7bjZsKsa5Aq76MvDkAvLezMQZZRpvBXA5C2er93KfW+mxgKOb13bTBlE9YkJizXylz6hQia2r2+aNwlC42GwSHXJtRl2l+fY+acQn2UCXkb/VQ2NHmLkMMCnjdgpPJ+ffhrlqZNMx4Yt8zhSrB2w5H--h77Na7s+voWVBl3Z--FRYUGopcVFM6QRdxdWBVSA== -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # PostgreSQL. Versions 9.1 and up are supported. 2 | # 3 | # Install the pg driver: 4 | # gem install pg 5 | # On OS X with Homebrew: 6 | # gem install pg -- --with-pg-config=/usr/local/bin/pg_config 7 | # On OS X 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 | # http://guides.rubyonrails.org/configuring.html#database-pooling 22 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> 23 | 24 | development: 25 | <<: *default 26 | database: ruby2-rails5-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: ruby2-rails5-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: ruby2-rails5-bootstrap-heroku_test 62 | 63 | # As with config/secrets.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 http://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: ruby2-rails5-bootstrap-heroku_production 85 | username: ruby2-rails5-bootstrap-heroku 86 | password: <%= ENV['RUBY2-RAILS5-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 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # Verifies that versions and hashed value of the package contents in the project's package.json 7 | config.webpacker.check_yarn_integrity = true 8 | 9 | # In the development environment your application's code is reloaded on 10 | # every request. This slows down response time but is perfect for development 11 | # since you don't have to restart the web server when you make code changes. 12 | config.cache_classes = false 13 | 14 | # Do not eager load code on boot. 15 | config.eager_load = false 16 | 17 | # Show full error reports. 18 | config.consider_all_requests_local = true 19 | 20 | # Enable/disable caching. By default caching is disabled. 21 | # Run rails dev:cache to toggle caching. 22 | if Rails.root.join('tmp/caching-dev.txt').exist? 23 | config.action_controller.perform_caching = 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 an error on page load if there are pending migrations. 47 | config.active_record.migration_error = :page_load 48 | 49 | # Highlight code that triggered database queries in logs. 50 | config.active_record.verbose_query_logs = true 51 | 52 | # Raises error for missing translations 53 | config.action_view.raise_on_missing_translations = true 54 | 55 | # Use an evented file watcher to asynchronously detect changes in source code, 56 | # routes, locales, etc. This feature depends on the listen gem. 57 | config.file_watcher = ActiveSupport::EventedFileUpdateChecker 58 | end 59 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # Verifies that versions and hashed value of the package contents in the project's package.json 7 | config.webpacker.check_yarn_integrity = false 8 | 9 | # Code is not reloaded between requests. 10 | config.cache_classes = true 11 | 12 | # Eager load code on boot. This eager loads most of Rails and 13 | # your application in memory, allowing both threaded web servers 14 | # and those relying on copy on write to perform better. 15 | # Rake tasks automatically ignore this option for performance. 16 | config.eager_load = true 17 | 18 | # Full error reports are disabled and caching is turned on. 19 | config.consider_all_requests_local = false 20 | config.action_controller.perform_caching = true 21 | 22 | # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] 23 | # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). 24 | # config.require_master_key = true 25 | 26 | # Disable serving static files from the `/public` folder by default since 27 | # Apache or NGINX already handles this. 28 | config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? 29 | 30 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 31 | # config.action_controller.asset_host = 'http://assets.example.com' 32 | 33 | # Specifies the header that your server uses for sending files. 34 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 35 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 36 | 37 | # Store uploaded files on the local file system (see config/storage.yml for options) 38 | config.active_storage.service = :local 39 | 40 | # Mount Action Cable outside main process or domain 41 | # config.action_cable.mount_path = nil 42 | # config.action_cable.url = 'wss://example.com/cable' 43 | # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] 44 | 45 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 46 | config.force_ssl = true 47 | 48 | # Use the lowest log level to ensure availability of diagnostic information 49 | # when problems arise. 50 | config.log_level = :debug 51 | 52 | # Prepend all log lines with the following tags. 53 | config.log_tags = [:request_id] 54 | 55 | # Use a different cache store in production. 56 | # config.cache_store = :mem_cache_store 57 | 58 | # Use a real queuing backend for Active Job (and separate queues per environment) 59 | # config.active_job.queue_adapter = :resque 60 | # config.active_job.queue_name_prefix = "ruby2-rails5-bootstrap-heroku_#{Rails.env}" 61 | 62 | config.action_mailer.perform_caching = false 63 | 64 | # Ignore bad email addresses and do not raise email delivery errors. 65 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 66 | # config.action_mailer.raise_delivery_errors = false 67 | 68 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 69 | # the I18n.default_locale when a translation cannot be found). 70 | config.i18n.fallbacks = true 71 | 72 | # Send deprecation notices to registered listeners. 73 | config.active_support.deprecation = :notify 74 | 75 | # Use default logging formatter so that PID and timestamp are not suppressed. 76 | config.log_formatter = Logger::Formatter.new 77 | 78 | # Use a different logger for distributed setups. 79 | # require 'syslog/logger' 80 | # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') 81 | 82 | if ENV['RAILS_LOG_TO_STDOUT'].present? 83 | logger = ActiveSupport::Logger.new($stdout) 84 | logger.formatter = config.log_formatter 85 | config.logger = ActiveSupport::TaggedLogging.new(logger) 86 | end 87 | 88 | # Do not dump schema after migrations. 89 | config.active_record.dump_schema_after_migration = false 90 | end 91 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Rails.application.configure do 4 | # Settings specified here will take precedence over those in config/application.rb. 5 | 6 | # The test environment is used exclusively to run your application's 7 | # test suite. You never need to work with it otherwise. Remember that 8 | # your test database is "scratch space" for the test suite and is wiped 9 | # and recreated between test runs. Don't rely on the data there! 10 | config.cache_classes = true 11 | 12 | # Do not eager load code on boot. This avoids loading your whole application 13 | # just for the purpose of running a single test. If you are using a tool that 14 | # preloads Rails for running tests, you may have to set it to true. 15 | config.eager_load = false 16 | 17 | # Configure public file server for tests with Cache-Control for performance. 18 | config.public_file_server.enabled = true 19 | config.public_file_server.headers = { 20 | 'Cache-Control' => "public, max-age=#{1.hour.to_i}" 21 | } 22 | 23 | # Show full error reports and disable caching. 24 | config.consider_all_requests_local = true 25 | config.action_controller.perform_caching = false 26 | 27 | # Raise exceptions instead of rendering exception templates. 28 | config.action_dispatch.show_exceptions = false 29 | 30 | # Disable request forgery protection in test environment. 31 | config.action_controller.allow_forgery_protection = false 32 | 33 | # Store uploaded files on the local file system in a temporary directory 34 | config.active_storage.service = :test 35 | 36 | config.action_mailer.perform_caching = false 37 | 38 | # Tell Action Mailer not to deliver emails to the real world. 39 | # The :test delivery method accumulates sent emails in the 40 | # ActionMailer::Base.deliveries array. 41 | config.action_mailer.delivery_method = :test 42 | 43 | # Print deprecation notices to the stderr. 44 | config.active_support.deprecation = :stderr 45 | 46 | # Raises error for missing translations 47 | config.action_view.raise_on_missing_translations = true 48 | end 49 | -------------------------------------------------------------------------------- /config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # Be sure to restart your server when you modify this file. 3 | 4 | # ActiveSupport::Reloader.to_prepare do 5 | # ApplicationController.renderer.defaults.merge!( 6 | # http_host: 'example.org', 7 | # https: false 8 | # ) 9 | # end 10 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # Be sure to restart your server when you modify this file. 3 | 4 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 5 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 6 | 7 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 8 | # Rails.backtrace_cleaner.remove_silencers! 9 | -------------------------------------------------------------------------------- /config/initializers/content_security_policy.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # Be sure to restart your server when you modify this file. 3 | 4 | # Define an application-wide content security policy 5 | # For further information see the following documentation 6 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy 7 | 8 | # Rails.application.config.content_security_policy do |policy| 9 | # policy.default_src :self, :https 10 | # policy.font_src :self, :https, :data 11 | # policy.img_src :self, :https, :data 12 | # policy.object_src :none 13 | # policy.script_src :self, :https 14 | # policy.style_src :self, :https 15 | 16 | # # Specify URI for violation reports 17 | # # policy.report_uri "/csp-violation-report-endpoint" 18 | # end 19 | 20 | # If you are using UJS then enable automatic nonce generation 21 | # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } 22 | 23 | # Report CSP violations to a specified URI 24 | # For further information see the following documentation: 25 | # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only 26 | # Rails.application.config.content_security_policy_report_only = true 27 | -------------------------------------------------------------------------------- /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/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 += [:password] 7 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # Be sure to restart your server when you modify this file. 3 | 4 | # Add new inflection rules using the following format. Inflections 5 | # are locale specific, and you may define rules for as many different 6 | # locales as you wish. All of these examples are active by default: 7 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 8 | # inflect.plural /^(ox)$/i, '\1en' 9 | # inflect.singular /^(ox)en/i, '\1' 10 | # inflect.irregular 'person', 'people' 11 | # inflect.uncountable %w( fish sheep ) 12 | # end 13 | 14 | # These inflection rules are supported but not enabled by default: 15 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 16 | # inflect.acronym 'RESTful' 17 | # end 18 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | # Be sure to restart your server when you modify this file. 3 | 4 | # Add new mime types for use in respond_to blocks: 5 | # Mime::Type.register "text/richtext", :rtf 6 | -------------------------------------------------------------------------------- /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 http://guides.rubyonrails.org/i18n.html. 31 | 32 | en: 33 | app_name: "Rails 5 Starter App" 34 | meta_description: "An opinionated starter application based on Ruby 2.6, Rails 5.2, Webpack 4, Yarn, and Bootstrap 4" 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 January 28, 2019, for version 6.0.0.351 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 23 | log_level: info 24 | 25 | 26 | # Environment-specific settings are in this section. 27 | # RAILS_ENV or RACK_ENV (as appropriate) is used to determine the environment. 28 | # If your application has other named environments, configure them here. 29 | development: 30 | <<: *default_settings 31 | app_name: <%= ENV["NEW_RELIC_APP_NAME"] %> (Development) 32 | 33 | test: 34 | <<: *default_settings 35 | # It doesn't make sense to report to New Relic from automated test runs. 36 | monitor_mode: false 37 | 38 | staging: 39 | <<: *default_settings 40 | app_name: <%= ENV["NEW_RELIC_APP_NAME"] %> (Staging) 41 | 42 | production: 43 | <<: *default_settings 44 | -------------------------------------------------------------------------------- /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 `port` that Puma will listen on to receive requests; default is 3000. 14 | # 15 | port ENV.fetch('PORT', 3000) 16 | 17 | # Specifies the `environment` that Puma will run in. 18 | # 19 | environment ENV.fetch('RAILS_ENV', 'development') 20 | 21 | # Specifies the `pidfile` that Puma will use. 22 | pidfile ENV.fetch('PIDFILE', 'tmp/pids/server.pid') 23 | 24 | # Specifies the number of `workers` to boot in clustered mode. 25 | # Workers are forked web server processes. If using threads and workers together 26 | # the concurrency of the application would be max `threads` * `workers`. 27 | # Workers do not work on JRuby or Windows (both of which do not support 28 | # processes). 29 | # 30 | # workers ENV.fetch("WEB_CONCURRENCY") { 2 } 31 | 32 | # Use the `preload_app!` method when specifying a `workers` number. 33 | # This directive tells Puma to first boot the application and load code 34 | # before forking the application. This takes advantage of Copy On Write 35 | # process behavior so workers use less memory. 36 | # 37 | # preload_app! 38 | 39 | # Allow puma to be restarted by `rails restart` command. 40 | plugin :tmp_restart 41 | -------------------------------------------------------------------------------- /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 http://guides.rubyonrails.org/routing.html 5 | 6 | root 'pages#home' 7 | get :hello_world, to: 'pages#hello_world' 8 | end 9 | -------------------------------------------------------------------------------- /config/spring.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Spring.watch( 4 | '.rbenv-vars', 5 | 'tmp/restart.txt', 6 | 'tmp/caching-dev.txt' 7 | ) 8 | -------------------------------------------------------------------------------- /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 | process.env.NODE_ENV = process.env.NODE_ENV || 'development' 2 | 3 | const environment = require('./environment') 4 | const StyleLintPlugin = require('stylelint-webpack-plugin') 5 | 6 | environment.plugins.append( 7 | 'StyleLintPlugin', 8 | new StyleLintPlugin({ 9 | emitWarning: true, 10 | files: '/app/**/*.(s(c|a)ss|css)' 11 | }) 12 | ) 13 | 14 | environment.loaders.insert('standard-loader', { 15 | loader: 'standard-loader', 16 | test: /\.js$/ 17 | }, { after: 'babel' }) 18 | 19 | module.exports = environment.toWebpackConfig() 20 | -------------------------------------------------------------------------------- /config/webpack/environment.js: -------------------------------------------------------------------------------- 1 | const { environment } = require('@rails/webpacker') 2 | 3 | const webpack = require('webpack') 4 | 5 | // resolve-url-loader must be used before sass-loader 6 | environment.loaders.get('sass').use.splice(-1, 0, { 7 | loader: 'resolve-url-loader' 8 | }); 9 | 10 | // Add an additional plugin of your choosing : ProvidePlugin 11 | environment.plugins.prepend( 12 | 'Provide', 13 | new webpack.ProvidePlugin({ 14 | // jQuery 15 | $: 'jquery', 16 | jQuery: 'jquery', 17 | jquery: 'jquery', 18 | 19 | // Window 20 | 'window.jQuery': 'jquery', 21 | 22 | // Bootstrap dependencies 23 | Popper: ['popper.js', 'default'], 24 | 25 | // Rails dependencies 26 | ActionCable: 'actioncable', 27 | Turbolinks: 'turbolinks', 28 | RailsUjs: 'rails-ujs', 29 | 30 | // Individual Bootstrap plugins 31 | Util:"exports-loader?Util!bootstrap/js/dist/util", 32 | Tooltip:"exports-loader?Tooltip!bootstrap/js/dist/tooltip", 33 | Popover:"exports-loader?Popover!bootstrap/js/dist/popover", 34 | Alert:"exports-loader?Alert!bootstrap/js/dist/alert", 35 | Carousel:"exports-loader?Carousel!bootstrap/js/dist/carousel", 36 | Dropdown:"exports-loader?Dropdown!bootstrap/js/dist/dropdown", 37 | Modal:"exports-loader?Modal!bootstrap/js/dist/modal", 38 | Tab:"exports-loader?Tab!bootstrap/js/dist/tab", 39 | Scrollspy:"exports-loader?Scrollspy!bootstrap/js/dist/scrollspy", 40 | Collapse:"exports-loader?Collapse!bootstrap/js/dist/collapse", 41 | Button:"exports-loader?Button!bootstrap/js/dist/button" 42 | }) 43 | ) 44 | 45 | // export the updated config 46 | module.exports = environment 47 | -------------------------------------------------------------------------------- /config/webpack/production.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'production' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /config/webpack/test.js: -------------------------------------------------------------------------------- 1 | process.env.NODE_ENV = process.env.NODE_ENV || 'development' 2 | 3 | const environment = require('./environment') 4 | 5 | module.exports = environment.toWebpackConfig() 6 | -------------------------------------------------------------------------------- /config/webpacker.yml: -------------------------------------------------------------------------------- 1 | # Note: You must restart bin/webpack-dev-server for changes to take effect 2 | 3 | default: &default 4 | source_path: app/javascript 5 | source_entry_path: packs 6 | public_root_path: public 7 | public_output_path: packs 8 | cache_path: tmp/cache/webpacker 9 | webpack_compile_output: true 10 | 11 | # Additional paths webpack should lookup modules 12 | # ['app/assets', 'engine/foo/app/assets'] 13 | resolved_paths: [] 14 | 15 | # Reload manifest.json on all requests so we reload latest compiled packs 16 | cache_manifest: false 17 | 18 | # Extract and emit a css file 19 | extract_css: true 20 | 21 | static_assets_extensions: 22 | - .jpg 23 | - .jpeg 24 | - .png 25 | - .gif 26 | - .tiff 27 | - .ico 28 | - .svg 29 | - .eot 30 | - .otf 31 | - .ttf 32 | - .woff 33 | - .woff2 34 | 35 | extensions: 36 | - .mjs 37 | - .js 38 | - .sass 39 | - .scss 40 | - .css 41 | - .module.sass 42 | - .module.scss 43 | - .module.css 44 | - .png 45 | - .svg 46 | - .gif 47 | - .jpeg 48 | - .jpg 49 | 50 | development: 51 | <<: *default 52 | compile: true 53 | 54 | # Reference: https://webpack.js.org/configuration/dev-server/ 55 | dev_server: 56 | https: false 57 | host: localhost 58 | port: 3035 59 | public: localhost:3035 60 | hmr: false 61 | # Inline should be set to true if using HMR 62 | inline: true 63 | overlay: true 64 | compress: true 65 | disable_host_check: true 66 | use_local_ip: false 67 | quiet: false 68 | pretty: false 69 | headers: 70 | 'Access-Control-Allow-Origin': '*' 71 | watch_options: 72 | ignored: '**/node_modules/**' 73 | 74 | 75 | test: 76 | <<: *default 77 | compile: true 78 | 79 | # Compile test packs to a separate directory 80 | public_output_path: packs-test 81 | 82 | production: 83 | <<: *default 84 | 85 | # Production depends on precompilation of packs prior to booting for performance. 86 | compile: false 87 | 88 | # Extract and emit a css file 89 | extract_css: true 90 | 91 | # Cache manifest.json for performance 92 | cache_manifest: true 93 | -------------------------------------------------------------------------------- /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 | # Note that this schema.rb definition is the authoritative source for your 6 | # database schema. If you need to create the application database on another 7 | # system, you should be using db:schema:load, not running all the migrations 8 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 9 | # you'll amass, the slower it'll run and the greater likelihood for issues). 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/ruby2-rails5-bootstrap-heroku/2a8b28b30b19ad7f4b404f0c14cd06e1bc38d75e/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby2-rails5-bootstrap-heroku/2a8b28b30b19ad7f4b404f0c14cd06e1bc38d75e/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({ 'NODE_ENV' => node_env }, Rails.root.join("bin/yarn #{args[:command]}").to_s) 13 | abort if $CHILD_STATUS.exitstatus.nonzero? 14 | rescue Errno::ENOENT 15 | warn 'bin/yarn was not found.' 16 | exit 1 17 | end 18 | 19 | desc 'Run `bin/yarn stylelint app/**/*.scss`' 20 | task :stylelint do 21 | Rake::Task['yarn:run'].execute(command: 'stylelint app/**/*.scss') 22 | end 23 | 24 | desc 'Run `bin/yarn standard`' 25 | task :standard do 26 | Rake::Task['yarn:run'].execute(command: 'standard') 27 | end 28 | # rubocop:enable Rails/RakeEnvironment 29 | end 30 | 31 | task(:lint).sources.push 'yarn:stylelint' 32 | task(:lint).sources.push 'yarn:standard' 33 | -------------------------------------------------------------------------------- /log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diowa/ruby2-rails5-bootstrap-heroku/2a8b28b30b19ad7f4b404f0c14cd06e1bc38d75e/log/.keep -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ruby2_rails5_bootstrap_heroku", 3 | "private": true, 4 | "version": "7.0.0", 5 | "engines": { 6 | "node": ">= 14, < 17", 7 | "yarn": "^1.15.2" 8 | }, 9 | "dependencies": { 10 | "@babel/core": "^7.27.4", 11 | "@babel/plugin-proposal-private-methods": "^7.18.6", 12 | "@babel/plugin-proposal-private-property-in-object": "^7.21.11", 13 | "@fortawesome/fontawesome-svg-core": "^6.7.2", 14 | "@fortawesome/free-brands-svg-icons": "^6.7.2", 15 | "@fortawesome/free-regular-svg-icons": "^6.7.2", 16 | "@fortawesome/free-solid-svg-icons": "^6.7.2", 17 | "@rails/webpacker": "^5.4.4", 18 | "actioncable": "^5.2.8", 19 | "bootstrap": "^4.6.2", 20 | "exports-loader": "^1.1.1", 21 | "jquery": "^3.7.1", 22 | "popper.js": "^1.16.1", 23 | "postcss": "^8.5.4", 24 | "rails-ujs": "^5.2.8", 25 | "resolve-url-loader": "^5.0.0", 26 | "turbolinks": "^5.2.0" 27 | }, 28 | "devDependencies": { 29 | "standard": "^16.0.4", 30 | "standard-loader": "^7.0.0", 31 | "stylelint": "^15.11.0", 32 | "stylelint-config-twbs-bootstrap": "^12.0.0", 33 | "stylelint-order": "^6.0.4", 34 | "stylelint-scss": "^5.3.2", 35 | "stylelint-webpack-plugin": "^2.5.0", 36 | "webpack": "^4.46.0", 37 | "webpack-cli": "^3.3.12", 38 | "webpack-dev-server": "^3.11.3" 39 | }, 40 | "standard": { 41 | "ignore": [ 42 | "/*.js", 43 | "app/assets/javascripts", 44 | "app/javascript/src/vendor", 45 | "/config" 46 | ], 47 | "globals": [ 48 | "$", 49 | "RailsUjs", 50 | "Turbolinks" 51 | ] 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /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 |You may have mistyped the address or the page may have moved.
63 |If you are the application owner check the logs for more information.
65 |Maybe you tried to change something you didn't have access to.
63 |If you are the application owner check the logs for more information.
65 |If you are the application owner check the logs for more information.
64 |