suspenders 20230113.0 → 20240516.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +83 -176
  3. data/Rakefile +13 -0
  4. data/lib/generators/suspenders/accessibility_generator.rb +24 -0
  5. data/lib/generators/suspenders/advisories_generator.rb +32 -0
  6. data/lib/generators/suspenders/ci_generator.rb +57 -0
  7. data/lib/generators/suspenders/email_generator.rb +56 -0
  8. data/lib/generators/suspenders/environments/development_generator.rb +50 -0
  9. data/lib/generators/suspenders/environments/production_generator.rb +27 -0
  10. data/lib/generators/suspenders/environments/test_generator.rb +39 -0
  11. data/lib/generators/suspenders/factories_generator.rb +64 -0
  12. data/lib/generators/suspenders/inline_svg_generator.rb +24 -0
  13. data/lib/generators/suspenders/install/web_generator.rb +71 -0
  14. data/lib/generators/suspenders/jobs_generator.rb +34 -0
  15. data/lib/generators/suspenders/lint_generator.rb +94 -0
  16. data/lib/generators/suspenders/prerequisites_generator.rb +19 -0
  17. data/lib/generators/suspenders/rake_generator.rb +25 -0
  18. data/lib/generators/suspenders/setup_generator.rb +14 -0
  19. data/lib/generators/suspenders/styles_generator.rb +84 -0
  20. data/lib/generators/suspenders/tasks_generator.rb +20 -0
  21. data/lib/generators/suspenders/testing_generator.rb +113 -0
  22. data/lib/generators/suspenders/views_generator.rb +38 -0
  23. data/lib/generators/templates/ci/ci.yml.tt +148 -0
  24. data/lib/generators/templates/ci/dependabot.yml +7 -0
  25. data/lib/generators/templates/email/email_interceptor.rb +11 -0
  26. data/lib/generators/templates/factories/factories_spec.rb +7 -0
  27. data/lib/generators/templates/factories/factories_test.rb +9 -0
  28. data/lib/generators/templates/install/web/CONTRIBUTING.md +94 -0
  29. data/lib/generators/templates/lint/config_better_html.yml +2 -0
  30. data/lib/generators/templates/lint/config_initializers_better_html.rb +9 -0
  31. data/lib/generators/templates/lint/erb-lint.yml +63 -0
  32. data/lib/generators/templates/lint/erblint.rake +47 -0
  33. data/lib/generators/templates/lint/eslintrc.json +7 -0
  34. data/lib/generators/templates/lint/package.json +4 -0
  35. data/lib/generators/templates/lint/prettierignore +1 -0
  36. data/lib/generators/templates/lint/prettierrc +11 -0
  37. data/lib/generators/templates/lint/rubocop.yml.tt +7 -0
  38. data/lib/generators/templates/prerequisites/node-version.tt +1 -0
  39. data/lib/generators/templates/setup/bin_setup.rb +39 -0
  40. data/lib/generators/templates/styles/postcss.config.js +11 -0
  41. data/lib/generators/templates/testing/driver.rb +5 -0
  42. data/lib/generators/templates/views/flashes.html.erb +7 -0
  43. data/lib/install/web.rb +54 -0
  44. data/lib/suspenders/cleanup/generate_readme.rb +165 -0
  45. data/lib/suspenders/cleanup/organize_gemfile.rb +134 -0
  46. data/lib/suspenders/engine.rb +5 -0
  47. data/lib/suspenders/generators.rb +126 -0
  48. data/lib/suspenders/railtie.rb +4 -0
  49. data/lib/suspenders/version.rb +4 -6
  50. data/lib/suspenders.rb +9 -33
  51. data/lib/tasks/suspenders.rake +37 -0
  52. metadata +82 -173
  53. data/.ruby-version +0 -1
  54. data/CONTRIBUTING.md +0 -59
  55. data/GOALS.md +0 -65
  56. data/LICENSE +0 -21
  57. data/NEWS.md +0 -738
  58. data/RELEASING.md +0 -18
  59. data/bin/suspenders +0 -50
  60. data/docs/heroku_deploy.md +0 -19
  61. data/docs/rails_7.md +0 -5
  62. data/lib/suspenders/actions/strip_comments_action.rb +0 -254
  63. data/lib/suspenders/actions.rb +0 -106
  64. data/lib/suspenders/adapters/heroku.rb +0 -136
  65. data/lib/suspenders/app_builder.rb +0 -267
  66. data/lib/suspenders/exit_on_failure.rb +0 -19
  67. data/lib/suspenders/generators/accessibility_generator.rb +0 -12
  68. data/lib/suspenders/generators/advisories_generator.rb +0 -15
  69. data/lib/suspenders/generators/analytics_generator.rb +0 -24
  70. data/lib/suspenders/generators/app_generator.rb +0 -215
  71. data/lib/suspenders/generators/base.rb +0 -60
  72. data/lib/suspenders/generators/ci_generator.rb +0 -32
  73. data/lib/suspenders/generators/db_optimizations_generator.rb +0 -18
  74. data/lib/suspenders/generators/factories_generator.rb +0 -22
  75. data/lib/suspenders/generators/forms_generator.rb +0 -18
  76. data/lib/suspenders/generators/inline_svg_generator.rb +0 -14
  77. data/lib/suspenders/generators/jobs_generator.rb +0 -37
  78. data/lib/suspenders/generators/js_driver_generator.rb +0 -18
  79. data/lib/suspenders/generators/json_generator.rb +0 -14
  80. data/lib/suspenders/generators/lint_generator.rb +0 -14
  81. data/lib/suspenders/generators/production/compression_generator.rb +0 -14
  82. data/lib/suspenders/generators/production/deployment_generator.rb +0 -16
  83. data/lib/suspenders/generators/production/email_generator.rb +0 -34
  84. data/lib/suspenders/generators/production/force_tls_generator.rb +0 -11
  85. data/lib/suspenders/generators/production/manifest_generator.rb +0 -25
  86. data/lib/suspenders/generators/production/single_redirect.rb +0 -15
  87. data/lib/suspenders/generators/production/timeout_generator.rb +0 -22
  88. data/lib/suspenders/generators/profiler_generator.rb +0 -35
  89. data/lib/suspenders/generators/runner_generator.rb +0 -48
  90. data/lib/suspenders/generators/staging/pull_requests_generator.rb +0 -25
  91. data/lib/suspenders/generators/static_generator.rb +0 -14
  92. data/lib/suspenders/generators/stylelint_generator.rb +0 -71
  93. data/lib/suspenders/generators/stylesheet_base_generator.rb +0 -15
  94. data/lib/suspenders/generators/testing_generator.rb +0 -43
  95. data/lib/suspenders/generators/views_generator.rb +0 -25
  96. data/templates/Gemfile.erb +0 -49
  97. data/templates/Procfile +0 -2
  98. data/templates/README.md.erb +0 -28
  99. data/templates/_analytics.html.erb +0 -8
  100. data/templates/_css_overrides.html.erb +0 -7
  101. data/templates/_flashes.html.erb +0 -7
  102. data/templates/active_job.rb +0 -14
  103. data/templates/application.postcss.css +0 -1
  104. data/templates/bin_auto_migrate +0 -5
  105. data/templates/bin_deploy +0 -10
  106. data/templates/bin_setup +0 -28
  107. data/templates/bin_setup_review_app.erb +0 -21
  108. data/templates/bin_yarn +0 -18
  109. data/templates/bundler_audit.rake +0 -4
  110. data/templates/capybara_silence_puma.rb +0 -1
  111. data/templates/chromedriver.rb +0 -27
  112. data/templates/circle.yml.erb +0 -6
  113. data/templates/config_locales_en.yml.erb +0 -19
  114. data/templates/descriptions/advisories.md +0 -5
  115. data/templates/descriptions/analytics.md +0 -4
  116. data/templates/descriptions/ci.md +0 -4
  117. data/templates/descriptions/compression.md +0 -4
  118. data/templates/descriptions/db_optimizations.md +0 -2
  119. data/templates/descriptions/deployment.md +0 -5
  120. data/templates/descriptions/email.md +0 -9
  121. data/templates/descriptions/factories.md +0 -12
  122. data/templates/descriptions/force_tls.md +0 -1
  123. data/templates/descriptions/forms.md +0 -1
  124. data/templates/descriptions/inline_svg.md +0 -2
  125. data/templates/descriptions/jobs.md +0 -3
  126. data/templates/descriptions/js_driver.md +0 -4
  127. data/templates/descriptions/json.md +0 -1
  128. data/templates/descriptions/lint.md +0 -3
  129. data/templates/descriptions/manifest.md +0 -2
  130. data/templates/descriptions/profiler.md +0 -7
  131. data/templates/descriptions/pull_requests.md +0 -4
  132. data/templates/descriptions/runner.md +0 -10
  133. data/templates/descriptions/single_redirect.md +0 -1
  134. data/templates/descriptions/static.md +0 -5
  135. data/templates/descriptions/stylelint.md +0 -3
  136. data/templates/descriptions/stylesheet_base.md +0 -1
  137. data/templates/descriptions/testing.md +0 -9
  138. data/templates/descriptions/timeout.md +0 -4
  139. data/templates/descriptions/views.md +0 -8
  140. data/templates/email.rb +0 -3
  141. data/templates/errors.rb +0 -35
  142. data/templates/flashes_helper.rb +0 -5
  143. data/templates/hound.yml +0 -15
  144. data/templates/json_encoding.rb +0 -1
  145. data/templates/oj.rb +0 -3
  146. data/templates/partials/ci_simplecov.rb +0 -14
  147. data/templates/partials/db_optimizations_configuration.rb +0 -7
  148. data/templates/partials/deployment_readme.md +0 -8
  149. data/templates/partials/email_smtp.rb +0 -2
  150. data/templates/partials/profiler_readme.md +0 -8
  151. data/templates/partials/pull_requests_config.rb +0 -5
  152. data/templates/partials/runner_readme.md +0 -31
  153. data/templates/partials/runner_setup.rb +0 -2
  154. data/templates/postcss.config.js +0 -8
  155. data/templates/postgresql_database.yml.erb +0 -20
  156. data/templates/rack_mini_profiler.rb +0 -7
  157. data/templates/rails_helper.rb +0 -25
  158. data/templates/sample_env +0 -12
  159. data/templates/secrets.yml +0 -8
  160. data/templates/smtp.rb +0 -9
  161. data/templates/spec_helper.rb +0 -25
  162. data/templates/suspenders_gitignore +0 -18
  163. data/templates/suspenders_layout.html.erb.erb +0 -23
  164. /data/{templates → lib/generators/templates/factories}/factories.rb +0 -0
  165. /data/{templates → lib/generators/templates/factories}/factory_bot_rspec.rb +0 -0
  166. /data/{templates → lib/generators/templates/inline_svg}/inline_svg.rb +0 -0
  167. /data/{templates → lib/generators/templates/lint}/stylelintrc.json +0 -0
  168. /data/{templates → lib/generators/templates/tasks}/dev.rake +0 -0
  169. /data/{templates → lib/generators/templates/testing}/action_mailer.rb +0 -0
  170. /data/{templates → lib/generators/templates/testing}/i18n.rb +0 -0
  171. /data/{templates/shoulda_matchers_config_rspec.rb → lib/generators/templates/testing/shoulda_matchers.rb} +0 -0
@@ -1,14 +0,0 @@
1
- require "active_job/logging"
2
- require "active_job/log_subscriber"
3
-
4
- ActiveSupport::Notifications.unsubscribe("enqueue.active_job")
5
-
6
- module ActiveJob
7
- module Logging
8
- class EnqueueLogSubscriber < LogSubscriber
9
- define_method :enqueue, instance_method(:enqueue)
10
- end
11
- end
12
- end
13
-
14
- ActiveJob::Logging::EnqueueLogSubscriber.attach_to(:active_job)
@@ -1 +0,0 @@
1
- @import "normalize.css"
@@ -1,5 +0,0 @@
1
- set -e
2
-
3
- if [ -n "$AUTO_MIGRATE_DB" ]; then
4
- bundle exec rake db:migrate
5
- fi
data/templates/bin_deploy DELETED
@@ -1,10 +0,0 @@
1
- #!/bin/sh
2
-
3
- # Run this script to deploy the app to Heroku.
4
-
5
- set -e
6
-
7
- branch="$(git symbolic-ref HEAD --short)"
8
- target="${1:-staging}"
9
-
10
- git push "$target" "$branch:master"
data/templates/bin_setup DELETED
@@ -1,28 +0,0 @@
1
- #!/bin/sh
2
-
3
- # Set up Rails app. Run this script immediately after cloning the codebase.
4
- # https://github.com/thoughtbot/guides/tree/master/protocol
5
-
6
- # Exit if any subcommand fails
7
- set -e
8
-
9
- # Set up Ruby dependencies via Bundler
10
- gem install bundler --conservative
11
- bundle check || bundle install
12
-
13
- # Install JavaScript dependencies
14
- bin/yarn
15
-
16
- # Set up database and add any development seed data
17
- bin/rails dev:prime
18
-
19
- if [ ! -d .git/safe ] && echo $PATH | grep .git/safe > /dev/null; then
20
- echo "-----------------------------------------------------------------------"
21
- echo
22
- echo "-> When you trust this repo, remember to run: mkdir -p .git/safe"
23
- echo
24
- fi
25
-
26
- # Only if this isn't CI
27
- if [ -z "$CI" ]; then
28
- fi
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
-
3
- # Run this script to set up a review app's database and worker dyno
4
-
5
- set -e
6
-
7
- if [ -z "$1" ]; then
8
- printf "You must provide a review app (same as the pull request) id.\n"
9
- exit 64
10
- fi
11
-
12
- PARENT_APP_NAME=<%= app_name.dasherize %>-staging
13
- APP_NAME=<%= app_name.dasherize %>-staging-pr-$1
14
-
15
- heroku pg:backups:capture --app $PARENT_APP_NAME
16
-
17
- URL=`heroku pg:backups public-url --app $PARENT_APP_NAME`
18
-
19
- heroku pg:backups restore $URL DATABASE_URL --confirm $APP_NAME --app $APP_NAME
20
- heroku ps:scale worker=1 --app $APP_NAME
21
- heroku restart --app $APP_NAME
data/templates/bin_yarn DELETED
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- APP_ROOT = File.expand_path("..", __dir__)
4
- Dir.chdir(APP_ROOT) do
5
- yarn = ENV["PATH"].split(File::PATH_SEPARATOR)
6
- .select { |dir| File.expand_path(dir) != __dir__ }
7
- .product(["yarn", "yarnpkg", "yarn.cmd", "yarn.ps1"])
8
- .map { |dir, file| File.expand_path(file, dir) }
9
- .find { |file| File.executable?(file) }
10
-
11
- if yarn
12
- exec yarn, *ARGV
13
- else
14
- warn "Yarn executable was not detected in the system."
15
- warn "Download Yarn at https://yarnpkg.com/en/docs/install"
16
- exit 1
17
- end
18
- end
@@ -1,4 +0,0 @@
1
- if Rails.env.development? || Rails.env.test?
2
- require "bundler/audit/task"
3
- Bundler::Audit::Task.new
4
- end
@@ -1 +0,0 @@
1
- Capybara.server = :puma, {Silent: true}
@@ -1,27 +0,0 @@
1
- require "selenium/webdriver"
2
-
3
- Capybara.register_driver :chrome do |app|
4
- Capybara::Selenium::Driver.new(app, browser: :chrome)
5
- end
6
-
7
- Capybara.register_driver :headless_chrome do |app|
8
- options = ::Selenium::WebDriver::Chrome::Options.new
9
- options.headless!
10
- options.add_argument "--window-size=1680,1050"
11
-
12
- Capybara::Selenium::Driver.new app,
13
- browser: :chrome,
14
- options: options
15
- end
16
-
17
- Capybara.javascript_driver = :headless_chrome
18
-
19
- RSpec.configure do |config|
20
- config.before(:each, type: :system) do
21
- driven_by :rack_test
22
- end
23
-
24
- config.before(:each, type: :system, js: true) do
25
- driven_by Capybara.javascript_driver
26
- end
27
- end
@@ -1,6 +0,0 @@
1
- database:
2
- override:
3
- - RAILS_ENV=development bin/setup
4
- test:
5
- override:
6
- - COVERAGE=true bin/rake
@@ -1,19 +0,0 @@
1
- en:
2
- date:
3
- formats:
4
- default:
5
- "%m/%d/%Y"
6
- with_weekday:
7
- "%a %m/%d/%y"
8
-
9
- time:
10
- formats:
11
- default:
12
- "%a, %b %-d, %Y at %r"
13
- date:
14
- "%b %-d, %Y"
15
- short:
16
- "%B %d"
17
-
18
- titles:
19
- application: <%= app_name.humanize %>
@@ -1,5 +0,0 @@
1
- Show security advisories during development.
2
-
3
- Uses the `bundler-audit` gem and rake task to update the local security
4
- database and show any relevant issues with the app's dependencies. This happens
5
- on every test run and interaction with `bin/rake` and `bin/rails`.
@@ -1,4 +0,0 @@
1
- Work with a user analytics service.
2
-
3
- Add the JavaScript for connecting to Segment to a partial and, if possible,
4
- include that partial on every page.
@@ -1,4 +0,0 @@
1
- Prepare the app for running tests on a continuous integration service.
2
-
3
- Sets up a CircleCI configuration using `bin/setup` to initialize the app and
4
- `rake` to run the tests. Use SimpleCov for code coverage metrics on CI.
@@ -1,4 +0,0 @@
1
- Compress HTTP requests at the Rails layer.
2
-
3
- This uses `Rack::Deflater`, and is done at the app layer instead of at the Web
4
- server layer.
@@ -1,2 +0,0 @@
1
- Get database performance insights as you develop. This installs and configures
2
- Bullet.
@@ -1,5 +0,0 @@
1
- Script and document the deployment.
2
-
3
- This adds a `bin/deploy` script, to be called like `deploy staging` or
4
- `deploy production`, along with updates to the README.md describing how to use
5
- it.
@@ -1,9 +0,0 @@
1
- Configure the app for email.
2
-
3
- Set the app up with SMTP in production. This expects the following environment
4
- variables to be set:
5
-
6
- - `SMTP_ADDRESS`
7
- - `SMTP_DOMAIN`
8
- - `SMTP_PASSWORD`
9
- - `SMTP_USERNAME`
@@ -1,12 +0,0 @@
1
- Build test data with clarity and ease.
2
-
3
- This uses FactoryBot to help you define dummy and test data for your test
4
- suite. The `create`, `build`, and `build_stubbed` class methods are directly
5
- available to all tests.
6
-
7
- We recommend putting FactoryBot definitions in one `spec/factories.rb` file, at
8
- least until it grows unwieldy. This helps reduce confusion around circular
9
- dependencies and makes it easy to jump between definitions.
10
-
11
- Outside of the tests, the `dev:prime` rake task can be used to insert initial
12
- development data into the database. You can use FactoryBot here, too.
@@ -1 +0,0 @@
1
- Redirect users to the HTTPS URL on the production Web site.
@@ -1 +0,0 @@
1
- Make forms easier to make with form helpers. This mostly involves SimpleForm.
@@ -1,2 +0,0 @@
1
- Render SVG images inline, as a potential performance improvement for the
2
- viewer.
@@ -1,3 +0,0 @@
1
- Set up our favorite job runner.
2
-
3
- Currently we like Sidekiq. Run all tests inline by default.
@@ -1,4 +0,0 @@
1
- Set up the test suite for running JavaScript tests.
2
-
3
- This uses the latest and greatest JavaScript test runner -- currently,
4
- chromedriver. It comes with a headless mode and a headful/debugging mode.
@@ -1 +0,0 @@
1
- Use the fastest JSON parser available.
@@ -1,3 +0,0 @@
1
- Prepare the app for style linting.
2
-
3
- This sets up your app to use Hound with a default Hound configuration.
@@ -1,2 +0,0 @@
1
- Write the AppManifest (`app.json`) document with all the environment variables
2
- we require.
@@ -1,7 +0,0 @@
1
- Show runtime profiling for your Rails app as you develop it.
2
-
3
- This uses the `rack-mini-profiler` gem to show a speed badge on every page.
4
- This is controlled by the `RACK_MINI_PROFILER` environment variable which
5
- defaults to `0` in the `.sample.env`. Set it to `1` to enable profiling.
6
-
7
- Updates your README.md to explain this environment variable.
@@ -1,4 +0,0 @@
1
- Create a staging environment for each pull request.
2
-
3
- This glues Heroku review apps to GitHub pull requests, populating the database
4
- from the generic staging environment on a low-scale review app.
@@ -1,10 +0,0 @@
1
- Set up the app to run locally with ease.
2
-
3
- Use Puma and Sidekiq to run the app. This can be done via either
4
- `heroku local` or any Foreman-compatible project runner (e.g. `foreman start`).
5
-
6
- Configure your app using `.env`. Installs a basic `.sample.env` that is meant
7
- to be checked into git and used as a template for your `.env`. The `bin/setup`
8
- script is modified to safely copy `.sample.env` to `.env` for you.
9
-
10
- Document all of this in the README.
@@ -1 +0,0 @@
1
- Canonicalize the URL by configuring the `Rack::CanonicalHost` middleware.
@@ -1,5 +0,0 @@
1
- Easily add static pages to your dynamic Rails app.
2
-
3
- Files placed in the `app/views/pages` directory are rendered using the standard
4
- Rails view renderer and accessible at `/pages/:view_name`, via the
5
- `high_voltage` gem.
@@ -1,3 +0,0 @@
1
- Enable stylesheet linting.
2
-
3
- This configures the stylelint tool to work locally and integrated with Hound.
@@ -1 +0,0 @@
1
- Adds PostCSS Normalize
@@ -1,9 +0,0 @@
1
- Set up the project for an in-depth test-driven development workflow.
2
-
3
- - Maintain the test DB schema.
4
- - Clear mail deliveries between tests.
5
- - Import i18n helpers for use in tests.
6
- - Prepare for system tests in `spec/system`.
7
- - Integrate Formulaic for easier form testing.
8
- - RSpec infers the file type based on the directory name.
9
- - Install and configure RSpec and shoulda-matchers.
@@ -1,4 +0,0 @@
1
- Kill Rack requests that last too long.
2
-
3
- This adds the `rack-timeout` gem and configures it to kill the connection after
4
- 10 seconds.
@@ -1,8 +0,0 @@
1
- View templates for flash, JavaScript, and CSS.
2
-
3
- - Disable CSS animations in tests.
4
- - Run JavaScript when the page has loaded.
5
- - Use the `title` gem for controlling the page title via i18n.
6
- - Insert one-off JavaScript into a `:javascript` content block.
7
- - Creates the directory for storing generic, application-level partials.
8
- - Render user-facing partials (alert, error, notice, success) on all pages.
data/templates/email.rb DELETED
@@ -1,3 +0,0 @@
1
- if ENV["EMAIL_RECIPIENTS"].present?
2
- Mail.register_interceptor RecipientInterceptor.new(ENV["EMAIL_RECIPIENTS"])
3
- end
data/templates/errors.rb DELETED
@@ -1,35 +0,0 @@
1
- require "net/http"
2
- require "net/smtp"
3
-
4
- # Example:
5
- # begin
6
- # some http call
7
- # rescue *HTTP_ERRORS => error
8
- # notify_hoptoad error
9
- # end
10
-
11
- HTTP_ERRORS = [
12
- EOFError,
13
- Errno::ECONNRESET,
14
- Errno::EINVAL,
15
- Errno::ECONNREFUSED,
16
- Net::HTTPBadResponse,
17
- Net::HTTPHeaderSyntaxError,
18
- Net::ProtocolError,
19
- Timeout::Error
20
- ]
21
-
22
- SMTP_SERVER_ERRORS = [
23
- IOError,
24
- Net::SMTPAuthenticationError,
25
- Net::SMTPServerBusy,
26
- Net::SMTPUnknownError,
27
- Timeout::Error
28
- ]
29
-
30
- SMTP_CLIENT_ERRORS = [
31
- Net::SMTPFatalError,
32
- Net::SMTPSyntaxError
33
- ]
34
-
35
- SMTP_ERRORS = SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS
@@ -1,5 +0,0 @@
1
- module FlashesHelper
2
- def user_facing_flashes
3
- flash.to_hash.slice("alert", "error", "notice", "success")
4
- end
5
- end
data/templates/hound.yml DELETED
@@ -1,15 +0,0 @@
1
- # See https://houndci.com/configuration for help.
2
- haml:
3
- # config_file: .haml-style.yml
4
- enabled: true
5
- javascript:
6
- # config_file: .javascript-style.json
7
- enabled: true
8
- # ignore_file: .javascript_ignore
9
- ruby:
10
- enabled: false
11
- scss:
12
- enabled: false
13
- stylelint:
14
- # config_file: .stylelintrc.json
15
- enabled: true
@@ -1 +0,0 @@
1
- ActiveSupport::JSON::Encoding.time_precision = 0
data/templates/oj.rb DELETED
@@ -1,3 +0,0 @@
1
- require "oj"
2
-
3
- Oj.optimize_rails
@@ -1,14 +0,0 @@
1
- if ENV.fetch("COVERAGE", false)
2
- require "simplecov"
3
-
4
- if ENV["CIRCLE_ARTIFACTS"]
5
- dir = File.join(ENV["CIRCLE_ARTIFACTS"], "coverage")
6
- SimpleCov.coverage_dir(dir)
7
- end
8
-
9
- SimpleCov.start "rails"
10
-
11
- if defined?(Spring) && ENV["DISABLE_SPRING"].to_i == 1
12
- Rails.application.eager_load!
13
- end
14
- end
@@ -1,7 +0,0 @@
1
-
2
-
3
- config.after_initialize do
4
- Bullet.enable = true
5
- Bullet.bullet_logger = true
6
- Bullet.rails_logger = true
7
- end
@@ -1,8 +0,0 @@
1
-
2
- ## Deploying
3
-
4
- If you have previously run the `./bin/setup` script,
5
- you can deploy to staging and production with:
6
-
7
- % ./bin/deploy staging
8
- % ./bin/deploy production
@@ -1,2 +0,0 @@
1
- config.action_mailer.delivery_method = :smtp
2
- config.action_mailer.smtp_settings = SMTP_SETTINGS
@@ -1,8 +0,0 @@
1
-
2
- ## Profiler
3
-
4
- The [rack-mini-profiler] gem can be enabled by setting
5
- `RACK_MINI_PROFILER=1` in the environment. This will display a speed
6
- badge on every page.
7
-
8
- [rack-mini-profiler]: https://github.com/MiniProfiler/rack-mini-profiler
@@ -1,5 +0,0 @@
1
- if ENV.fetch("HEROKU_APP_NAME", "").include?("staging-pr-")
2
- ENV["APPLICATION_HOST"] = ENV["HEROKU_APP_NAME"] + ".herokuapp.com"
3
- ENV["ASSET_HOST"] = ENV["HEROKU_APP_NAME"] + ".herokuapp.com"
4
- end
5
-
@@ -1,31 +0,0 @@
1
- ## Configuration
2
-
3
- Environment variables during local development are handled by the node-foreman
4
- project runner. To provide environment variables, create a `.env` file at the
5
- root of the project. In that file provide the environment variables listed in
6
- `.sample.env`. The `bin/setup` script does this for you, but be careful about
7
- overwriting your existing `.env` file.
8
-
9
- `app.json` also contains a list of environment variables that are required for
10
- the application. The `.sample.env` file provides either non-secret vars that
11
- can be copied directly into your own `.env` file or instructions on where to
12
- obtain secret values.
13
-
14
- During development add any new environment variables needed by the application
15
- to both `.sample.env` and `app.json`, providing either **public** default
16
- values or brief instructions on where secret values may be found.
17
-
18
- Do not commit the `.env` file to the git repo.
19
-
20
- ## Running the Application
21
-
22
- Use the `heroku local` runner to run the app locally as it would run on Heroku.
23
- This uses the node-forman runner, which reads from the `Procfile` file.
24
-
25
- ```sh
26
- heroku local
27
- ```
28
-
29
- Once the server is started the application is reachable at
30
- `http://localhost:3000`.
31
-
@@ -1,2 +0,0 @@
1
- puts "\n== Copying sample env =="
2
- system! "cp -i .sample.env .env"
@@ -1,8 +0,0 @@
1
- module.exports = {
2
- plugins: [
3
- require('postcss-nesting'),
4
- require('autoprefixer'),
5
- require('postcss-normalize')
6
- ],
7
- }
8
-
@@ -1,20 +0,0 @@
1
- development: &default
2
- adapter: postgresql
3
- database: <%= app_name %>_development
4
- encoding: utf8
5
- min_messages: warning
6
- pool: <%%= Integer(ENV.fetch("DB_POOL", 5)) %>
7
- reaping_frequency: <%%= Integer(ENV.fetch("DB_REAPING_FREQUENCY", 10)) %>
8
- timeout: 5000
9
- url: <%%= ENV["DATABASE_URL"] %>
10
-
11
- test:
12
- <<: *default
13
- database: <%= app_name %>_test
14
-
15
- production: &deploy
16
- encoding: utf8
17
- min_messages: warning
18
- pool: <%%= [Integer(ENV.fetch("MAX_THREADS", 5)), Integer(ENV.fetch("DB_POOL", 5))].max %>
19
- timeout: 5000
20
- url: <%%= ENV.fetch("DATABASE_URL", "") %>
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- if ENV["RACK_MINI_PROFILER"].to_i > 0
4
- require "rack-mini-profiler"
5
-
6
- Rack::MiniProfilerRails.initialize!(Rails.application)
7
- end
@@ -1,25 +0,0 @@
1
- ENV["RACK_ENV"] = "test"
2
-
3
- require File.expand_path("../../config/environment", __FILE__)
4
-
5
- if Rails.env.production?
6
- abort("The Rails environment is running in production mode!")
7
- end
8
-
9
- require "rspec/rails"
10
-
11
- Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |file| require file }
12
-
13
- module SystemTestHelper
14
- # Extend this module in spec/support/system/*.rb
15
- include Formulaic::Dsl
16
- end
17
-
18
- RSpec.configure do |config|
19
- config.include SystemTestHelper, type: :system
20
- config.infer_base_class_for_anonymous_controllers = false
21
- config.infer_spec_type_from_file_location!
22
- config.use_transactional_fixtures = true
23
- end
24
-
25
- ActiveRecord::Migration.maintain_test_schema!
data/templates/sample_env DELETED
@@ -1,12 +0,0 @@
1
- # https://github.com/ddollar/forego
2
- ASSET_HOST=localhost:3000
3
- APPLICATION_HOST=localhost:3000
4
- PORT=3000
5
- RACK_ENV=development
6
- REDIS_URL=localhost:6379
7
- SECRET_KEY_BASE=development_secret
8
- SMTP_ADDRESS=smtp.example.com
9
- SMTP_DOMAIN=example.com
10
- SMTP_PASSWORD=password
11
- SMTP_USERNAME=username
12
- WEB_CONCURRENCY=1
@@ -1,8 +0,0 @@
1
- shared:
2
- secret_key_base: <%%= ENV["SECRET_KEY_BASE"] %>
3
-
4
- development:
5
-
6
- test:
7
-
8
- production:
data/templates/smtp.rb DELETED
@@ -1,9 +0,0 @@
1
- SMTP_SETTINGS = {
2
- address: ENV.fetch("SMTP_ADDRESS"), # example: "smtp.sendgrid.net"
3
- authentication: :plain,
4
- domain: ENV.fetch("SMTP_DOMAIN"), # example: "heroku.com"
5
- enable_starttls_auto: true,
6
- password: ENV.fetch("SMTP_PASSWORD"),
7
- port: "587",
8
- user_name: ENV.fetch("SMTP_USERNAME")
9
- }
@@ -1,25 +0,0 @@
1
- require "webmock/rspec"
2
- require "timecop"
3
-
4
- # http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
5
- RSpec.configure do |config|
6
- config.expect_with :rspec do |expectations|
7
- expectations.syntax = :expect
8
- end
9
-
10
- config.mock_with :rspec do |mocks|
11
- mocks.syntax = :expect
12
- mocks.verify_partial_doubles = true
13
- end
14
-
15
- config.example_status_persistence_file_path = "tmp/rspec_examples.txt"
16
- config.order = :random
17
- end
18
-
19
- WebMock.disable_net_connect!(
20
- allow_localhost: true,
21
- allow: "chromedriver.storage.googleapis.com"
22
- )
23
-
24
- # Only allow Timecop with block syntax
25
- Timecop.safe_mode = true