Module: Xpring::Javascript
- Defined in:
- lib/xpring/javascript.rb
Overview
Basic Ruby to Javascript interop
Constant Summary collapse
- ENTRY_POINT =
"XpringCommonJS"- LIBRARY_PATH =
File.("./javascript/library.js", __dir__)
Class Method Summary collapse
Class Method Details
.run ⇒ Hash<Symbol, Object>, ...
17 18 19 20 21 22 23 |
# File 'lib/xpring/javascript.rb', line 17 def self.run script = prepare(yield) cmd = "node -p #{script.dump}" Xpring.debug_log(cmd) raw = IO.popen(cmd, &:readlines).first&.strip parse(raw) end |