Class: Grover::Processor
Overview
Processor helper class for calling out to Puppeteer NodeJS library
Heavily based on the Schmooze library github.com/Shopify/schmooze
Instance Attribute Summary collapse
-
#debug_output ⇒ Object
readonly
Returns the value of attribute debug_output.
Instance Method Summary collapse
- #convert(method, url_or_html, options) ⇒ Object
-
#initialize(app_root) ⇒ Processor
constructor
A new instance of Processor.
Constructor Details
#initialize(app_root) ⇒ Processor
13 14 15 |
# File 'lib/grover/processor.rb', line 13 def initialize(app_root) @app_root = app_root end |
Instance Attribute Details
#debug_output ⇒ Object (readonly)
Returns the value of attribute debug_output.
29 30 31 |
# File 'lib/grover/processor.rb', line 29 def debug_output @debug_output end |
Instance Method Details
#convert(method, url_or_html, options) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/grover/processor.rb', line 17 def convert(method, url_or_html, ) spawn_process ensure_packages_are_initiated result = call_js_method method, url_or_html, return unless result return result if result.is_a?(String) result['data'].pack('C*') ensure cleanup_process if stdin end |