Class: Opal::CliRunners::Gjs

Inherits:
Object
  • Object
show all
Defined in:
opal/lib/opal/cli_runners/gjs.rb

Overview

Gjs is GNOME's JavaScript runtime based on Mozilla SpiderMonkey

Defined Under Namespace

Classes: MissingGjs

Class Method Summary collapse

Class Method Details

.call(data) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'opal/lib/opal/cli_runners/gjs.rb', line 11

def self.call(data)
  exe = ENV['GJS_PATH'] || 'gjs'

  opts = Shellwords.shellwords(ENV['GJS_OPTS'] || '')

  SystemRunner.call(data) do |tempfile|
    [exe, *opts, tempfile.path, *data[:argv]]
  end
rescue Errno::ENOENT
  raise MissingGjs, 'Please install Gjs to be able to run Opal scripts.'
end