gemstack-cli 0.2.0 → 0.2.1

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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/lib/gemstack/cli/add_generator.rb +2 -0
  4. data/lib/gemstack/cli/app_generator.rb +3 -1
  5. data/lib/gemstack/cli/deploy_generator.rb +1 -2
  6. data/lib/gemstack/cli/doctor.rb +1 -1
  7. data/lib/gemstack/cli/generator.rb +22 -0
  8. data/lib/gemstack/cli/job_generator.rb +1 -0
  9. data/lib/gemstack/cli/resource_generator.rb +1 -0
  10. data/templates/app/Gemfile.tt +2 -0
  11. data/templates/app/app/jobs/application_job.rb +9 -0
  12. data/templates/app/app/mailers/application_mailer.rb +8 -0
  13. data/templates/app/app/mailers/templates/dot_keep +0 -0
  14. data/templates/app/app/models/application_model.rb +19 -0
  15. data/templates/app/app/serializers/application_serializer.rb +6 -0
  16. data/templates/app/config/environments/development.rb.tt +35 -0
  17. data/templates/app/config/environments/production.rb.tt +40 -0
  18. data/templates/app/config/environments/test.rb.tt +21 -0
  19. data/templates/auth/app/mailers/auth_mailer.rb +1 -1
  20. data/templates/auth/app/models/auth_token.rb +1 -1
  21. data/templates/auth/app/models/user.rb +1 -1
  22. data/templates/auth/app/serializers/api_token_serializer.rb +1 -1
  23. data/templates/auth/app/serializers/new_api_token_serializer.rb +1 -1
  24. data/templates/auth/app/serializers/user_serializer.rb +1 -1
  25. data/templates/job/app/jobs/%file_name%.rb.tt +1 -1
  26. data/templates/resource/model/app/models/%file_name%.rb.tt +1 -1
  27. data/templates/resource/serializer/app/serializers/%file_name%_serializer.rb.tt +1 -1
  28. data/templates/storage/app/serializers/upload_serializer.rb +1 -1
  29. metadata +13 -8
  30. data/templates/app/config/environments/development.rb +0 -6
  31. data/templates/app/config/environments/production.rb +0 -8
  32. data/templates/app/config/environments/test.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 302c6d867a26dcdbf305cc2c4d54479bc3b5094b30dc7c79873882b5d6062598
4
- data.tar.gz: f09ed00f2ac675747ab91c808a682b75c71be04193defc59755e7798c0dbfc49
3
+ metadata.gz: 9d9243d3986f9d45d5aa9de84f699ea7fcac37504ed266d7998e5a4eab6ff484
4
+ data.tar.gz: 6cf9300583fb65e103c7b71b48859721863766837180a362365639ec0186c5fc
5
5
  SHA512:
6
- metadata.gz: 94dddfd035b6782455385e61a8306bcb46526e5979c43f43b4604cb133593713b0166528df8345ab6850f288c7f6118e75381a91c5729c9dcba2977e12819d81
7
- data.tar.gz: cae54dd8b24e7ce6ba106570d858476992c6b11634e717e9ef2b79b1ac1d853ea3292bd32b96994a65e98cc22320bbc860d55d781843c289320cccc6902deaaa
6
+ metadata.gz: 54009542d20d3bcc5ae67e2b89e19965c285e32b6400ca43e7ecf22af1f2bc3a8303803c2c1708cc967f5c50fed4c159e7807e5f41bdb9da702c87f9cc4e8229
7
+ data.tar.gz: 0acb8e759970a5154f11fae58d530c960575849ec4f93018f46b9a8ef70f1d43cfac289c0606ae16508efd16f843ade368b0fa49777e15caacdb42e42e9db22a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1
4
+
5
+ See the [GemStack changelog](https://github.com/gemstack-rb/gemstack/blob/main/CHANGELOG.md).
6
+
3
7
  ## 0.2.0
4
8
 
5
9
  See the [GemStack changelog](https://github.com/gemstack-rb/gemstack/blob/main/CHANGELOG.md).
@@ -70,6 +70,7 @@ module GemStack
70
70
 
71
71
  def add_storage
72
72
  add_gem("gemstack-storage")
73
+ ensure_base_classes(@root, :serializer)
73
74
  copy_feature_templates("storage")
74
75
  add_routes(%(post "/uploads", to: "uploads#create" # direct uploads (gemstack add storage)\n),
75
76
  marker: "uploads#create")
@@ -94,6 +95,7 @@ module GemStack
94
95
  add_gem("gemstack-mail")
95
96
  add_gem("gemstack-auth")
96
97
  JobGenerator.install_migration(@root, output: @output) # emails are sent from background jobs
98
+ ensure_base_classes(@root, :model, :serializer, :mailer)
97
99
  copy_feature_templates("auth", skip_migration: "*_create_auth_tables.rb")
98
100
  include_in_application_controller("GemStack::Auth::Controller")
99
101
  add_routes(AUTH_ROUTES, marker: "/auth/login")
@@ -54,7 +54,7 @@ module GemStack
54
54
  database_adapter if database? # fail early on an unknown --database
55
55
  @output.puts("Creating GemStack application #{name} in #{destination}")
56
56
  render_directory("app", destination, skip: lambda { |rel|
57
- !database? && (rel.start_with?("db/") || rel == "config/database.yml.tt")
57
+ !database? && (rel.start_with?("db/", "app/models/") || rel == "config/database.yml.tt")
58
58
  })
59
59
  render_directory("frontend", File.join(destination, "frontend")) if frontend?
60
60
  install unless @options[:skip_install]
@@ -86,6 +86,8 @@ module GemStack
86
86
 
87
87
  run_step("npm install", File.join(destination, "frontend"), "npm", "install", "--no-fund",
88
88
  "--no-audit")
89
+ # The TypeScript contract, so frontend/lib/api/generated exists from the start.
90
+ run_step("gemstack contract", destination, "bin/gemstack", "contract", "--quiet") if bundled
89
91
  end
90
92
 
91
93
  # Best effort: a missing or password-protected database server shouldn't fail `new`.
@@ -18,8 +18,7 @@ module GemStack
18
18
  def jobs?
19
19
  return true if gemfile.match?(/^\s*gem "gemstack-auth"/)
20
20
 
21
- gemfile.match?(/^\s*gem "gemstack-jobs"/) &&
22
- %w[app/jobs/*.rb app/mailers/*.rb].any? { |glob| !Dir.glob(File.join(@root, glob)).empty? }
21
+ gemfile.match?(/^\s*gem "gemstack-jobs"/) && Generator.background_work?(@root)
23
22
  end
24
23
 
25
24
  def mail? = gemfile.match?(/^\s*gem "gemstack-(mail|auth)"/)
@@ -290,7 +290,7 @@ module GemStack
290
290
  end
291
291
 
292
292
  def jobs_used?
293
- %w[app/jobs/*.rb app/mailers/*.rb].any? { |glob| !Dir.glob(path(glob)).empty? }
293
+ Generator.background_work?(@root)
294
294
  end
295
295
 
296
296
  def location(error)
@@ -59,6 +59,28 @@ module GemStack
59
59
  end
60
60
 
61
61
  # Every template file for a generator, with app overrides applied.
62
+ # The app's base classes (written by `gemstack new` since 0.2.1). Apps
63
+ # created earlier get the ones a generator's code inherits from.
64
+ BASE_CLASSES = {
65
+ model: "app/models/application_model.rb", serializer: "app/serializers/application_serializer.rb",
66
+ job: "app/jobs/application_job.rb", mailer: "app/mailers/application_mailer.rb"
67
+ }.freeze
68
+
69
+ # Whether the app has jobs or mailers of its own (base classes don't count).
70
+ def self.background_work?(root)
71
+ %w[app/jobs/*.rb app/mailers/*.rb].any? do |glob|
72
+ Dir.glob(File.join(root, glob)).any? { |file| !File.basename(file).start_with?("application_") }
73
+ end
74
+ end
75
+
76
+ def ensure_base_classes(root, *kinds)
77
+ kinds.each do |kind|
78
+ rel = BASE_CLASSES.fetch(kind)
79
+ target = File.join(root, rel)
80
+ write(target, File.read(File.join(template_root("app"), rel))) unless File.exist?(target)
81
+ end
82
+ end
83
+
62
84
  def template_files(name, override_root: nil)
63
85
  files = relative_files(template_root(name)).to_h { |rel| [rel, File.join(template_root(name), rel)] }
64
86
  if override_root
@@ -35,6 +35,7 @@ module GemStack
35
35
  end
36
36
 
37
37
  def run
38
+ ensure_base_classes(@root, :job)
38
39
  template_files("job", override_root: @root).each do |rel, source|
39
40
  target = File.join(@root, rel.delete_suffix(".tt").gsub("%file_name%", file_name))
40
41
  write(target, render(File.read(source), source))
@@ -34,6 +34,7 @@ module GemStack
34
34
  end
35
35
 
36
36
  def run
37
+ ensure_base_classes(@root, *(%i[model serializer] & @parts))
37
38
  @parts.each { |part| render_part(part) }
38
39
  add_routes if @parts.include?(:controller)
39
40
  self
@@ -14,6 +14,7 @@ path "<%= gemstack_path %>" do
14
14
  gem "gemstack-db"
15
15
  <% end -%>
16
16
  gem "gemstack-jobs"
17
+ gem "gemstack-mail"
17
18
  gem "gemstack-dev"
18
19
  gem "gemstack-http"
19
20
  gem "gemstack-schema"
@@ -24,6 +25,7 @@ gem "gemstack", "~> <%= version %>"
24
25
  gem "gemstack-db", "~> <%= version %>"
25
26
  <% end -%>
26
27
  gem "gemstack-jobs", "~> <%= version %>"
28
+ gem "gemstack-mail", "~> <%= version %>"
27
29
  <% end -%>
28
30
  gem "puma", ">= 6.4"
29
31
  <% if database? -%>
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The base class for this app's background jobs (docs/background-jobs.md):
4
+ # retry and discard rules declared here apply to every job.
5
+ class ApplicationJob < GemStack::Job
6
+ # retry_on Net::ReadTimeout, attempts: 5, wait: 30 # seconds, :exponential or ->(attempt) { … }
7
+ # discard_on GemStack::NotFound # e.g. the record was deleted before the job ran
8
+ # queue :default
9
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The base class for this app's mailers (docs/mail.md). Templates live in
4
+ # app/mailers/templates/<mailer>/<action>.{text,html}.erb.
5
+ class ApplicationMailer < GemStack::Mailer
6
+ # default from: "My App <hello@example.com>" # otherwise config.mail.default_from (MAIL_FROM)
7
+ # default reply_to: "support@example.com"
8
+ end
File without changes
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The base class for this app's models — add plugins, validations and helpers
4
+ # every model should share here. `class Product < ApplicationModel` maps to the
5
+ # products table (docs/models.md).
6
+ #
7
+ # Created with Class.new on purpose: `class ApplicationModel < GemStack::Model`
8
+ # would make Sequel look for an "application_models" table.
9
+ ApplicationModel = Class.new(GemStack::Model) # rubocop:disable Style/EmptyClassDefinition
10
+
11
+ class ApplicationModel
12
+ # Sequel plugins for every model, e.g.:
13
+ # plugin :dirty # previous values after an update (column_changes)
14
+
15
+ # Shared query helpers:
16
+ # dataset_module do
17
+ # def recent = order(Sequel.desc(:created_at))
18
+ # end
19
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The base class for this app's serializers (docs/serialization.md): attributes
4
+ # and helpers defined here are shared by every serializer.
5
+ class ApplicationSerializer < GemStack::Serializer
6
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Development settings: applied after config/app.rb when GEMSTACK_ENV=development
4
+ # (the default). Each line shows the default value — uncomment one to change it.
5
+ # All settings: docs/configuration.md.
6
+ GemStack.configure do |config|
7
+ # ── Code ────────────────────────────────────────────────────────────────
8
+ # config.reload_code = true # reload app/ and config/routes.rb when they change
9
+ # config.eager_load = false # load app/ lazily, for a faster boot
10
+ # config.jit = nil # :yjit or :zjit to try Ruby's JIT locally
11
+
12
+ # ── Logging ─────────────────────────────────────────────────────────────
13
+ # config.logger.level = :debug # :debug, :info, :warn, :error (or GEMSTACK_LOG_LEVEL)
14
+ # config.logger.format = :pretty # readable lines; :json to see what production logs
15
+
16
+ # ── HTTP ────────────────────────────────────────────────────────────────
17
+ # config.http.show_exceptions = true # 500s carry the exception; browsers get an error page
18
+ # config.contract.docs = true # interactive API docs at /api/docs
19
+
20
+ # ── gemstack dev ────────────────────────────────────────────────────────
21
+ # config.dev.port = 3000 # the one public port (or PORT)
22
+ # config.dev.jobs_command = %w[bundle exec gemstack jobs] # nil: don't start a jobs worker
23
+ <% if database? -%>
24
+
25
+ # ── Database (connection: config/database.yml) ──────────────────────────
26
+ # config.db.log_queries = true # every SQL statement at DEBUG
27
+ # config.db.slow_query_ms = 500 # slower queries are logged at WARN
28
+ <% end -%>
29
+
30
+ # ── Cache ───────────────────────────────────────────────────────────────
31
+ # config.cache.store = :memory # :null to switch caching off, :redis to share it
32
+
33
+ # ── Mail ────────────────────────────────────────────────────────────────
34
+ # config.mail.delivery = :log # saved to tmp/mail (.eml + .html); :smtp really sends
35
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Production settings: applied after config/app.rb when GEMSTACK_ENV=production.
4
+ # Each line shows the default value — uncomment one to change it.
5
+ #
6
+ # Secrets and connections come from environment variables, never from files:
7
+ # SECRET_KEY_BASE, <% if database? %>DATABASE_URL, <% end %>SMTP_URL, MAIL_FROM, APP_URL, REDIS_URL…
8
+ # `gemstack doctor --production` checks what's missing (docs/deployment.md).
9
+ GemStack.configure do |config|
10
+ # ── Code ────────────────────────────────────────────────────────────────
11
+ # config.eager_load = true # load all code at boot (copy-on-write friendly with Puma workers)
12
+ # config.jit = :yjit # Ruby's JIT (or GEMSTACK_JIT=yjit|zjit|off)
13
+
14
+ # ── Logging ─────────────────────────────────────────────────────────────
15
+ # config.logger.level = :info
16
+ # config.logger.format = :json # one JSON object per line, with the request id
17
+
18
+ # ── HTTP ────────────────────────────────────────────────────────────────
19
+ # config.http.show_exceptions = false # never send exception details to clients
20
+ # config.http.hsts = "max-age=63072000; includeSubDomains" # on HTTPS requests; nil if your proxy sets it
21
+ # config.http.cors.origins = ["https://app.example.com"] # only if the frontend is on another domain
22
+ # config.http.max_body_size = 10 * 1024 * 1024 # larger requests get 413
23
+ <% if database? -%>
24
+
25
+ # ── Database ────────────────────────────────────────────────────────────
26
+ # config.db.pool_size = 5 # connections per process (GEMSTACK_MAX_THREADS)
27
+ # config.db.statement_timeout = 5_000 # ms; stop runaway queries (PostgreSQL, MySQL)
28
+ # config.db.slow_query_ms = 500 # slower queries are logged at WARN
29
+ <% end -%>
30
+
31
+ # ── Cache: :memory is per process — use Redis with several processes or servers ──
32
+ # config.cache.store = :redis # add gem "redis-client"; REDIS_URL
33
+
34
+ # ── Background jobs (`gemstack jobs`) ───────────────────────────────────
35
+ # config.jobs.concurrency = 5 # threads per worker (or GEMSTACK_JOB_CONCURRENCY)
36
+
37
+ # ── Mail ────────────────────────────────────────────────────────────────
38
+ # config.mail.delivery = :smtp # SMTP_URL=smtp://user:password@smtp.example.com:587
39
+ # config.mail.default_from = "App <hello@example.com>" # or MAIL_FROM
40
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Test settings: applied after config/app.rb when tests run (`gemstack test`).
4
+ # Each line shows the default value — uncomment one to change it.
5
+ GemStack.configure do |config|
6
+ # ── Logging ─────────────────────────────────────────────────────────────
7
+ # config.logger.level = :debug # logs are discarded in tests unless this (or GEMSTACK_LOG_LEVEL) is set
8
+
9
+ # ── HTTP ────────────────────────────────────────────────────────────────
10
+ # config.http.show_exceptions = true # a failing request's JSON includes the exception
11
+ <% if database? -%>
12
+
13
+ # ── Database (connection: the test section of config/database.yml, or TEST_DATABASE_URL) ──
14
+ # config.db.log_queries = false
15
+ <% end -%>
16
+
17
+ # ── Background work is recorded, not performed ──────────────────────────
18
+ # config.jobs.adapter = :test # assert_enqueued / perform_enqueued_jobs; :inline runs jobs at once
19
+ # config.mail.delivery = :test # assert_emails / last_email
20
+ # config.cache.store = :null # no caching, so tests can't leak into each other; :memory to test it
21
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Account emails. Templates: app/mailers/templates/auth_mailer/*.erb.
4
4
  # Links point at the Next.js pages (config.auth.app_url, APP_URL in production).
5
- class AuthMailer < GemStack::Mailer
5
+ class AuthMailer < ApplicationMailer
6
6
  def password_reset(user_id)
7
7
  @user = User[user_id] or return
8
8
  token, = GemStack::Auth::Tokens.issue(@user.id, purpose: "password_reset")
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # API tokens (and single-use reset/verification tokens) — see GemStack::Auth::Tokens.
4
- class AuthToken < GemStack::Model
4
+ class AuthToken < ApplicationModel
5
5
  field :purpose, :string, null: false
6
6
  field :name, :string, size: 100
7
7
  field :last_used_at, :datetime
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Accounts. GemStack::Auth::User adds password hashing (Argon2id), email
4
4
  # normalization, validations and User.authenticate_by(email:, password:).
5
- class User < GemStack::Model
5
+ class User < ApplicationModel
6
6
  include GemStack::Auth::User
7
7
 
8
8
  field :email, :string, null: false, size: 254
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class ApiTokenSerializer < GemStack::Serializer
3
+ class ApiTokenSerializer < ApplicationSerializer
4
4
  model AuthToken
5
5
  attributes :id, :name, :last_used_at, :expires_at, :created_at
6
6
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # The response to creating an API token: the only time the token itself is shown.
4
- class NewApiTokenSerializer < GemStack::Serializer
4
+ class NewApiTokenSerializer < ApplicationSerializer
5
5
  Result = Data.define(:token, :api_token)
6
6
 
7
7
  attribute :token, :string
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # What the API shows about the signed-in user. Never add password_digest.
4
- class UserSerializer < GemStack::Serializer
4
+ class UserSerializer < ApplicationSerializer
5
5
  attributes :id, :email, :email_verified_at, :created_at
6
6
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Enqueue with <%= class_name %>.perform_later(...) — arguments must be JSON values (pass ids, not records).
4
4
  # Runs in `gemstack jobs` (and in `gemstack dev`). Delivery is at-least-once: keep perform idempotent.
5
- class <%= class_name %> < GemStack::Job
5
+ class <%= class_name %> < ApplicationJob
6
6
  <% if queue_name -%>
7
7
  queue :<%= queue_name %>
8
8
  <% end -%>
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class <%= class_name %> < GemStack::Model
3
+ class <%= class_name %> < ApplicationModel
4
4
  <% fields.each do |field| -%>
5
5
  <%= model_field(field) %>
6
6
  <% end -%>
@@ -2,6 +2,6 @@
2
2
 
3
3
  # What the API returns for a <%= class_name %>. Only listed attributes are exposed;
4
4
  # their types (from <%= class_name %>'s fields) drive the generated TypeScript types.
5
- class <%= class_name %>Serializer < GemStack::Serializer
5
+ class <%= class_name %>Serializer < ApplicationSerializer
6
6
  attributes :id, <%= fields.map { |f| ":#{f.column}" }.join(", ") %>, :created_at, :updated_at
7
7
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Where and how the browser sends the file (see UploadsController).
4
- class UploadSerializer < GemStack::Serializer
4
+ class UploadSerializer < ApplicationSerializer
5
5
  Result = Data.define(:signed_id, :url, :http_method, :headers)
6
6
 
7
7
  attribute :signed_id, :string
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemstack-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shoaib Malik
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.2.0
18
+ version: 0.2.1
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.2.0
25
+ version: 0.2.1
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: gemstack-dev
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 0.2.0
32
+ version: 0.2.1
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 0.2.0
39
+ version: 0.2.1
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: thor
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -80,13 +80,18 @@ files:
80
80
  - templates/app/Gemfile.tt
81
81
  - templates/app/README.md.tt
82
82
  - templates/app/app/controllers/application_controller.rb
83
+ - templates/app/app/jobs/application_job.rb
84
+ - templates/app/app/mailers/application_mailer.rb
85
+ - templates/app/app/mailers/templates/dot_keep
86
+ - templates/app/app/models/application_model.rb
87
+ - templates/app/app/serializers/application_serializer.rb
83
88
  - templates/app/bin/gemstack
84
89
  - templates/app/config.ru
85
90
  - templates/app/config/app.rb.tt
86
91
  - templates/app/config/database.yml.tt
87
- - templates/app/config/environments/development.rb
88
- - templates/app/config/environments/production.rb
89
- - templates/app/config/environments/test.rb
92
+ - templates/app/config/environments/development.rb.tt
93
+ - templates/app/config/environments/production.rb.tt
94
+ - templates/app/config/environments/test.rb.tt
90
95
  - templates/app/config/puma.rb
91
96
  - templates/app/config/routes.rb
92
97
  - templates/app/db/migrations/dot_keep
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Development-only settings. config/app.rb applies to every environment.
4
- GemStack.configure do |config|
5
- # config.http.show_exceptions = true # exception details in 500 responses (default in development)
6
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Production-only settings. Defaults here: JSON logs, no exception details in
4
- # responses, eager loading, HSTS on HTTPS requests.
5
- GemStack.configure do |config|
6
- # config.logger.level = :info
7
- # config.http.cors.origins = ["https://app.example.com"] # only if the frontend is on another domain
8
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Test-only settings. config/app.rb applies to every environment.
4
- GemStack.configure do |config|
5
- # Logs are discarded in tests unless GEMSTACK_LOG_LEVEL is set, e.g.:
6
- # config.logger.level = :debug
7
- end