hokaido 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hokaido/cli.rb +12 -12
- data/lib/hokaido/version.rb +1 -1
- 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: 8b6f64f172bb6a9da01f64a1989daf02193e2d1f
|
4
|
+
data.tar.gz: b1a0e14037d1a4cda9e4e582baedcc8030526399
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73728faa085eb09d692b770d896b908d70d5fa704924e3016c4975c072ae443da1803fd3616076364a34168f432873e0946fe7140a84ed4961343cf8260d6a6d
|
7
|
+
data.tar.gz: e31dabda704cff9440ba5229bfecf780f07fb0f47f50ff990dcb3104ee27cd74e8bdc7d58d6ea20ae668876344da008922a94b05c7c32f1363be2eaefc681b59
|
data/lib/hokaido/cli.rb
CHANGED
@@ -10,9 +10,9 @@ module Hokaido
|
|
10
10
|
class_option :host, aliases: :h, default: '0.0.0.0'
|
11
11
|
class_option :port, aliases: :p, default: 4423
|
12
12
|
|
13
|
-
desc :
|
14
|
-
def
|
15
|
-
pty_out, pty_in, pid = *PTY.getpty(
|
13
|
+
desc :broadcast, 'Broadcast a session'
|
14
|
+
def broadcast(command = ENV['SHELL'])
|
15
|
+
pty_out, pty_in, pid = *PTY.getpty(command)
|
16
16
|
nonbloq = Queue.new
|
17
17
|
|
18
18
|
trap :SIGWINCH do
|
@@ -22,11 +22,11 @@ module Hokaido
|
|
22
22
|
Thread.abort_on_exception = true
|
23
23
|
|
24
24
|
Thread.start do
|
25
|
-
|
26
|
-
|
25
|
+
server = TCPSocket.open(*options.values_at(:host, :port))
|
26
|
+
server.puts 'write'
|
27
27
|
|
28
28
|
while c = nonbloq.deq
|
29
|
-
|
29
|
+
server.putc c
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -81,16 +81,16 @@ module Hokaido
|
|
81
81
|
exit
|
82
82
|
end
|
83
83
|
|
84
|
-
desc :
|
85
|
-
def
|
86
|
-
|
87
|
-
|
84
|
+
desc :watch, 'Watch a session'
|
85
|
+
def watch
|
86
|
+
server = TCPSocket.open(*options.values_at(:host, :port))
|
87
|
+
server.puts 'read'
|
88
88
|
|
89
|
-
while c =
|
89
|
+
while c = server.getc
|
90
90
|
$stdout.putc c
|
91
91
|
end
|
92
92
|
rescue Interrupt
|
93
|
-
|
93
|
+
server.close
|
94
94
|
|
95
95
|
exit
|
96
96
|
end
|
data/lib/hokaido/version.rb
CHANGED