Class: CC::Analyzer::Engine
- Inherits:
-
Object
- Object
- CC::Analyzer::Engine
- Defined in:
- lib/cc/analyzer/engine.rb
Overview
Constant Summary collapse
- Error =
Class.new(StandardError)
Instance Method Summary collapse
-
#initialize(name, metadata, config, label) ⇒ Engine
constructor
A new instance of Engine.
- #run(io) ⇒ Object
Constructor Details
#initialize(name, metadata, config, label) ⇒ Engine
Returns a new instance of Engine.
23 24 25 26 27 28 29 |
# File 'lib/cc/analyzer/engine.rb', line 23 def initialize(name, , config, label) @name = name @metadata = @config = config @label = label.to_s @error = nil end |
Instance Method Details
#run(io) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/cc/analyzer/engine.rb', line 31 def run(io) write_config_file container = Container.new( image: .fetch("image"), command: ["command"], name: container_name, ) container.on_output("\0") do |output| handle_output(container, io, output) end container.run().tap do |result| result.merge_from_exception(error) if error.present? end ensure delete_config_file end |