Class: RegoValidate::SourceLoader
- Inherits:
-
Object
- Object
- RegoValidate::SourceLoader
- Defined in:
- lib/ruby/rego/cli.rb
Overview
Loads policy and config sources based on CLI options.
Instance Method Summary collapse
-
#initialize(options:, reporter:, parser:) ⇒ SourceLoader
constructor
A new instance of SourceLoader.
-
#load ⇒ Array<(String, ConfigLoadResult)>
Constructor Details
#initialize(options:, reporter:, parser:) ⇒ SourceLoader
Returns a new instance of SourceLoader.
435 436 437 438 |
# File 'lib/ruby/rego/cli.rb', line 435 def initialize(options:, reporter:, parser:) @options = @loader = ConfigLoader.new(reporter: reporter, parser: parser, yaml_aliases: .yaml_aliases) end |
Instance Method Details
#load ⇒ Array<(String, ConfigLoadResult)>
441 442 443 444 445 446 |
# File 'lib/ruby/rego/cli.rb', line 441 def load policy_source = load_policy_source return [nil, ConfigLoadResult.new(success: false)] unless policy_source [policy_source, load_config] end |