rubymas 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubymas.rb +29 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3d3c9defb98728a7fa41ef30ee4576efa9419fbcfba35fd94285c2dbb0b9710
|
4
|
+
data.tar.gz: 7e8e70e52328f51690637085ea1d5ed8601949bbce0a81daf0a927f6fff5078b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c29b7fbc1511e51798d0672edb3b94e5c1ceaaaf78e120d1d8ef5c9d0be249f5394a571cfc3b841d4c145751f722a3621bac37e4773df829f3c0355e9f4e224
|
7
|
+
data.tar.gz: '09aa1ffa8e4e00b3ecc4729d4df8edbde3aa158ebc709ba8a58e97dc1e4fd77a45d80d6758b29b475cf137ac12853f24fcc3b582518b5af386f527f870aacc23'
|
data/lib/rubymas.rb
CHANGED
@@ -6,14 +6,39 @@ class RubyMas
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def test_connect
|
9
|
-
telnet.cmd(@connection[:
|
9
|
+
telnet.cmd(@connection[:user]) {|c| print c}
|
10
|
+
telnet.cmd(@connection[:password]) {|c| print c}
|
10
11
|
telnet.close
|
11
12
|
end
|
12
13
|
|
14
|
+
def workorder_report
|
15
|
+
connect
|
16
|
+
telnet.cmd("7"){|c| print telnet.preprocess(c)}
|
17
|
+
telnet.cmd("2"){|c| print telnet.preprocess(c)}
|
18
|
+
telnet.cmd("WOH_DUMP"){|c| print telnet.preprocess(c)}
|
19
|
+
telnet.cmd(""){|c| print telnet.preprocess(c)}
|
20
|
+
telnet.cmd("*END"){|c| print telnet.preprocess(c)}
|
21
|
+
end
|
22
|
+
|
23
|
+
|
13
24
|
private
|
14
25
|
def telnet
|
15
|
-
@telnet ||= Net::Telnet::new(@connection
|
16
|
-
|
17
|
-
|
26
|
+
@telnet ||= Net::Telnet::new("Host" => @connection[:host],
|
27
|
+
"Timeout" => 5,
|
28
|
+
"Prompt" => //,
|
29
|
+
"Waittime" => 1
|
30
|
+
)
|
31
|
+
end
|
32
|
+
def connect
|
33
|
+
telnet.login(@connection[:user], @connection[:password])
|
34
|
+
telnet.cmd("") {|c| print telnet.preprocess(c)}
|
35
|
+
telnet.cmd(@connection[:mas_user]){|c| print telnet.preprocess(c)}
|
36
|
+
telnet.cmd(@connection[:mas_pass]){|c| print telnet.preprocess(c)}
|
37
|
+
telnet.cmd("") {|c| print telnet.preprocess(c)}
|
38
|
+
telnet.cmd("") {|c| print telnet.preprocess(c)}
|
39
|
+
end
|
40
|
+
|
41
|
+
def quick_sleep
|
42
|
+
sleep(1.0/24.0)
|
18
43
|
end
|
19
44
|
end
|