suspenders 20230113.0 → 20250317.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +98 -170
  3. data/Rakefile +17 -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 +54 -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 +85 -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/email/email_interceptor.rb +11 -0
  25. data/lib/generators/templates/factories/factories_spec.rb +7 -0
  26. data/lib/generators/templates/factories/factories_test.rb +9 -0
  27. data/lib/generators/templates/install/web/CONTRIBUTING.md +94 -0
  28. data/lib/generators/templates/lint/config_better_html.yml +2 -0
  29. data/lib/generators/templates/lint/config_initializers_better_html.rb +9 -0
  30. data/lib/generators/templates/lint/erb-lint.yml +63 -0
  31. data/lib/generators/templates/lint/erblint.rake +47 -0
  32. data/lib/generators/templates/lint/eslintrc.json +7 -0
  33. data/lib/generators/templates/lint/package.json +4 -0
  34. data/lib/generators/templates/lint/prettierignore +1 -0
  35. data/lib/generators/templates/lint/prettierrc +11 -0
  36. data/lib/generators/templates/lint/rubocop.yml.tt +7 -0
  37. data/lib/generators/templates/prerequisites/node-version.tt +1 -0
  38. data/lib/generators/templates/setup/bin_setup.rb +39 -0
  39. data/lib/generators/templates/styles/postcss.config.js +11 -0
  40. data/lib/generators/templates/testing/driver.rb +5 -0
  41. data/lib/generators/templates/views/flashes.html.erb +7 -0
  42. data/lib/install/web.rb +70 -0
  43. data/lib/suspenders/cleanup/generate_readme.rb +165 -0
  44. data/lib/suspenders/cleanup/organize_gemfile.rb +134 -0
  45. data/lib/suspenders/engine.rb +5 -0
  46. data/lib/suspenders/generators.rb +126 -0
  47. data/lib/suspenders/railtie.rb +4 -0
  48. data/lib/suspenders/version.rb +4 -6
  49. data/lib/suspenders.rb +9 -33
  50. data/lib/tasks/suspenders.rake +37 -0
  51. metadata +81 -173
  52. data/.ruby-version +0 -1
  53. data/CONTRIBUTING.md +0 -59
  54. data/GOALS.md +0 -65
  55. data/LICENSE +0 -21
  56. data/NEWS.md +0 -738
  57. data/RELEASING.md +0 -18
  58. data/bin/suspenders +0 -50
  59. data/docs/heroku_deploy.md +0 -19
  60. data/docs/rails_7.md +0 -5
  61. data/lib/suspenders/actions/strip_comments_action.rb +0 -254
  62. data/lib/suspenders/actions.rb +0 -106
  63. data/lib/suspenders/adapters/heroku.rb +0 -136
  64. data/lib/suspenders/app_builder.rb +0 -267
  65. data/lib/suspenders/exit_on_failure.rb +0 -19
  66. data/lib/suspenders/generators/accessibility_generator.rb +0 -12
  67. data/lib/suspenders/generators/advisories_generator.rb +0 -15
  68. data/lib/suspenders/generators/analytics_generator.rb +0 -24
  69. data/lib/suspenders/generators/app_generator.rb +0 -215
  70. data/lib/suspenders/generators/base.rb +0 -60
  71. data/lib/suspenders/generators/ci_generator.rb +0 -32
  72. data/lib/suspenders/generators/db_optimizations_generator.rb +0 -18
  73. data/lib/suspenders/generators/factories_generator.rb +0 -22
  74. data/lib/suspenders/generators/forms_generator.rb +0 -18
  75. data/lib/suspenders/generators/inline_svg_generator.rb +0 -14
  76. data/lib/suspenders/generators/jobs_generator.rb +0 -37
  77. data/lib/suspenders/generators/js_driver_generator.rb +0 -18
  78. data/lib/suspenders/generators/json_generator.rb +0 -14
  79. data/lib/suspenders/generators/lint_generator.rb +0 -14
  80. data/lib/suspenders/generators/production/compression_generator.rb +0 -14
  81. data/lib/suspenders/generators/production/deployment_generator.rb +0 -16
  82. data/lib/suspenders/generators/production/email_generator.rb +0 -34
  83. data/lib/suspenders/generators/production/force_tls_generator.rb +0 -11
  84. data/lib/suspenders/generators/production/manifest_generator.rb +0 -25
  85. data/lib/suspenders/generators/production/single_redirect.rb +0 -15
  86. data/lib/suspenders/generators/production/timeout_generator.rb +0 -22
  87. data/lib/suspenders/generators/profiler_generator.rb +0 -35
  88. data/lib/suspenders/generators/runner_generator.rb +0 -48
  89. data/lib/suspenders/generators/staging/pull_requests_generator.rb +0 -25
  90. data/lib/suspenders/generators/static_generator.rb +0 -14
  91. data/lib/suspenders/generators/stylelint_generator.rb +0 -71
  92. data/lib/suspenders/generators/stylesheet_base_generator.rb +0 -15
  93. data/lib/suspenders/generators/testing_generator.rb +0 -43
  94. data/lib/suspenders/generators/views_generator.rb +0 -25
  95. data/templates/Gemfile.erb +0 -49
  96. data/templates/Procfile +0 -2
  97. data/templates/README.md.erb +0 -28
  98. data/templates/_analytics.html.erb +0 -8
  99. data/templates/_css_overrides.html.erb +0 -7
  100. data/templates/_flashes.html.erb +0 -7
  101. data/templates/active_job.rb +0 -14
  102. data/templates/application.postcss.css +0 -1
  103. data/templates/bin_auto_migrate +0 -5
  104. data/templates/bin_deploy +0 -10
  105. data/templates/bin_setup +0 -28
  106. data/templates/bin_setup_review_app.erb +0 -21
  107. data/templates/bin_yarn +0 -18
  108. data/templates/bundler_audit.rake +0 -4
  109. data/templates/capybara_silence_puma.rb +0 -1
  110. data/templates/chromedriver.rb +0 -27
  111. data/templates/circle.yml.erb +0 -6
  112. data/templates/config_locales_en.yml.erb +0 -19
  113. data/templates/descriptions/advisories.md +0 -5
  114. data/templates/descriptions/analytics.md +0 -4
  115. data/templates/descriptions/ci.md +0 -4
  116. data/templates/descriptions/compression.md +0 -4
  117. data/templates/descriptions/db_optimizations.md +0 -2
  118. data/templates/descriptions/deployment.md +0 -5
  119. data/templates/descriptions/email.md +0 -9
  120. data/templates/descriptions/factories.md +0 -12
  121. data/templates/descriptions/force_tls.md +0 -1
  122. data/templates/descriptions/forms.md +0 -1
  123. data/templates/descriptions/inline_svg.md +0 -2
  124. data/templates/descriptions/jobs.md +0 -3
  125. data/templates/descriptions/js_driver.md +0 -4
  126. data/templates/descriptions/json.md +0 -1
  127. data/templates/descriptions/lint.md +0 -3
  128. data/templates/descriptions/manifest.md +0 -2
  129. data/templates/descriptions/profiler.md +0 -7
  130. data/templates/descriptions/pull_requests.md +0 -4
  131. data/templates/descriptions/runner.md +0 -10
  132. data/templates/descriptions/single_redirect.md +0 -1
  133. data/templates/descriptions/static.md +0 -5
  134. data/templates/descriptions/stylelint.md +0 -3
  135. data/templates/descriptions/stylesheet_base.md +0 -1
  136. data/templates/descriptions/testing.md +0 -9
  137. data/templates/descriptions/timeout.md +0 -4
  138. data/templates/descriptions/views.md +0 -8
  139. data/templates/email.rb +0 -3
  140. data/templates/errors.rb +0 -35
  141. data/templates/flashes_helper.rb +0 -5
  142. data/templates/hound.yml +0 -15
  143. data/templates/json_encoding.rb +0 -1
  144. data/templates/oj.rb +0 -3
  145. data/templates/partials/ci_simplecov.rb +0 -14
  146. data/templates/partials/db_optimizations_configuration.rb +0 -7
  147. data/templates/partials/deployment_readme.md +0 -8
  148. data/templates/partials/email_smtp.rb +0 -2
  149. data/templates/partials/profiler_readme.md +0 -8
  150. data/templates/partials/pull_requests_config.rb +0 -5
  151. data/templates/partials/runner_readme.md +0 -31
  152. data/templates/partials/runner_setup.rb +0 -2
  153. data/templates/postcss.config.js +0 -8
  154. data/templates/postgresql_database.yml.erb +0 -20
  155. data/templates/rack_mini_profiler.rb +0 -7
  156. data/templates/rails_helper.rb +0 -25
  157. data/templates/sample_env +0 -12
  158. data/templates/secrets.yml +0 -8
  159. data/templates/smtp.rb +0 -9
  160. data/templates/spec_helper.rb +0 -25
  161. data/templates/suspenders_gitignore +0 -18
  162. data/templates/suspenders_layout.html.erb.erb +0 -23
  163. /data/{templates → lib/generators/templates/factories}/factories.rb +0 -0
  164. /data/{templates → lib/generators/templates/factories}/factory_bot_rspec.rb +0 -0
  165. /data/{templates → lib/generators/templates/inline_svg}/inline_svg.rb +0 -0
  166. /data/{templates → lib/generators/templates/lint}/stylelintrc.json +0 -0
  167. /data/{templates → lib/generators/templates/tasks}/dev.rake +0 -0
  168. /data/{templates → lib/generators/templates/testing}/action_mailer.rb +0 -0
  169. /data/{templates → lib/generators/templates/testing}/i18n.rb +0 -0
  170. /data/{templates/shoulda_matchers_config_rspec.rb → lib/generators/templates/testing/shoulda_matchers.rb} +0 -0
@@ -1,18 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class FormsGenerator < Generators::Base
5
- def add_simple_form
6
- gem "simple_form"
7
- Bundler.with_unbundled_env { run "bundle install" }
8
- end
9
-
10
- def configure_simple_form
11
- create_file "config/initializers/simple_form.rb" do
12
- "SimpleForm.setup {|config|}"
13
- end
14
-
15
- generate "simple_form:install", "--force"
16
- end
17
- end
18
- end
@@ -1,14 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class InlineSvgGenerator < Generators::Base
5
- def add_inline_svg
6
- gem "inline_svg"
7
- Bundler.with_unbundled_env { run "bundle install" }
8
- end
9
-
10
- def configure_inline_svg
11
- copy_file "inline_svg.rb", "config/initializers/inline_svg.rb"
12
- end
13
- end
14
- end
@@ -1,37 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class JobsGenerator < Generators::Base
5
- def add_jobs_gem
6
- gem "sidekiq"
7
- Bundler.with_unbundled_env { run "bundle install" }
8
- end
9
-
10
- def initialize_active_job
11
- copy_file(
12
- "active_job.rb",
13
- "config/initializers/active_job.rb"
14
- )
15
- end
16
-
17
- def configure_active_job
18
- configure_application_file("config.active_job.queue_adapter = :sidekiq")
19
- configure_application_file("config.action_mailer.deliver_later_queue_name = nil")
20
- configure_application_file("config.action_mailbox.queues.routing = nil")
21
- configure_application_file("config.active_storage.queues.analysis = nil")
22
- configure_application_file("config.active_storage.queues.purge = nil")
23
- configure_application_file("config.active_storage.queues.mirror = nil")
24
- configure_environment "test", "config.active_job.queue_adapter = :inline"
25
- end
26
-
27
- private
28
-
29
- def configure_application_file(config)
30
- inject_into_file(
31
- "config/application.rb",
32
- "\n #{config}",
33
- before: "\n end"
34
- )
35
- end
36
- end
37
- end
@@ -1,18 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class JsDriverGenerator < Generators::Base
5
- def add_gems
6
- gem "webdrivers", group: :test
7
- Bundler.with_unbundled_env { run "bundle install" }
8
- end
9
-
10
- def configure_capybara
11
- copy_file "chromedriver.rb", "spec/support/chromedriver.rb"
12
- copy_file(
13
- "capybara_silence_puma.rb",
14
- "spec/support/capybara_silence_puma.rb"
15
- )
16
- end
17
- end
18
- end
@@ -1,14 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class JsonGenerator < Generators::Base
5
- def add_oj
6
- gem "oj"
7
- Bundler.with_unbundled_env { run "bundle install" }
8
- end
9
-
10
- def configure_oj
11
- copy_file "oj.rb", "config/initializers/oj.rb"
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class LintGenerator < Generators::Base
5
- def set_up_hound
6
- copy_file "hound.yml", ".hound.yml"
7
- end
8
-
9
- def set_up_standard
10
- gem "standard", group: :development
11
- prepend_to_file("Rakefile", 'require "standard/rake"')
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- require_relative "../base"
2
-
3
- module Suspenders
4
- module Production
5
- class CompressionGenerator < Generators::Base
6
- def add_rack_deflater
7
- configure_environment(
8
- :production,
9
- %(config.middleware.use Rack::Deflater)
10
- )
11
- end
12
- end
13
- end
14
- end
@@ -1,16 +0,0 @@
1
- require_relative "../base"
2
-
3
- module Suspenders
4
- module Production
5
- class DeploymentGenerator < Generators::Base
6
- def copy_script
7
- copy_file "bin_deploy", "bin/deploy"
8
- chmod "bin/deploy", 0o755
9
- end
10
-
11
- def inform_user
12
- append_template_to_file "README.md", "partials/deployment_readme.md"
13
- end
14
- end
15
- end
16
- end
@@ -1,34 +0,0 @@
1
- require_relative "../base"
2
-
3
- module Suspenders
4
- module Production
5
- class EmailGenerator < Generators::Base
6
- def smtp_configuration
7
- copy_file "smtp.rb", "config/smtp.rb"
8
-
9
- prepend_file "config/environments/production.rb",
10
- %{require Rails.root.join("config/smtp")\n\n}
11
- end
12
-
13
- def use_smtp
14
- inject_template_into_file(
15
- "config/environments/production.rb",
16
- "partials/email_smtp.rb",
17
- after: "config.action_mailer.perform_caching = false\n"
18
- )
19
- end
20
-
21
- def env_vars
22
- expand_json(
23
- "app.json",
24
- env: {
25
- SMTP_ADDRESS: {required: true},
26
- SMTP_DOMAIN: {required: true},
27
- SMTP_PASSWORD: {required: true},
28
- SMTP_USERNAME: {required: true}
29
- }
30
- )
31
- end
32
- end
33
- end
34
- end
@@ -1,11 +0,0 @@
1
- require_relative "../base"
2
-
3
- module Suspenders
4
- module Production
5
- class ForceTlsGenerator < Generators::Base
6
- def config_enforce_ssl
7
- configure_environment "production", "config.force_ssl = true"
8
- end
9
- end
10
- end
11
- end
@@ -1,25 +0,0 @@
1
- require_relative "../base"
2
-
3
- module Suspenders
4
- module Production
5
- class ManifestGenerator < Generators::Base
6
- def render_manifest
7
- expand_json(
8
- "app.json",
9
- name: app_name.dasherize,
10
- scripts: {},
11
- env: {
12
- APPLICATION_HOST: {required: true},
13
- AUTO_MIGRATE_DB: {value: true},
14
- EMAIL_RECIPIENTS: {required: true},
15
- HEROKU_APP_NAME: {required: true},
16
- HEROKU_PARENT_APP_NAME: {required: true},
17
- RACK_ENV: {required: true},
18
- SECRET_KEY_BASE: {generator: "secret"}
19
- },
20
- addons: ["heroku-postgresql", "heroku-redis"]
21
- )
22
- end
23
- end
24
- end
25
- end
@@ -1,15 +0,0 @@
1
- require_relative "../base"
2
-
3
- module Suspenders
4
- module Production
5
- class SingleRedirect < Generators::Base
6
- def add_rack_canonical_host
7
- inject_into_file(
8
- "config/environments/production.rb",
9
- %{\n config.middleware.use Rack::CanonicalHost, ENV.fetch("APPLICATION_HOST")},
10
- before: "\nend"
11
- )
12
- end
13
- end
14
- end
15
- end
@@ -1,22 +0,0 @@
1
- require_relative "../base"
2
-
3
- module Suspenders
4
- module Production
5
- class TimeoutGenerator < Generators::Base
6
- def add_gem
7
- gem "rack-timeout", group: :production
8
- Bundler.with_unbundled_env { run "bundle install" }
9
- end
10
-
11
- def configure_rack_timeout
12
- append_file ".sample.env", rack_timeout_config
13
- end
14
-
15
- private
16
-
17
- def rack_timeout_config
18
- %(RACK_TIMEOUT_SERVICE_TIMEOUT=10)
19
- end
20
- end
21
- end
22
- end
@@ -1,35 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class ProfilerGenerator < Generators::Base
5
- def augment_default_env
6
- append_to_file ".sample.env", "RACK_MINI_PROFILER=0\n"
7
- rescue Errno::ENOENT
8
- create_file ".sample.env", "RACK_MINI_PROFILER=0\n"
9
- rescue Thor::Error => e
10
- if e.message.match?(/does not appear to exist/)
11
- create_file ".sample.env", "RACK_MINI_PROFILER=0\n"
12
- else
13
- raise
14
- end
15
- end
16
-
17
- def add_gem
18
- gem "rack-mini-profiler", require: false
19
- Bundler.with_unbundled_env { run "bundle install" }
20
- end
21
-
22
- def configure_rack_mini_profiler
23
- copy_file(
24
- "rack_mini_profiler.rb",
25
- "config/initializers/rack_mini_profiler.rb",
26
- force: false,
27
- skip: true
28
- )
29
- end
30
-
31
- def update_readme
32
- append_template_to_file "README.md", "partials/profiler_readme.md"
33
- end
34
- end
35
- end
@@ -1,48 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class RunnerGenerator < Generators::Base
5
- def procfile
6
- copy_file "Procfile", "Procfile"
7
- end
8
-
9
- def sample_env
10
- copy_file "sample_env", ".sample.env"
11
- end
12
-
13
- def copy_sample_env
14
- if bin_setup_is_ruby?
15
- inject_template_into_file(
16
- "bin/setup",
17
- "partials/runner_setup.rb",
18
- before: %( puts "\\n== Preparing database ==")
19
- )
20
- elsif bin_setup_mentions_ci?
21
- inject_into_file(
22
- "bin/setup",
23
- %( cp -i .sample.env .env\n),
24
- after: %(if [ -z "$CI" ]; then\n)
25
- )
26
- else
27
- append_to_file(
28
- "bin/setup",
29
- %(\nif [ -z "$CI" ]; then\n cp -i .sample.env .env\nfi)
30
- )
31
- end
32
- end
33
-
34
- def update_readme
35
- append_template_to_file "README.md", "partials/runner_readme.md"
36
- end
37
-
38
- private
39
-
40
- def bin_setup_is_ruby?
41
- File.read("bin/setup", 20).match?(%r{#!/usr/bin/env ruby})
42
- end
43
-
44
- def bin_setup_mentions_ci?
45
- File.read("bin/setup").match?(/if \[ -z "\$CI" \]/)
46
- end
47
- end
48
- end
@@ -1,25 +0,0 @@
1
- require_relative "../base"
2
-
3
- module Suspenders
4
- module Staging
5
- class PullRequestsGenerator < Generators::Base
6
- def configure_heroku_staging_pr_pipeline_host
7
- inject_template_into_file(
8
- "config/environments/production.rb",
9
- "partials/pull_requests_config.rb",
10
- after: "Rails.application.configure do\n"
11
- )
12
- end
13
-
14
- def create_review_apps_setup_script
15
- template(
16
- "bin_setup_review_app.erb",
17
- "bin/setup_review_app",
18
- force: true
19
- )
20
-
21
- run "chmod a+x bin/setup_review_app"
22
- end
23
- end
24
- end
25
- end
@@ -1,14 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class StaticGenerator < Generators::Base
5
- def add_high_voltage
6
- gem "high_voltage"
7
- Bundler.with_unbundled_env { run "bundle install" }
8
- end
9
-
10
- def make_placeholder_directory
11
- empty_directory_with_keep_file "app/views/pages"
12
- end
13
- end
14
- end
@@ -1,71 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class StylelintGenerator < Generators::Base
5
- def setup_hound
6
- action InvokeGenerator.new(self, "suspenders:lint")
7
- action ToggleComments.new(self, ".hound.yml", /stylelintrc/)
8
- end
9
-
10
- def install_stylelint
11
- dependencies = ["stylelint", "@thoughtbot/stylelint-config"]
12
- action YarnInstall.new(self, dependencies, "--dev")
13
- end
14
-
15
- def copy_stylelint_config
16
- copy_file "stylelintrc.json", ".stylelintrc.json"
17
- end
18
-
19
- class InvokeGenerator
20
- def initialize(base, generator)
21
- @base = base
22
- @generator = generator
23
- end
24
-
25
- def invoke!
26
- @base.invoke @generator
27
- end
28
-
29
- def revoke!
30
- end
31
- end
32
-
33
- class ToggleComments
34
- def initialize(base, filename, pattern)
35
- @base = base
36
- @filename = filename
37
- @pattern = pattern
38
- end
39
-
40
- def invoke!
41
- @base.uncomment_lines(@filename, @pattern)
42
- end
43
-
44
- def revoke!
45
- @base.behavior = :invoke
46
- @base.comment_lines(@filename, @pattern)
47
- ensure
48
- @base.behavior = :revoke
49
- end
50
- end
51
-
52
- class YarnInstall
53
- def initialize(base, dependencies, flags)
54
- @base = base
55
- @dependencies = dependencies.join(" ")
56
- @flags = flags
57
- end
58
-
59
- def invoke!
60
- @base.run "bin/yarn add #{@dependencies} #{@flags}"
61
- end
62
-
63
- def revoke!
64
- @base.behavior = :invoke
65
- @base.run "bin/yarn remove #{@dependencies}"
66
- ensure
67
- @base.behavior = :revoke
68
- end
69
- end
70
- end
71
- end
@@ -1,15 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class StylesheetBaseGenerator < Generators::Base
5
- def setup_normalize
6
- run "yarn add postcss-normalize"
7
- copy_file(
8
- "application.postcss.css",
9
- "app/assets/stylesheets/application.postcss.css",
10
- force: true
11
- )
12
- copy_file "postcss.config.js", "postcss.config.js", force: true
13
- end
14
- end
15
- end
@@ -1,43 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class TestingGenerator < Generators::Base
5
- def add_testing_gems
6
- gem "rspec-rails", "~> 5.1", group: %i[development test]
7
- gem "shoulda-matchers", group: :test
8
-
9
- Bundler.with_unbundled_env { run "bundle install" }
10
- end
11
-
12
- def generate_rspec
13
- generate "rspec:install"
14
- end
15
-
16
- def configure_rspec
17
- remove_file "spec/rails_helper.rb"
18
- remove_file "spec/spec_helper.rb"
19
- copy_file "rails_helper.rb", "spec/rails_helper.rb"
20
- copy_file "spec_helper.rb", "spec/spec_helper.rb"
21
- end
22
-
23
- def provide_shoulda_matchers_config
24
- copy_file(
25
- "shoulda_matchers_config_rspec.rb",
26
- "spec/support/shoulda_matchers.rb"
27
- )
28
- end
29
-
30
- def configure_system_tests
31
- empty_directory_with_keep_file "spec/system"
32
- empty_directory_with_keep_file "spec/support/system"
33
- end
34
-
35
- def configure_i18n_for_test_environment
36
- copy_file "i18n.rb", "spec/support/i18n.rb"
37
- end
38
-
39
- def configure_action_mailer_in_specs
40
- copy_file "action_mailer.rb", "spec/support/action_mailer.rb"
41
- end
42
- end
43
- end
@@ -1,25 +0,0 @@
1
- require_relative "base"
2
-
3
- module Suspenders
4
- class ViewsGenerator < Generators::Base
5
- def create_partials_directory
6
- empty_directory "app/views/application"
7
- end
8
-
9
- def create_shared_flashes
10
- copy_file "_flashes.html.erb", "app/views/application/_flashes.html.erb"
11
- copy_file "flashes_helper.rb", "app/helpers/flashes_helper.rb"
12
- end
13
-
14
- def create_shared_css_overrides
15
- copy_file "_css_overrides.html.erb",
16
- "app/views/application/_css_overrides.html.erb"
17
- end
18
-
19
- def create_application_layout
20
- template "suspenders_layout.html.erb.erb",
21
- "app/views/layouts/application.html.erb",
22
- force: true
23
- end
24
- end
25
- end
@@ -1,49 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) do |repo_name|
4
- repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
5
- "https://github.com/#{repo_name}.git"
6
- end
7
-
8
- ruby "<%= Suspenders::RUBY_VERSION %>"
9
-
10
- <% if options[:api] %>
11
- gem "sprockets", "< 4"
12
- <% end %>
13
-
14
- gem "bootsnap", require: false
15
- gem "cssbundling-rails"
16
- gem "honeybadger"
17
- gem "jsbundling-rails"
18
- gem "pg"
19
- gem "puma"
20
- gem "rack-canonical-host"
21
- gem "rails", "<%= Suspenders::RAILS_VERSION %>"
22
- gem "recipient_interceptor"
23
- gem "sassc-rails"
24
- gem "skylight"
25
- gem "sprockets-rails"
26
- gem "stimulus-rails"
27
- gem "title"
28
- gem "turbo-rails"
29
- gem "tzinfo-data", platforms: [:mingw, :x64_mingw, :mswin, :jruby]
30
-
31
- group :development do
32
- gem "listen"
33
- gem "web-console"
34
- end
35
-
36
- group :development, :test do
37
- gem "awesome_print"
38
- gem "pry-byebug"
39
- gem "pry-rails"
40
- end
41
-
42
- group :test do
43
- gem "formulaic"
44
- gem "launchy"
45
- gem "timecop"
46
- gem "webmock"
47
- end
48
-
49
- gem "suspenders", group: [:development, :test]
data/templates/Procfile DELETED
@@ -1,2 +0,0 @@
1
- web: bundle exec puma -p $PORT -C ./config/puma.rb
2
- worker: bundle exec sidekiq
@@ -1,28 +0,0 @@
1
- # <%= app_name.humanize %>
2
-
3
- ## Getting Started
4
-
5
- After you have cloned this repo, run this setup script to set up your machine
6
- with the necessary dependencies to run and test this app:
7
-
8
- % ./bin/setup
9
-
10
- It assumes you have a machine equipped with Ruby, Postgres, etc. If not, set up
11
- your machine with [this script].
12
-
13
- [this script]: https://github.com/thoughtbot/laptop
14
-
15
- After setting up, you can run the application using [Heroku Local]:
16
-
17
- % heroku local
18
-
19
- [Heroku Local]: https://devcenter.heroku.com/articles/heroku-local
20
-
21
- ## Guidelines
22
-
23
- Use the following guides for getting things done, programming well, and
24
- programming in style.
25
-
26
- * [Protocol](http://github.com/thoughtbot/guides/blob/master/protocol)
27
- * [Best Practices](http://github.com/thoughtbot/guides/blob/master/best-practices)
28
- * [Style](http://github.com/thoughtbot/guides/blob/master/style)
@@ -1,8 +0,0 @@
1
- <% if ENV["SEGMENT_KEY"] %>
2
- <script type="text/javascript">
3
- !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="4.0.0";
4
- analytics.load("<%= ENV["SEGMENT_KEY"] %>");
5
- analytics.page();
6
- }}();
7
- </script>
8
- <% end %>
@@ -1,7 +0,0 @@
1
- <% if Rails.env.test? %>
2
- <style type="text/css">
3
- * {
4
- transition-property: none !important;
5
- }
6
- </style>
7
- <% end %>
@@ -1,7 +0,0 @@
1
- <% if flash.any? %>
2
- <div class="flashes">
3
- <% user_facing_flashes.each do |key, value| -%>
4
- <div class="flash-<%= key %>"><%= value %></div>
5
- <% end -%>
6
- </div>
7
- <% end %>