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

Move runtime error to ExecJS.runtime

This commit is contained in:
Joshua Peek 2011-03-30 11:57:52 -05:00
parent abc20a3678
commit 313a2903cb
2 changed files with 3 additions and 2 deletions

View file

@ -27,7 +27,8 @@ module ExecJS
end
def self.runtime
@runtime ||= Runtimes.best_available
@runtime ||= Runtimes.best_available ||
raise(ExecJS::RuntimeError, "Could not find a JavaScript runtime")
end
def self.root

View file

@ -31,7 +31,7 @@ module ExecJS
def self.best_available
runtimes.find(&:available?) or raise(ExecJS::RuntimeError, 'Could not find any JavaScript runtime!')
runtimes.find(&:available?)
end
def self.runtimes