Class: Gitlab::SecretDetection::Core::Ruleset

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/secret_detection/core/ruleset.rb

Constant Summary collapse

RULESET_FILE_PATH =

file path where the secrets ruleset file is located

File.expand_path('gitleaks.toml', __dir__)

Instance Method Summary collapse

Constructor Details

#initialize(path: RULESET_FILE_PATH, logger: Logger.new($stdout)) ⇒ Ruleset

Returns a new instance of Ruleset.



13
14
15
16
# File 'lib/gitlab/secret_detection/core/ruleset.rb', line 13

def initialize(path: RULESET_FILE_PATH, logger: Logger.new($stdout))
  @path = path
  @logger = logger
end

Instance Method Details

#rules(force_fetch: false) ⇒ Object



18
19
20
21
22
# File 'lib/gitlab/secret_detection/core/ruleset.rb', line 18

def rules(force_fetch: false)
  return @rule_data unless @rule_data.nil? || force_fetch

  @rule_data = parse_ruleset
end