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) ⇒ Ruleset

Returns a new instance of Ruleset.



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

def initialize(path: RULESET_FILE_PATH)
  @path = path
end

Instance Method Details

#rules(force_fetch: false) ⇒ Object



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

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

  @rule_data ||= parse_ruleset
end