minep-request 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/minep-request +13 -12
- data/lib/minep-request/requests.rb +16 -0
- data/lib/minep-request/version.rb +1 -1
- metadata +2 -2
data/bin/minep-request
CHANGED
@@ -15,18 +15,19 @@ $options = {
|
|
15
15
|
$goon = true
|
16
16
|
|
17
17
|
$commands = {
|
18
|
-
"authenticate" => Proc.new { |s| Minep::Request.authenticate s},
|
19
|
-
"signup" => Proc.new { |s| Minep::Request.signup s},
|
20
|
-
"exec" => Proc.new { |s| Minep::Request.exec s, $buflist},
|
21
|
-
"insert" => Proc.new { |s| Minep::Request.insert s, $buflist},
|
22
|
-
"move" => Proc.new { |s| Minep::Request.move s, $buflist},
|
23
|
-
"backspace" => Proc.new { |s| Minep::Request.backspace s, $buflist},
|
24
|
-
"delete" => Proc.new { |s| Minep::Request.delete s, $buflist},
|
25
|
-
"load" => Proc.new { |s| Minep::Request.load s, $options[:type], $buflist},
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"
|
18
|
+
"authenticate" => Proc.new { |s| Minep::Request.authenticate s },
|
19
|
+
"signup" => Proc.new { |s| Minep::Request.signup s },
|
20
|
+
"exec" => Proc.new { |s| Minep::Request.exec s, $buflist },
|
21
|
+
"insert" => Proc.new { |s| Minep::Request.insert s, $buflist },
|
22
|
+
"move" => Proc.new { |s| Minep::Request.move s, $buflist },
|
23
|
+
"backspace" => Proc.new { |s| Minep::Request.backspace s, $buflist },
|
24
|
+
"delete" => Proc.new { |s| Minep::Request.delete s, $buflist },
|
25
|
+
"load" => Proc.new { |s| Minep::Request.load s, $options[:type], $buflist },
|
26
|
+
"shell" => Proc.new { |s| Minep::Request.shell s },
|
27
|
+
"list" => Proc.new { |s| list s },
|
28
|
+
"help" => Proc.new { |s| help s },
|
29
|
+
"exit" => Proc.new { |s| quit s },
|
30
|
+
"quit" => Proc.new { |s| quit s }
|
30
31
|
}
|
31
32
|
|
32
33
|
def list socket = nil
|
@@ -9,6 +9,7 @@ module Minep
|
|
9
9
|
"backspace" => "Send a BACKSPACE request",
|
10
10
|
"delete" => "Send a DELETE request",
|
11
11
|
"load" => "Send a LOAD request",
|
12
|
+
"shell" => "Send a SHELL request",
|
12
13
|
"help" => "Show the list of the commands",
|
13
14
|
"exit" => "Disconnect and quit the program",
|
14
15
|
"quit" => "Disconnect and quit the program"
|
@@ -75,6 +76,7 @@ module Minep
|
|
75
76
|
:path => "",
|
76
77
|
:size => 0,
|
77
78
|
:line => 0,
|
79
|
+
:type => "up",
|
78
80
|
:port => 0
|
79
81
|
}
|
80
82
|
printf "path : "
|
@@ -95,6 +97,7 @@ module Minep
|
|
95
97
|
Thread.stop
|
96
98
|
end
|
97
99
|
sleep 2
|
100
|
+
puts "LOAD=#{JSON.dump args}"
|
98
101
|
socket.write "LOAD=#{JSON.dump args}"
|
99
102
|
response = readAndParseResponse "LOAD", socket
|
100
103
|
return if response.nil?
|
@@ -201,5 +204,18 @@ module Minep
|
|
201
204
|
return if response.nil?
|
202
205
|
response["status"]
|
203
206
|
end
|
207
|
+
|
208
|
+
def self.shell socket, buflist
|
209
|
+
args = {
|
210
|
+
:command => "",
|
211
|
+
:args => []
|
212
|
+
}
|
213
|
+
ret = Minep.makeMsg("SHELL", args, buflist)
|
214
|
+
return if ret.nil?
|
215
|
+
socket.write ret
|
216
|
+
response = readAndParseResponse "SHELL", socket
|
217
|
+
return if response.nil?
|
218
|
+
response["status"]
|
219
|
+
end
|
204
220
|
end
|
205
221
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minep-request
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
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: 2013-02-
|
12
|
+
date: 2013-02-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: WEBSocket
|