pry-remote-em 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +86 -5
- data/bin/pry-remote-em +2 -2
- data/lib/pry-remote-em.rb +8 -6
- data/lib/pry-remote-em/broker.rb +189 -0
- data/lib/pry-remote-em/client.rb +154 -86
- data/lib/pry-remote-em/client/broker.rb +36 -0
- data/lib/pry-remote-em/client/generic.rb +73 -0
- data/lib/pry-remote-em/client/proxy.rb +32 -0
- data/lib/pry-remote-em/proto.rb +167 -0
- data/lib/pry-remote-em/server.rb +152 -74
- data/lib/pry-remote-em/server/shell_cmd.rb +2 -2
- data/lib/pry-remote-em/version.rb +1 -1
- metadata +8 -20
- data/lib/pry-remote-em/json-proto.rb +0 -31
@@ -6,13 +6,13 @@ module PryRemoteEm
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def receive_data(d)
|
9
|
-
@pryem.
|
9
|
+
@pryem.send_shell_cmd(d.force_encoding("utf-8"))
|
10
10
|
end
|
11
11
|
|
12
12
|
alias :receive_stderr :receive_data
|
13
13
|
|
14
14
|
def unbind
|
15
|
-
@pryem.
|
15
|
+
@pryem.send_shell_result(get_status.exitstatus)
|
16
16
|
@pryem.send_last_prompt
|
17
17
|
end
|
18
18
|
end # module::ShellCmd
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-remote-em
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|
@@ -43,22 +43,6 @@ dependencies:
|
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: 0.9.9
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: rb-readline
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
46
|
- !ruby/object:Gem::Dependency
|
63
47
|
name: ruby-termios
|
64
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +51,7 @@ dependencies:
|
|
67
51
|
- - ~>
|
68
52
|
- !ruby/object:Gem::Version
|
69
53
|
version: 0.9.6
|
70
|
-
type: :
|
54
|
+
type: :development
|
71
55
|
prerelease: false
|
72
56
|
version_requirements: !ruby/object:Gem::Requirement
|
73
57
|
none: false
|
@@ -99,9 +83,13 @@ executables:
|
|
99
83
|
extensions: []
|
100
84
|
extra_rdoc_files: []
|
101
85
|
files:
|
86
|
+
- lib/pry-remote-em/broker.rb
|
87
|
+
- lib/pry-remote-em/client/broker.rb
|
88
|
+
- lib/pry-remote-em/client/generic.rb
|
102
89
|
- lib/pry-remote-em/client/keyboard.rb
|
90
|
+
- lib/pry-remote-em/client/proxy.rb
|
103
91
|
- lib/pry-remote-em/client.rb
|
104
|
-
- lib/pry-remote-em/
|
92
|
+
- lib/pry-remote-em/proto.rb
|
105
93
|
- lib/pry-remote-em/server/shell_cmd.rb
|
106
94
|
- lib/pry-remote-em/server.rb
|
107
95
|
- lib/pry-remote-em/version.rb
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'json'
|
2
|
-
|
3
|
-
module PryRemoteEm
|
4
|
-
module JsonProto
|
5
|
-
DELIM = ']]>]]><[[<[['
|
6
|
-
|
7
|
-
def receive_data(d)
|
8
|
-
return unless d && d.length > 0
|
9
|
-
@buffer ||= "" # inlieu of a post_init
|
10
|
-
|
11
|
-
if six = d.index(DELIM)
|
12
|
-
@buffer << d[0...six]
|
13
|
-
j = JSON.load(@buffer)
|
14
|
-
@buffer.clear
|
15
|
-
receive_json(j)
|
16
|
-
(rem = d[(six + DELIM.length)..-1]).empty? ||
|
17
|
-
receive_data(rem)
|
18
|
-
else
|
19
|
-
@buffer << d
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def receive_json(j)
|
24
|
-
end
|
25
|
-
|
26
|
-
def send_data(d)
|
27
|
-
super(JSON.dump(d.is_a?(String) ? {:d => d} : d) + DELIM)
|
28
|
-
end
|
29
|
-
|
30
|
-
end # module::JsonProto
|
31
|
-
end # module::PryRemoteEm
|