Sha256: 1486585b667290e2403acd7f1d7ac1d975cd4ac920c091360b6db2a121b287c9
Contents?: true
Size: 656 Bytes
Versions: 21
Compression:
Stored size: 656 Bytes
Contents
require 'shellwords' module Opal module CliRunners class Phantomjs def initialize(output = $stdout) @output = output end attr_reader :output, :exit_status def run(code, argv) unless argv.empty? raise ArgumentError, 'Program arguments are not supported on the PhantomJS runner' end phantomjs = IO.popen(command, 'w', out: output) do |io| io.write(code) end @exit_status = $?.exitstatus end def command script_path = File.expand_path('../phantom.js', __FILE__) "phantomjs #{script_path.shellescape}" end end end end
Version data entries
21 entries across 21 versions & 2 rubygems