patch 0.4.13 → 0.4.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -7
- data/lib/patch.rb +1 -1
- data/test/io/websocket/node_test.rb +20 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40b17b9d6b5e727dc820833191e39eed4436b6eb
|
4
|
+
data.tar.gz: 6d51227ecb4d486b7899673db3a4d88630a6ff3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 525242393d6c58f27a9bd70561b753475c51e168e11ab43f6a54ed4eec807d28674b29457fecf2397158749e1c8b5ea20cd829b767e872eb2bab17ca47416737
|
7
|
+
data.tar.gz: b281f5d838d52dad011e1a2773b637113b17622c37fcd8a3b61b246fd05a1c66a4719b8dea07f04a91a177254bdc0be541b42c83a5c9dd12c26beab0ea1ab2ff
|
data/README.md
CHANGED
@@ -14,17 +14,13 @@ Other possibilities:
|
|
14
14
|
* HTTP
|
15
15
|
* [JSON RPC 2.0](http://en.wikipedia.org/wiki/JSON-RPC)
|
16
16
|
|
17
|
-
Patch
|
18
|
-
|
19
|
-
At that point, these generic objects can be converted to another one of these formats and sent accordingly.
|
17
|
+
Patch can receive messages in these formats and instantly translate and send them to another format.
|
20
18
|
|
21
19
|
For example:
|
22
20
|
|
23
|
-
Patch
|
24
|
-
|
25
|
-
While this particular example can probably be accomplished using other utilities or scripts, Patch makes it possible to receive, merge, split and send different types of messages like this freely in one session.
|
21
|
+
Patch receive messages from an OSC controller, and relays them to a web API. The web API in turn responds with JSON that Patch relays to a MIDI synthesizer
|
26
22
|
|
27
|
-
|
23
|
+
While this particular example can probably be accomplished using other specialized utilities or scripts, Patch makes it possible to receive, merge, split and send different types of messages like this in a general way, with much less configuration
|
28
24
|
|
29
25
|
## Usage
|
30
26
|
|
data/lib/patch.rb
CHANGED
@@ -91,6 +91,26 @@ class Patch::IO::Websocket::NodeTest < Minitest::Test
|
|
91
91
|
|
92
92
|
end
|
93
93
|
|
94
|
+
context "#ensure_socket" do
|
95
|
+
|
96
|
+
setup do
|
97
|
+
socket = Object.new
|
98
|
+
socket.expects(:on_message).once
|
99
|
+
socket.expects(:start).once
|
100
|
+
Patch::IO::Websocket::Socket.expects(:new).once.returns(socket)
|
101
|
+
assert_nil @server.instance_variable_get("@socket")
|
102
|
+
end
|
103
|
+
|
104
|
+
teardown do
|
105
|
+
Patch::IO::Websocket::Socket.unstub(:new)
|
106
|
+
end
|
107
|
+
|
108
|
+
should "convert message to json" do
|
109
|
+
assert @server.listen(@patches.first) { puts "hello" }
|
110
|
+
end
|
111
|
+
|
112
|
+
end
|
113
|
+
|
94
114
|
end
|
95
115
|
|
96
116
|
end
|