Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make the readme example work

  • Loading branch information...
commit 1fc06707695fb9d010213863cae73fffa472d25a 1 parent 80b3aa3
@sstephenson authored
Showing with 13 additions and 1 deletion.
  1. +12 −0 lib/execjs.rb
  2. +1 −1  readme.md
View
12 lib/execjs.rb
@@ -4,4 +4,16 @@ class RuntimeError < Error; end
class ProgramError < Error; end
autoload :Runtimes, "execjs/runtimes"
+
+ def self.exec(source)
+ runtime.exec(source)
+ end
+
+ def self.eval(source)
+ runtime.eval(source)
+ end
+
+ def self.runtime
+ @runtime ||= Runtimes::Node
+ end
end
View
2  readme.md
@@ -19,5 +19,5 @@ ExecJS supports these runtimes:
A short example:
require "execjs"
- ExecJS.eval "'red yellow blue'.split('')"
+ ExecJS.eval "'red yellow blue'.split(' ')"
# => ["red", "yellow", "blue"]
Please sign in to comment.
Something went wrong with that request. Please try again.