1
0
Fork 0
mirror of https://github.com/rails/execjs synced 2023-03-27 23:21:20 -04:00

Add disabled runtime

This commit is contained in:
Joshua Peek 2012-01-19 08:47:40 -08:00
parent 7fc79675cd
commit 940065e8f5
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,23 @@
module ExecJS
class DisabledRuntime
def name
"Disabled"
end
def exec(source)
raise Error, "ExecJS disabled"
end
def eval(source)
raise Error, "ExecJS disabled"
end
def compile(source)
raise Error, "ExecJS disabled"
end
def available?
true
end
end
end

View file

@ -1,4 +1,5 @@
require "execjs/module"
require "execjs/disabled_runtime"
require "execjs/external_runtime"
require "execjs/johnson_runtime"
require "execjs/mustang_runtime"
@ -7,6 +8,8 @@ require "execjs/ruby_rhino_runtime"
module ExecJS
module Runtimes
Disabled = DisabledRuntime.new
RubyRacer = RubyRacerRuntime.new
RubyRhino = RubyRhinoRuntime.new