babascript 0.2.4 → 0.2.5
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/History.txt +4 -0
- data/README.md +8 -0
- data/Rakefile +7 -0
- data/babascript.gemspec +1 -0
- data/lib/babascript/version.rb +1 -1
- data/test/test_babascript.rb +41 -0
- data/test/test_helper.rb +5 -0
- metadata +20 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3aeb3ba4411427fee529dcbb7fbe34688dad3a57
|
4
|
+
data.tar.gz: 5ece4327e81b3dee667120289c5a7fc06977d143
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9422869567d055c38a22a3c09759bf082ee94c41a99fe57d77791f4edd54cd84c5d08d9e83af6fd2657462711d668a62513e8211e12b21771db7673ab0f3828c
|
7
|
+
data.tar.gz: 7989e74cba67c6fb8ff5f27c345e085b03cb6ac58eb85a7cb55eb9d2b5910d240fce031c318cfd2899ae6ebd8f0a2c206209c4b1f5104b982b144204d271e6c3
|
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -59,6 +59,14 @@ BabaScriptはジョブ通知に[Linda](https://gihtub.com/shokai/linda-base)を
|
|
59
59
|
環境変数BABAを"shokai"に切り替えると、以後のジョブの通知先が http://linda.masuilab.org/shokai/notifications になります。
|
60
60
|
|
61
61
|
|
62
|
+
Test
|
63
|
+
----
|
64
|
+
|
65
|
+
% gem install bundler
|
66
|
+
% bundle install
|
67
|
+
% bundle exec rake test
|
68
|
+
|
69
|
+
|
62
70
|
Contributing
|
63
71
|
------------
|
64
72
|
1. Fork it
|
data/Rakefile
CHANGED
data/babascript.gemspec
CHANGED
data/lib/babascript/version.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require File.expand_path 'test_helper', File.dirname(__FILE__)
|
3
|
+
|
4
|
+
class TestBabaScript < MiniTest::Test
|
5
|
+
|
6
|
+
ENV["BABA"] = "test"
|
7
|
+
|
8
|
+
def test_eval_write_tuple
|
9
|
+
tuple_ = nil
|
10
|
+
res_ = nil
|
11
|
+
EM::run do
|
12
|
+
linda = EM::RocketIO::Linda::Client.new BabaScript.LINDA_BASE
|
13
|
+
ts = linda.tuplespace[ BabaScript.LINDA_SPACE ]
|
14
|
+
linda.io.once :connect do
|
15
|
+
ts.take [:babascript, :eval] do |tuple|
|
16
|
+
tuple_ = tuple
|
17
|
+
ts.write [:babascript, :return, tuple[4]["callback"], "ざんまい"]
|
18
|
+
EM::add_timer 1 do
|
19
|
+
EM::stop
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
BabaScript.baba do
|
25
|
+
res_ = テスト 1, 2, "かずすけ"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
assert_equal tuple_.class, Array
|
30
|
+
assert_equal tuple_.size, 5
|
31
|
+
assert_equal tuple_[0], "babascript"
|
32
|
+
assert_equal tuple_[1], "eval"
|
33
|
+
assert_equal tuple_[2], "テスト"
|
34
|
+
assert_equal tuple_[3], [1, 2, "かずすけ"]
|
35
|
+
assert_equal tuple_[4].class, Hash
|
36
|
+
assert tuple_[4].has_key? "callback"
|
37
|
+
|
38
|
+
assert_equal res_, "ざんまい"
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: babascript
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
@@ -81,6 +81,20 @@ dependencies:
|
|
81
81
|
- - '>='
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: minitest
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - '>='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
84
98
|
description: BabaScript is a script launguage which runs on @takumibaba
|
85
99
|
email:
|
86
100
|
- hashimoto@shokai.org
|
@@ -109,6 +123,8 @@ files:
|
|
109
123
|
- samples/sample.bb
|
110
124
|
- samples/sample.rb
|
111
125
|
- samples/sample_arduino.rb
|
126
|
+
- test/test_babascript.rb
|
127
|
+
- test/test_helper.rb
|
112
128
|
homepage: https://github.com/masuilab/babascript
|
113
129
|
licenses:
|
114
130
|
- MIT
|
@@ -133,4 +149,6 @@ rubygems_version: 2.0.5
|
|
133
149
|
signing_key:
|
134
150
|
specification_version: 4
|
135
151
|
summary: BabaScript is a script launguage which runs on @takumibaba
|
136
|
-
test_files:
|
152
|
+
test_files:
|
153
|
+
- test/test_babascript.rb
|
154
|
+
- test/test_helper.rb
|