Skip to content

Commit

Permalink
Update rubocop rules
Browse files Browse the repository at this point in the history
  • Loading branch information
avsej committed Nov 12, 2024
1 parent 65137de commit 160fd14
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ end
desc "Compile binary extension"
task :compile do
require 'tempfile'
Dir.chdir(Dir.tmpdir) do
Dir.chdir(Dir.tmpdir) do # rubocop:disable ThreadSafety/DirChdir
sh "ruby '#{File.join(__dir__, 'ext', 'extconf.rb')}'"
end
end
Expand All @@ -52,9 +52,9 @@ end

desc "Encode git revision into 'ext/extconf.rb' template (dependency of 'build' task)"
task :render_git_revision do
library_revision = Dir.chdir(__dir__) { `git rev-parse HEAD`.strip }
core_revision = Dir.chdir(File.join(__dir__, 'ext', 'couchbase')) { `git rev-parse HEAD`.strip }
core_describe = Dir.chdir(File.join(__dir__, 'ext', 'couchbase')) do
library_revision = Dir.chdir(__dir__) { `git rev-parse HEAD`.strip } # rubocop:disable ThreadSafety/DirChdir
core_revision = Dir.chdir(File.join(__dir__, 'ext', 'couchbase')) { `git rev-parse HEAD`.strip } # rubocop:disable ThreadSafety/DirChdir
core_describe = Dir.chdir(File.join(__dir__, 'ext', 'couchbase')) do # rubocop:disable ThreadSafety/DirChdir
`git fetch --tags >/dev/null 2>&1`
`git describe --long --always HEAD`.strip
end
Expand Down
4 changes: 2 additions & 2 deletions bin/jenkins/repackage-extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def bundle(target_dir)
end

if first_gemspec
Dir.chdir(first_gemspec.full_gem_path) do
Dir.chdir(first_gemspec.full_gem_path) do # rubocop:disable ThreadSafety/DirChdir
File.write("lib/couchbase/libcouchbase.rb", <<-RUBY)
begin
require_relative "\#{RUBY_VERSION[/(\\d+\\.\\d+)/]}/libcouchbase"
Expand Down Expand Up @@ -101,7 +101,7 @@ def repackage(gemspec)
# build new gem
output_gem = nil

Dir.chdir gemspec.full_gem_path do
Dir.chdir gemspec.full_gem_path do # rubocop:disable ThreadSafety/DirChdir
output_gem = Gem::Package.build(gemspec, true)
end

Expand Down
6 changes: 3 additions & 3 deletions lib/couchbase/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def self.log_level

# Return logger associated with the library
def self.logger
@logger # rubocop:disable ThreadSafety/InstanceVariableInClassMethod
@logger # rubocop:disable ThreadSafety/ClassInstanceVariable
end

# Associate logger with the library
Expand All @@ -67,8 +67,8 @@ def self.logger
#
# @since 3.4.0
def self.set_logger(logger, adapter_class: nil, verbose: false, level: :info)
@logger = logger # rubocop:disable ThreadSafety/InstanceVariableInClassMethod
if @logger.nil? # rubocop:disable ThreadSafety/InstanceVariableInClassMethod
@logger = logger # rubocop:disable ThreadSafety/ClassInstanceVariable
if @logger.nil? # rubocop:disable ThreadSafety/ClassInstanceVariable
Backend.install_logger_shim(nil)
return
end
Expand Down

0 comments on commit 160fd14

Please sign in to comment.