DEV: flag MRI specific gems

byebug, ruby-prof, better_errors and rbtrace are very MRI specific, flag
them as such

This helps move forward on potential jruby and truffleruby experiments
This commit is contained in:
Sam Saffron 2020-02-18 11:03:57 +11:00
parent ca9a5b8458
commit 59a7afbde9
No known key found for this signature in database
GPG Key ID: B9606168D2FFD9F5
2 changed files with 12 additions and 8 deletions

View File

@ -178,16 +178,16 @@ group :test, :development do
gem 'shoulda-matchers', require: false gem 'shoulda-matchers', require: false
gem 'rspec-html-matchers' gem 'rspec-html-matchers'
gem 'pry-nav' gem 'pry-nav'
gem 'byebug', require: ENV['RM_INFO'].nil? gem 'byebug', require: ENV['RM_INFO'].nil?, platform: :mri
gem 'rubocop', require: false gem 'rubocop', require: false
gem "rubocop-discourse", require: false gem "rubocop-discourse", require: false
gem 'parallel_tests' gem 'parallel_tests'
end end
group :development do group :development do
gem 'ruby-prof', require: false gem 'ruby-prof', require: false, platform: :mri
gem 'bullet', require: !!ENV['BULLET'] gem 'bullet', require: !!ENV['BULLET']
gem 'better_errors' gem 'better_errors', platform: :mri
gem 'binding_of_caller' gem 'binding_of_caller'
gem 'yaml-lint' gem 'yaml-lint'
gem 'annotate' gem 'annotate'

View File

@ -39,11 +39,13 @@ Discourse::Application.configure do
config.log_level = ENV['DISCOURSE_DEV_LOG_LEVEL'] if ENV['DISCOURSE_DEV_LOG_LEVEL'] config.log_level = ENV['DISCOURSE_DEV_LOG_LEVEL'] if ENV['DISCOURSE_DEV_LOG_LEVEL']
BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP'] if defined?(BetterErrors)
BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP']
if defined?(Unicorn) && ENV["UNICORN_WORKERS"].to_i != 1 if defined?(Unicorn) && ENV["UNICORN_WORKERS"].to_i != 1
# BetterErrors doesn't work with multiple unicorn workers. Disable it to avoid confusion # BetterErrors doesn't work with multiple unicorn workers. Disable it to avoid confusion
Rails.configuration.middleware.delete BetterErrors::Middleware Rails.configuration.middleware.delete BetterErrors::Middleware
end
end end
config.load_mini_profiler = true config.load_mini_profiler = true
@ -57,7 +59,9 @@ Discourse::Application.configure do
config.middleware.insert 1, Middleware::MissingAvatars config.middleware.insert 1, Middleware::MissingAvatars
config.enable_anon_caching = false config.enable_anon_caching = false
require 'rbtrace' if RUBY_ENGINE == "ruby"
require 'rbtrace'
end
if emails = GlobalSetting.developer_emails if emails = GlobalSetting.developer_emails
config.developer_emails = emails.split(",").map(&:downcase).map(&:strip) config.developer_emails = emails.split(",").map(&:downcase).map(&:strip)