Class: Threatinator::CLI::RunActionBuilder
Instance Attribute Summary
#config_hash, #extra_args
Instance Method Summary
collapse
#feed_registry
Constructor Details
#initialize(opts, args, config_class) ⇒ RunActionBuilder
Returns a new instance of RunActionBuilder.
9
10
11
12
|
# File 'lib/threatinator/cli/run_action_builder.rb', line 9
def initialize(opts, args, config_class)
super(opts, args)
@config_class = config_class
end
|
Instance Method Details
#config ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/threatinator/cli/run_action_builder.rb', line 18
def config
run_hash = config_hash["run"] || {}
run_hash['observers'] ||= []
if filename = run_hash['coverage_output']
observer = Threatinator::Actions::Run::CoverageObserver.new(filename)
run_hash['observers'] << observer
end
config = @config_class.new(run_hash)
if config.feed_provider.nil? && provider = .shift
config.feed_provider = provider
end
if config.feed_name.nil? && name = .shift
config.feed_name = name
end
config
end
|