summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-11-17 20:27:16 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-11-18 01:01:53 +0800
commit9ac0c76b78cd04b2505924f003dd720a0f155959 (patch)
tree67af1f0be0b9d6b5fc42b27c5afe5516e2c7574c /config
parent0af35d7e30e373b885bfddb30b14718d72d75ab0 (diff)
downloadgitlab-ce-9ac0c76b78cd04b2505924f003dd720a0f155959.tar.gz
Use StrongMemoize and enable/disable cops properly
Diffstat (limited to 'config')
-rw-r--r--config/initializers/fix_local_cache_middleware.rb3
-rw-r--r--config/initializers/rspec_profiling.rb5
-rw-r--r--config/initializers/rugged_use_gitlab_git_attributes.rb6
3 files changed, 7 insertions, 7 deletions
diff --git a/config/initializers/fix_local_cache_middleware.rb b/config/initializers/fix_local_cache_middleware.rb
index c9abe0c1255..1f043408b4e 100644
--- a/config/initializers/fix_local_cache_middleware.rb
+++ b/config/initializers/fix_local_cache_middleware.rb
@@ -4,10 +4,9 @@ module LocalCacheRegistryCleanupWithEnsure
LocalStore =
ActiveSupport::Cache::Strategy::LocalCache::LocalStore
- # rubocop:disable Cop/ModuleWithInstanceVariables
def call(env)
LocalCacheRegistry.set_cache_for(local_cache_key, LocalStore.new)
- response = @app.call(env)
+ response = @app.call(env) # rubocop:disable Cop/ModuleWithInstanceVariables
response[2] = ::Rack::BodyProxy.new(response[2]) do
LocalCacheRegistry.set_cache_for(local_cache_key, nil)
end
diff --git a/config/initializers/rspec_profiling.rb b/config/initializers/rspec_profiling.rb
index d6c75a611b9..c732e303f03 100644
--- a/config/initializers/rspec_profiling.rb
+++ b/config/initializers/rspec_profiling.rb
@@ -16,14 +16,13 @@ module RspecProfilingExt
end
module Run
- # rubocop:disable Cop/ModuleWithInstanceVariables
def example_finished(*args)
super
rescue => err
- return if @already_logged_example_finished_error
+ return if @already_logged_example_finished_error # rubocop:disable Cop/ModuleWithInstanceVariables
$stderr.puts "rspec_profiling couldn't collect an example: #{err}. Further warnings suppressed."
- @already_logged_example_finished_error = true
+ @already_logged_example_finished_error = true # rubocop:disable Cop/ModuleWithInstanceVariables
end
alias_method :example_passed, :example_finished
diff --git a/config/initializers/rugged_use_gitlab_git_attributes.rb b/config/initializers/rugged_use_gitlab_git_attributes.rb
index abfa2c354cd..1cfb3bcb4bd 100644
--- a/config/initializers/rugged_use_gitlab_git_attributes.rb
+++ b/config/initializers/rugged_use_gitlab_git_attributes.rb
@@ -14,10 +14,12 @@
module Rugged
class Repository
module UseGitlabGitAttributes
- # rubocop:disable Cop/ModuleWithInstanceVariables
def fetch_attributes(name, *)
+ attributes.attributes(name)
+ end
+
+ def attributes
@attributes ||= Gitlab::Git::Attributes.new(path)
- @attributes.attributes(name)
end
end