pssh 0.3.3 → 0.4.0

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDVmMzVhYTE2ZjRhMGZiMmE0NWM1ZjdmM2Q3ZTUyZjljYTJiOTc1Nw==
4
+ MDM1MzljMDVjYTk2ZjlkOWM5ZDhmY2Y0MzhmZWZjZTViMDI4ZTM4Zg==
5
5
  data.tar.gz: !binary |-
6
- ZDE1MDQ0MTBkOTA4NzhlY2UwMDBmZmJmZTU5NmQ5NmJjZmYyNzZhZA==
6
+ ODI3MmViMDJhYjEwYjU2ZmMxNTMzMGQ2MjZlNmUzYzFjNWIwOGY1Mg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NWQ4MTAxMTA1OGVjNzNmM2FkMWJjNDYzYjNiNGFhYzMzNzVmMTNlMDhiYjU0
10
- MjkwN2I2ZmM5OTQ3MTNhMTZlZjVjNjkwZWUwNTEyMWMxM2RkMzNiODI5MDMz
11
- ZTU2YTdkYjY2NzlhNmJlZmRhNmQ4OTI5YTM4ZjZkZDYwNTBmMTk=
9
+ NmEyNmQ4YmJlNDYxMzA1NWE5ZTA0ZmY4MjU2YjYzM2QxNTg4N2UyMTJlNzU4
10
+ MGM3NTIxNTg3YmJmZjk3NWFkOGRlYTkxOGUwZWU1MGE4YjU5Y2M3MDY0MWVj
11
+ NjJjZmIxNjdjMzVkOWFlNzRmNTYzMTY1NjA2NWQ3ZDFkOWJhNjM=
12
12
  data.tar.gz: !binary |-
13
- OGRiZTE1OWQ4M2MyY2RkMWUxOGY2MGQ5ZjVmMzBlOTE3ODVlMzZjOGFmNjM0
14
- ZDIzZjM2ODMzNGM4ODJiYmI5YjM4MzkyZTJjMWYyY2JkYjY1OTk0ZjdjOWU1
15
- MDZmNjQzMmI1ZGM0Yzg4MzE2ZmE4NzQ0OWZhYWIxZjJlNDg3Njc=
13
+ Y2FkNzZjZmQyNjNmM2U5NDk1MzI3MjRkODYyNzQ2MTIwOTllNmFiY2UxMzM3
14
+ OTdiOTA0ZDZhN2QyNGZjODcyMmI1ZWU5NTUwY2E5NDJjNzgzOTZlMGQxMDE2
15
+ NjI3ZjYxNDNiNTAyMWQ4MzBmODBmMTcyZDI1ODhhMmNiY2E5YzI=
@@ -103,8 +103,6 @@ module Pssh
103
103
  (ENV['TMUX'] && :tmux) ||
104
104
  (ENV['STY'] && :screen) ||
105
105
  :shell
106
- #(`which tmux` && :tmux) ||
107
- #(`which screen` && :screen) ||
108
106
  end
109
107
 
110
108
  # Public: Allow configuring details of Pssh by making use of a block.
@@ -29,10 +29,6 @@ module Pssh
29
29
  options[:port] = port.to_i
30
30
  end
31
31
 
32
- opts.on('-c PATH', '--command COMMAND', [:tmux, :screen, :shell], 'Set the tool that will be used to initialize the web session (tmux, screen, or shell)') do |command|
33
- options[:command] = command
34
- end
35
-
36
32
  opts.on('-s NAME', '--socket NAME', String, 'Set the socket that will be used for connecting (socket-name)') do |socket|
37
33
  options[:socket_path] = socket
38
34
  end
@@ -29,38 +29,33 @@ BANNER
29
29
  end
30
30
  system("stty raw -echo")
31
31
  end
32
- @active = true
33
- while @active do
34
- begin
35
- io = [@read]
36
- io << $stdin if new?
37
- rs, ws = IO.select(io)
38
- r = rs[0]
39
- while (data = r.read_nonblock(2048)) do
40
- if new? && r == $stdin
41
- @write.write_nonblock data
42
- else
43
- $stdout.write_nonblock data if new?
44
- data.encode!('UTF-16', 'UTF-8', :invalid => :replace, :replace => '')
45
- data.encode!('UTF-8', 'UTF-16')
46
- if data.valid_encoding?
47
- store data
48
- Pssh.socket.write data
49
- end
50
- end
51
- end
52
- rescue Exception => e
53
- if @active
54
- if e.is_a?(Errno::EAGAIN)
55
- retry
56
- else
57
- system("stty -raw echo") if new?
58
- puts 'Terminating Pssh.'
59
- Kernel.exit!
60
- @active = false
32
+
33
+ begin
34
+ io = [@read]
35
+ io << $stdin if new?
36
+ rs, ws = IO.select(io)
37
+ r = rs[0]
38
+ while (data = r.read_nonblock(2048)) do
39
+ if new? && r == $stdin
40
+ @write.write_nonblock data
41
+ else
42
+ $stdout.write_nonblock data if new?
43
+ data.encode!('UTF-16', 'UTF-8', :invalid => :replace, :replace => '')
44
+ data.encode!('UTF-8', 'UTF-16')
45
+ if data.valid_encoding?
46
+ store data
47
+ Pssh.socket.write data
61
48
  end
62
49
  end
63
50
  end
51
+ rescue Exception => e
52
+ if e.is_a?(Errno::EAGAIN)
53
+ retry
54
+ else
55
+ system("stty -raw echo") if new?
56
+ puts 'Terminating Pssh.'
57
+ Kernel.exit!
58
+ end
64
59
  end
65
60
  end
66
61
  end
@@ -1,4 +1,4 @@
1
1
  module Pssh
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-16 00:00:00.000000000 Z
11
+ date: 2013-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json