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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ea88071ef769ad8fcbc94315df369ff7b69cb5d
4
- data.tar.gz: 304dc12899721a7c327c1d9e6c96952210cd9c87
3
+ metadata.gz: 8b6f64f172bb6a9da01f64a1989daf02193e2d1f
4
+ data.tar.gz: b1a0e14037d1a4cda9e4e582baedcc8030526399
5
5
  SHA512:
6
- metadata.gz: e8d5b30c1f9c175b1af4017e854bfa81d4d666ff6e38f26c8d82bffac3e3b29409b39c796a11c14cb1030c89201a614e481f51bf779add0cb12c3175f805354c
7
- data.tar.gz: d3661784ccca6a1be3b982e9b63a5c8a031c219722aeb0eb5563f281661bddd7d93503be052f487a7f2a80aa1edf05cfef0d39499df5c72a666894e0280dd070
6
+ metadata.gz: 73728faa085eb09d692b770d896b908d70d5fa704924e3016c4975c072ae443da1803fd3616076364a34168f432873e0946fe7140a84ed4961343cf8260d6a6d
7
+ data.tar.gz: e31dabda704cff9440ba5229bfecf780f07fb0f47f50ff990dcb3104ee27cd74e8bdc7d58d6ea20ae668876344da008922a94b05c7c32f1363be2eaefc681b59
@@ -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 :sh, 'Start live shell'
14
- def sh(shell = ENV['SHELL'])
15
- pty_out, pty_in, pid = *PTY.getpty(shell)
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
- client = TCPSocket.open(*options.values_at(:host, :port))
26
- client.puts 'write'
25
+ server = TCPSocket.open(*options.values_at(:host, :port))
26
+ server.puts 'write'
27
27
 
28
28
  while c = nonbloq.deq
29
- client.putc c
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 :viewer, 'Open viewer'
85
- def viewer
86
- client = TCPSocket.open(*options.values_at(:host, :port))
87
- client.puts 'read'
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 = client.getc
89
+ while c = server.getc
90
90
  $stdout.putc c
91
91
  end
92
92
  rescue Interrupt
93
- client.close
93
+ server.close
94
94
 
95
95
  exit
96
96
  end
@@ -1,3 +1,3 @@
1
1
  module Hokaido
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ursm