rubymas 0.1.0 → 0.2.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rubymas.rb +29 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4dbb34d5c6905a57511a933c8641423c3981c846c34cb70618db628c62fffd3e
4
- data.tar.gz: b9444b624f0bafd0552cb4533f78901995f44b6957e35633c81c3c5b5a010607
3
+ metadata.gz: b3d3c9defb98728a7fa41ef30ee4576efa9419fbcfba35fd94285c2dbb0b9710
4
+ data.tar.gz: 7e8e70e52328f51690637085ea1d5ed8601949bbce0a81daf0a927f6fff5078b
5
5
  SHA512:
6
- metadata.gz: d3e9553725dab7e80caf605ab948436fa61564c23ef40c230247a073dafa492bb2588aa1ea9485ced5fde1efd5286b84125498c6fedf0d05bce8b4da49f52a66
7
- data.tar.gz: fc1273000b739f73ba757de3d27b55680376192473ed77a1ae99b6d581c27d032308acaa413ba0f9a2a7e06c6950189e1019ea91c19e2eecc8497491428425fd
6
+ metadata.gz: 1c29b7fbc1511e51798d0672edb3b94e5c1ceaaaf78e120d1d8ef5c9d0be249f5394a571cfc3b841d4c145751f722a3621bac37e4773df829f3c0355e9f4e224
7
+ data.tar.gz: '09aa1ffa8e4e00b3ecc4729d4df8edbde3aa158ebc709ba8a58e97dc1e4fd77a45d80d6758b29b475cf137ac12853f24fcc3b582518b5af386f527f870aacc23'
@@ -6,14 +6,39 @@ class RubyMas
6
6
  end
7
7
 
8
8
  def test_connect
9
- telnet.cmd(@connection[:login]) {|c| print c}
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.merge({
16
- "Timeout" => 10
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubymas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Gauger