1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

code cleanup: rubocop: fix Lint/IneffectiveAccessModifier in lib/redmine/scm/adapters/abstract_adapter.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@18777 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2019-10-19 13:33:10 +00:00
parent cb2d4068e8
commit 7738078717
2 changed files with 31 additions and 29 deletions

View File

@ -395,7 +395,6 @@ Lint/IneffectiveAccessModifier:
- 'app/models/mail_handler.rb'
- 'app/models/mailer.rb'
- 'app/models/user.rb'
- 'lib/redmine/scm/adapters/abstract_adapter.rb'
Lint/InterpolationCheck:
Exclude:

View File

@ -203,10 +203,6 @@ module Redmine
self.class.shellout(cmd, options, &block)
end
def self.logger
Rails.logger
end
# Path to the file where scm stderr output is logged
# Returns nil if the log file is not writable
def self.stderr_log_file
@ -234,7 +230,13 @@ module Redmine
end
private_class_method :stderr_log_file
def self.shellout(cmd, options = {}, &block)
# Singleton class method is public
class << self
def logger
Rails.logger
end
def shellout(cmd, options = {}, &block)
if logger && logger.debug?
logger.debug "Shelling out: #{strip_credential(cmd)}"
# Capture stderr in a log file
@ -262,6 +264,7 @@ module Redmine
raise CommandFailed.new(msg)
end
end
end
# Hides username/password in a given command
def self.strip_credential(cmd)