Fix Rubocop offenses
This commit is contained in:
2
Vagrantfile
vendored
2
Vagrantfile
vendored
@ -10,7 +10,7 @@ Vagrant.configure(2) do |config|
|
|||||||
v.cpus = 4
|
v.cpus = 4
|
||||||
end
|
end
|
||||||
config.vm.network 'forwarded_port',
|
config.vm.network 'forwarded_port',
|
||||||
host_ip: ENV['LISTEN_ADDRESS'] || '127.0.0.1',
|
host_ip: ENV.fetch('LISTEN_ADDRESS', '127.0.0.1'),
|
||||||
host: 7000,
|
host: 7000,
|
||||||
guest: 7000
|
guest: 7000
|
||||||
config.vm.synced_folder '.', '/home/vagrant/codeocean'
|
config.vm.synced_folder '.', '/home/vagrant/codeocean'
|
||||||
|
@ -76,7 +76,7 @@ Rails.application.configure do
|
|||||||
# Raises helpful error messages.
|
# Raises helpful error messages.
|
||||||
config.assets.raise_runtime_errors = true
|
config.assets.raise_runtime_errors = true
|
||||||
|
|
||||||
BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP']
|
BetterErrors::Middleware.allow_ip! ENV.fetch('TRUSTED_IP', nil) if ENV['TRUSTED_IP']
|
||||||
|
|
||||||
# Use an evented file watcher to asynchronously detect changes in source code,
|
# Use an evented file watcher to asynchronously detect changes in source code,
|
||||||
# routes, locales, etc. This feature depends on the listen gem.
|
# routes, locales, etc. This feature depends on the listen gem.
|
||||||
|
@ -6,7 +6,7 @@ class SentryJavascript
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.dsn
|
def self.dsn
|
||||||
ENV['SENTRY_JAVASCRIPT_DSN']
|
ENV.fetch('SENTRY_JAVASCRIPT_DSN', nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.release
|
def self.release
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
# Learn more: http://github.com/javan/whenever
|
# Learn more: http://github.com/javan/whenever
|
||||||
|
|
||||||
set :output, "#{Whenever.path}/log/whenever/whenever_$(date +%Y%m%d%H%M%S).log"
|
set :output, "#{Whenever.path}/log/whenever/whenever_$(date +%Y%m%d%H%M%S).log"
|
||||||
set :environment, ENV['RAILS_ENV'] if ENV['RAILS_ENV']
|
set :environment, ENV.fetch('RAILS_ENV', nil) if ENV['RAILS_ENV']
|
||||||
|
|
||||||
every 1.day, at: '3:00 am' do
|
every 1.day, at: '3:00 am' do
|
||||||
rake 'detect_exercise_anomalies:with_at_least[10,50]'
|
rake 'detect_exercise_anomalies:with_at_least[10,50]'
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
require 'capybara/rspec'
|
require 'capybara/rspec'
|
||||||
require 'selenium/webdriver'
|
require 'selenium/webdriver'
|
||||||
|
|
||||||
if ENV['HEADLESS_TEST'] == 'true' || ENV['USER'] == 'vagrant'
|
if ENV.fetch('HEADLESS_TEST', nil) == 'true' || ENV.fetch('USER', nil) == 'vagrant'
|
||||||
require 'headless'
|
require 'headless'
|
||||||
|
|
||||||
headless = Headless.new
|
headless = Headless.new
|
||||||
@ -14,7 +14,7 @@ Capybara.register_driver :selenium do |app|
|
|||||||
profile = Selenium::WebDriver::Firefox::Profile.new
|
profile = Selenium::WebDriver::Firefox::Profile.new
|
||||||
profile['intl.accept_languages'] = 'en'
|
profile['intl.accept_languages'] = 'en'
|
||||||
options = Selenium::WebDriver::Firefox::Options.new
|
options = Selenium::WebDriver::Firefox::Options.new
|
||||||
options.headless! if ENV['CI'] == 'true'
|
options.headless! if ENV.fetch('CI', nil) == 'true'
|
||||||
options.profile = profile
|
options.profile = profile
|
||||||
driver = Capybara::Selenium::Driver.new(app, browser: :firefox, capabilities: options)
|
driver = Capybara::Selenium::Driver.new(app, browser: :firefox, capabilities: options)
|
||||||
driver.browser.manage.window.resize_to(1280, 960)
|
driver.browser.manage.window.resize_to(1280, 960)
|
||||||
|
Reference in New Issue
Block a user