# File lib/execjs/runtimes.rb, line 49 def self.autodetect from_environment || best_available || raise(RuntimeUnavailable, "Could not find a JavaScript runtime. " + "See https://github.com/sstephenson/execjs for a list of available runtimes.") end
# File lib/execjs/runtimes.rb, line 55 def self.best_available runtimes.reject(&:deprecated?).find(&:available?) end
# File lib/execjs/runtimes.rb, line 59 def self.from_environment if name = ENV["EXECJS_RUNTIME"] if runtime = const_get(name) if runtime.available? runtime if runtime.available? else raise RuntimeUnavailable, "#{runtime.name} runtime is not available on this system" end elsif !name.empty? raise RuntimeUnavailable, "#{name} runtime is not defined" end end end
Generated with the Darkfish Rdoc Generator 2.