Class: CatEngine::Engine
- Inherits:
-
Object
- Object
- CatEngine::Engine
- Extended by:
- Memoist
- Defined in:
- lib/cat_engine/engine.rb
Defined Under Namespace
Classes: EngineError
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
Instance Method Details
#process(id, history) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/cat_engine/engine.rb', line 15 def process id, history command = %(cd #{CatEngine.cat_path} && mono --debug #{CatEngine.cat_engine_executable_path} "#{id}" #{history} 2>&1) output = `#{command}`.chomp if $?.success? Nokogiri::XML.parse(output, nil, "utf-8") else raise EngineError.new(output) end end |
#valid_history?(id, history) ⇒ Boolean
26 27 28 29 30 31 |
# File 'lib/cat_engine/engine.rb', line 26 def valid_history? id, history process id, history true rescue EngineError => e false end |