ruby-await-node 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -3
- data/lib/ruby-await-node/context.rb +4 -0
- data/lib/ruby-await-node/version.rb +1 -1
- data/spec/ruby_await_node_spec.rb +14 -4
- data/spec/sample_entry.js +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 403ac9706145f1e9f6cbc13864251c46b2373362
|
4
|
+
data.tar.gz: f17935185a4aa8b138d7308a4cac54dfb4469974
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05425ac33627f0f30a7aa417113662c7738196005d04219be447afa09bcd35855e0042d01692d1a2c51dac4a027e6a5cb944539b394f152bb803045a98d7dd9d
|
7
|
+
data.tar.gz: 379139489c13779ae81134136d56abcc5d5bfc1057ade548e20de3ba2d5210e5f495defa7532b379c5fc57400075486c7e855f0e438d419b3fc34f5c12a9f14c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -21,13 +21,12 @@ where ruby fall short
|
|
21
21
|
|
22
22
|
- [x] Execute any javascript from ruby
|
23
23
|
- [x] Pass all test
|
24
|
-
- [
|
25
|
-
- [ ] Use zeromq instead of http webserver to design away port conflicting
|
24
|
+
- [x] Execute await/async method
|
26
25
|
|
27
26
|
# Getting Started
|
28
27
|
|
29
28
|
```ruby
|
30
|
-
gem 'ruby-await-node'
|
29
|
+
gem 'ruby-await-node'
|
31
30
|
```
|
32
31
|
|
33
32
|
Or if you want to run the latest version
|
@@ -18,10 +18,10 @@ describe RubyAwaitNode do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
context "simple javascript" do
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
it "returns desired value" do
|
22
|
+
js_result = create_ruby_await_node_context.eval(return_42)
|
23
|
+
expect(js_result).to eq 42
|
24
|
+
end
|
25
25
|
end
|
26
26
|
|
27
27
|
context "await javascript" do
|
@@ -31,6 +31,16 @@ describe RubyAwaitNode do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
describe "load an entry file" do
|
35
|
+
it "loads correctly" do
|
36
|
+
path = File.expand_path("sample_entry.js", __dir__)
|
37
|
+
context = create_ruby_await_node_context
|
38
|
+
context.load(path)
|
39
|
+
js_result = context.eval("global.entryName")
|
40
|
+
expect(js_result).to eq "sample"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
34
44
|
it "raises an RubyAwaitNode::ProgramError on error" do
|
35
45
|
expect {
|
36
46
|
create_ruby_await_node_context.eval("(function() { throw new Error('foo\\nbar', 0, 'test.js'); })()")
|
@@ -0,0 +1 @@
|
|
1
|
+
global.entryName = "sample"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-await-node
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phuong Nguyen
|
@@ -64,6 +64,7 @@ files:
|
|
64
64
|
- ruby-await-node.js
|
65
65
|
- spec/fork_test_harness.rb
|
66
66
|
- spec/ruby_await_node_spec.rb
|
67
|
+
- spec/sample_entry.js
|
67
68
|
- spec/spec_helper.rb
|
68
69
|
homepage: https://github.com/remitano/ruby-await-node
|
69
70
|
licenses:
|