about summary refs log tree commit diff
path: root/config/initializers
diff options
context:
space:
mode:
authoraus-social <42644106+aus-social@users.noreply.github.com>2018-10-05 01:38:04 +1000
committerEugen Rochko <eugen@zeonfederated.com>2018-10-04 17:38:04 +0200
commit0a4739c7324a96cee148373ccc7b57b9c7097b42 (patch)
tree8c6681e31fdab9b090c7a33105171460e31d5217 /config/initializers
parenta46ab86adfc9e4ea182af9a555237f17071e194c (diff)
lint pass 2 (#8878)
* Code quality pass

* Typofix

* Update applications_controller_spec.rb

* Update applications_controller_spec.rb
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/http_client_proxy.rb2
-rw-r--r--config/initializers/omniauth.rb2
-rw-r--r--config/initializers/open_uri_redirection.rb2
-rw-r--r--config/initializers/rack_attack.rb2
-rw-r--r--config/initializers/sidekiq.rb2
5 files changed, 5 insertions, 5 deletions
diff --git a/config/initializers/http_client_proxy.rb b/config/initializers/http_client_proxy.rb
index e607aff3c..9d7b16e69 100644
--- a/config/initializers/http_client_proxy.rb
+++ b/config/initializers/http_client_proxy.rb
@@ -6,7 +6,7 @@ Rails.application.configure do
     raise "No proxy host" unless proxy.host
 
     host = proxy.host
-    host = host[1...-1] if host[0] == '[' #for IPv6 address
+    host = host[1...-1] if host[0] == '[' # for IPv6 address
     config.x.http_client_proxy[:proxy] = { proxy_address: host, proxy_port: proxy.port, proxy_username: proxy.user, proxy_password: proxy.password }.compact
   end
 
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb
index 21b58eb5b..254e751d4 100644
--- a/config/initializers/omniauth.rb
+++ b/config/initializers/omniauth.rb
@@ -3,7 +3,7 @@ Rails.application.config.middleware.use OmniAuth::Builder do
 end
 
 Devise.setup do |config|
-  # Devise omniauth strategies
+  # Devise omniauth strategies
   options = {}
   options[:redirect_at_sign_in] = ENV['OAUTH_REDIRECT_AT_SIGN_IN'] == 'true'
 
diff --git a/config/initializers/open_uri_redirection.rb b/config/initializers/open_uri_redirection.rb
index e24fdecab..ea2dcffea 100644
--- a/config/initializers/open_uri_redirection.rb
+++ b/config/initializers/open_uri_redirection.rb
@@ -1,7 +1,7 @@
 require 'open-uri'
 
 module OpenURI
-  def OpenURI.redirectable?(uri1, uri2) # :nodoc:
+  def self.redirectable?(uri1, uri2) # :nodoc:
     uri1.scheme.downcase == uri2.scheme.downcase ||
       (/\A(?:http|https|ftp)\z/i =~ uri1.scheme && /\A(?:http|https|ftp)\z/i =~ uri2.scheme)
   end
diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb
index 0ca0a7e7f..8756b8fbf 100644
--- a/config/initializers/rack_attack.rb
+++ b/config/initializers/rack_attack.rb
@@ -42,7 +42,7 @@ class Rack::Attack
   # (blocklist & throttles are skipped)
   Rack::Attack.safelist('allow from localhost') do |req|
     # Requests are allowed if the return value is truthy
-    '127.0.0.1' == req.ip || '::1' == req.ip
+    req.ip == '127.0.0.1' || req.ip == '::1'
   end
 
   throttle('throttle_authenticated_api', limit: 300, period: 5.minutes) do |req|
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index 05c804100..7f8a40d7b 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -19,4 +19,4 @@ Sidekiq.configure_client do |config|
   config.redis = redis_params
 end
 
-Sidekiq::Logging.logger.level = ::Logger::const_get(ENV.fetch('RAILS_LOG_LEVEL', 'info').upcase.to_s)
+Sidekiq::Logging.logger.level = ::Logger.const_get(ENV.fetch('RAILS_LOG_LEVEL', 'info').upcase.to_s)