Permalink
Browse files

use absolute path when loading lyndon.js

  • Loading branch information...
1 parent c850e7d commit 41548d271f40cfd15ab1e2c5073eee991b04017c @defunkt committed Jun 26, 2009
Showing with 3 additions and 4 deletions.
  1. +1 −1 lib/js/lyndon.js
  2. +2 −3 lib/lyndon/runtime.rb
View
@@ -22,4 +22,4 @@ var Lyndon = {
throw Ruby.LoadError
}
-}
+}
View
@@ -10,16 +10,15 @@ def initialize(dom = nil)
@scripter.setValue(Ruby.new, forKey:"Ruby")
load_dom(dom) if dom
- eval_file 'lib/js/lyndon'
+ eval_file File.dirname(__FILE__) + '/../js/lyndon'
end
def eval(js)
@scripter.evaluateWebScript(js)
end
def eval_file(file)
- file = File.expand_path(file.to_s)
- if File.exists? file
+ if File.exists? file = File.expand_path(file.to_s)
eval File.read(file)
elsif File.exists? file + '.js'
eval File.read(file + '.js')

0 comments on commit 41548d2

Please sign in to comment.