forest-client 0.0.8 → 0.0.9
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 +4 -4
- data/lib/forest-client.rb +27 -18
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c864fa62e0fe9a42fd6ed3eb8fce144da47eda6
|
4
|
+
data.tar.gz: f0b01c51c1ab4a063bb2340db11a0d7fbc48bfd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59eca8d3aa2e335a2d9f568371804069180ff6a24265eab7cfa3fedd9fa43ebecbf7bb95dcfe88c49cb266b5ab5f90c02b37ac96ab405711ee0d72a6c4f705c9
|
7
|
+
data.tar.gz: 5c9cd6596debe28fd14d55dc9f4cf0b35ea11f890f5676b26b61e6b6f20a65a5340cc9121597a51331c524dd6ab3b7f9f18fdd5315f5792e610c4f194f246691
|
data/lib/forest-client.rb
CHANGED
@@ -56,26 +56,33 @@ module ForestClient
|
|
56
56
|
|
57
57
|
trays = Array.new
|
58
58
|
|
59
|
-
p.get_trays
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
59
|
+
t = p.get_trays
|
60
|
+
if t
|
61
|
+
t.each { |tray|
|
62
|
+
trays.push({
|
63
|
+
'name' => tray[:name],
|
64
|
+
'xdim' => tray[:x],
|
65
|
+
'ydim' => tray[:y],
|
66
|
+
'capacity' => tray[:capacity]
|
67
|
+
})
|
68
|
+
}
|
69
|
+
end
|
66
70
|
|
67
71
|
url += '&trays=' + trays.to_s.gsub!('=>', ':')
|
68
72
|
|
69
73
|
consumables = Array.new
|
70
74
|
|
71
|
-
p.get_consumables
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
75
|
+
c = p.get_consumables
|
76
|
+
if c
|
77
|
+
c.each { |cons|
|
78
|
+
consumables.push({
|
79
|
+
'name' => cons[:name],
|
80
|
+
'level' => cons[:level],
|
81
|
+
'capacity' => cons[:capacity],
|
82
|
+
'percentage' => cons[:percentage]
|
83
|
+
})
|
84
|
+
}
|
85
|
+
end
|
79
86
|
|
80
87
|
url += '&consumables=' + consumables.to_s.gsub!('=>', ':')
|
81
88
|
|
@@ -94,9 +101,11 @@ module ForestClient
|
|
94
101
|
forest = Forest.new(@org_id)
|
95
102
|
|
96
103
|
printers = forest.get_printers
|
97
|
-
printers
|
98
|
-
|
99
|
-
|
104
|
+
if printers
|
105
|
+
printers.each do |printer|
|
106
|
+
forest.update_printer(printer)
|
107
|
+
forest.update_status(printer)
|
108
|
+
end
|
100
109
|
end
|
101
110
|
end
|
102
111
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Burwell
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-11-
|
14
|
+
date: 2013-11-22 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
16
|
description: The LAN printer query agent for the Forest printer management system.
|
17
17
|
email: printer.fungineers@gmail.com
|