mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-20 03:25:17 +01:00
Use abort
instead of warn(); exit
in boot.rb env check (#29209)
This commit is contained in:
parent
1946e171e6
commit
1d9d14b8de
@ -96,12 +96,6 @@ Rails/FilePath:
|
|||||||
Rails/HttpStatus:
|
Rails/HttpStatus:
|
||||||
EnforcedStyle: numeric
|
EnforcedStyle: numeric
|
||||||
|
|
||||||
# Reason: Allowed in boot ENV checker
|
|
||||||
# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsexit
|
|
||||||
Rails/Exit:
|
|
||||||
Exclude:
|
|
||||||
- 'config/boot.rb'
|
|
||||||
|
|
||||||
# Reason: Conflicts with `Lint/UselessMethodDefinition` for inherited controller actions
|
# Reason: Conflicts with `Lint/UselessMethodDefinition` for inherited controller actions
|
||||||
# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railslexicallyscopedactionfilter
|
# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railslexicallyscopedactionfilter
|
||||||
Rails/LexicallyScopedActionFilter:
|
Rails/LexicallyScopedActionFilter:
|
||||||
|
@ -1,8 +1,15 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
unless ENV.key?('RAILS_ENV')
|
unless ENV.key?('RAILS_ENV')
|
||||||
warn 'ERROR: Missing RAILS_ENV environment variable, please set it to "production", "development", or "test".'
|
abort <<~ERROR
|
||||||
exit 1
|
The RAILS_ENV environment variable is not set.
|
||||||
|
|
||||||
|
Please set it correctly depending on context:
|
||||||
|
|
||||||
|
- Use "production" for a live deployment of the application
|
||||||
|
- Use "development" for local feature work
|
||||||
|
- Use "test" when running the automated spec suite
|
||||||
|
ERROR
|
||||||
end
|
end
|
||||||
|
|
||||||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
||||||
|
Loading…
Reference in New Issue
Block a user