hokaido 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/hokaido/cli.rb +13 -13
- data/lib/hokaido/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13b934e4a7e01d32d6366179ef660e484fe5ddeb
|
4
|
+
data.tar.gz: a7b298c2e37776c1ee1a58a50ff705d33851b6fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e2cd0b75c3665e2a3e430a4c6f8a80a90285dddf79a93e5e7a91caf6460f8cc41e2826a286915569f5f839b8ca8e4ccac7eb6761969fafc3037335a0ec69d2f
|
7
|
+
data.tar.gz: 64a50a2095150a07fcc29e025fe06a8d2d19931e673ce323e13a55e081d832916cce5a7facdde73bdeae2ba503aa418e13ac6647842af8e67b608616a9018d27
|
data/README.md
CHANGED
@@ -6,14 +6,14 @@
|
|
6
6
|
$ hokaido server # on 203.0.113.10:4423
|
7
7
|
```
|
8
8
|
|
9
|
-
## 2.
|
9
|
+
## 2. Watch (Tokyo)
|
10
10
|
|
11
11
|
``` sh
|
12
|
-
$ hokaido
|
12
|
+
$ hokaido watch --host 203.0.113.10
|
13
13
|
```
|
14
14
|
|
15
|
-
## 3.
|
15
|
+
## 3. Broadcast (Hokaido!)
|
16
16
|
|
17
17
|
``` sh
|
18
|
-
$ hokaido
|
18
|
+
$ hokaido broadcast --host 203.0.113.10
|
19
19
|
```
|
data/lib/hokaido/cli.rb
CHANGED
@@ -25,23 +25,23 @@ module Hokaido
|
|
25
25
|
server = TCPSocket.open(*options.values_at(:host, :port))
|
26
26
|
server.puts 'write'
|
27
27
|
|
28
|
-
while
|
29
|
-
server.
|
28
|
+
while chunk = nonbloq.deq
|
29
|
+
server.write chunk
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
Thread.start do
|
34
|
-
while
|
35
|
-
$stdout.
|
36
|
-
nonbloq.enq
|
34
|
+
while chunk = pty_out.readpartial(4096)
|
35
|
+
$stdout.write chunk
|
36
|
+
nonbloq.enq chunk
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
Thread.start do
|
41
41
|
TermInfo.tiocswinsz pty_in, *TermInfo.screen_size
|
42
42
|
|
43
|
-
while
|
44
|
-
pty_in.putc
|
43
|
+
while char = $stdin.getch
|
44
|
+
pty_in.putc char
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -59,14 +59,14 @@ module Hokaido
|
|
59
59
|
when 'write'
|
60
60
|
client.puts ':)'
|
61
61
|
|
62
|
-
while
|
63
|
-
queue.enq
|
62
|
+
while chunk = client.readpartial(4096)
|
63
|
+
queue.enq chunk
|
64
64
|
end
|
65
65
|
when 'read'
|
66
66
|
client.puts '=)'
|
67
67
|
|
68
|
-
while
|
69
|
-
client.
|
68
|
+
while chunk = queue.deq
|
69
|
+
client.write chunk
|
70
70
|
end
|
71
71
|
else
|
72
72
|
client.puts ':('
|
@@ -86,8 +86,8 @@ module Hokaido
|
|
86
86
|
server = TCPSocket.open(*options.values_at(:host, :port))
|
87
87
|
server.puts 'read'
|
88
88
|
|
89
|
-
while
|
90
|
-
$stdout.
|
89
|
+
while chunk = server.readpartial(4096)
|
90
|
+
$stdout.write chunk
|
91
91
|
end
|
92
92
|
rescue Interrupt
|
93
93
|
server.close
|
data/lib/hokaido/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hokaido
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ursm
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-10-
|
12
|
+
date: 2014-10-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|