liebert 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -0
- data/README.md +4 -2
- data/Rakefile +6 -1
- data/bin/liebert +2 -2
- data/lib/liebert/airconditioner.rb +2 -2
- data/lib/liebert/scrapable.rb +1 -1
- data/lib/liebert/ups.rb +2 -2
- data/lib/liebert/version.rb +2 -2
- data/spec/airconditioner_spec.rb +3 -3
- data/spec/cassettes/airconditioner.yml +4 -4
- data/spec/cassettes/ups.yml +3 -3
- data/spec/command_line_spec.rb +13 -0
- data/spec/ups_spec.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 566187043e7b30a0ed99717987cdaabfad6e4175
|
4
|
+
data.tar.gz: 0be4b98b94e71ba8a3fe07ba0882ea7ec04c2d4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0f4b50d20a420e7e0188903a3ca28f9356434ab643136a04f3164acc8465a884e11b4777daccef6171241f00ddb83a241988c89fa6756335a3f337b1d62c6b2
|
7
|
+
data.tar.gz: 60722e7bb97c1d6dd8dff4498cb23fc28300673a05ee06541d3b29cbb533065b09c00ce244448c2e83099b6415e53947221adca31c2bbd69f2d0470101e65d9b
|
data/.travis.yml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.0.0
|
4
|
+
env:
|
5
|
+
global:
|
6
|
+
- secure: Rg4MmfZITTnriM36yOaIC5dskxIZbfIdQ6azaUrasPfIl3Llr5+YlZlFs4GHL7gn2BPPz6qBgnURXDP22Sc8KISighCIdHxunvFLt7TwvwlWYCuDvaUdOGpoZq+KZyUzrHfL6gPZetLZXs1AyzloNMifDozTh0mpjOINDplXSz0=
|
7
|
+
- secure: zrGsMmYX+bFA4xdC6uaNQd0IitZuf1q5gLcUUlB+YnnlMJ1e2Ry12tOa4OVy72ih0Q/wHGM/8Zg8SJl1frPuew43EqrYfC9ZuMegcosyEmYqS5jEUx5Xn7gxqhIWFadJq14rU5U0yp1mBnVLL8ugNquM7WRykB3mFtbBMWp5IP8=
|
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# Liebert
|
2
|
+
[![Build Status](https://travis-ci.org/bswinnerton/liebert.png)](https://travis-ci.org/bswinnerton/liebert)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/bswinnerton/liebert.png)](https://codeclimate.com/github/bswinnerton/liebert)
|
2
4
|
|
3
5
|
Liebert is a gem that allows you to gather metrics from [Liebert](http://www.emersonnetworkpower.com/en-US/Brands/liebert/Pages/default.aspx) based products and display them in a format digestable by [Ganglia](http://ganglia.sourceforge.net/).
|
4
6
|
|
@@ -22,12 +24,12 @@ To utilize this gem, simply set the URLs to your liebert products in environment
|
|
22
24
|
|
23
25
|
AC Unit:
|
24
26
|
```
|
25
|
-
export
|
27
|
+
export LIEBERT_AIRCONDITIONER_HOSTNAME='liebertac.mydomain.com'
|
26
28
|
```
|
27
29
|
|
28
30
|
UPS Unit:
|
29
31
|
```
|
30
|
-
export
|
32
|
+
export LIEBERT_UPS_HOSTNAME='liebertups.mydomain.com'
|
31
33
|
```
|
32
34
|
|
33
35
|
And then you can run:
|
data/Rakefile
CHANGED
data/bin/liebert
CHANGED
@@ -2,9 +2,9 @@ require 'liebert'
|
|
2
2
|
|
3
3
|
case ARGV[0]
|
4
4
|
when 'ac'
|
5
|
-
ac = AirConditioner.new(ENV['
|
5
|
+
ac = AirConditioner.new(ENV['LIEBERT_AIRCONDITIONER_HOSTNAME'])
|
6
6
|
pass_arguments(ac)
|
7
7
|
when 'ups'
|
8
|
-
ups = UPS.new(ENV['
|
8
|
+
ups = UPS.new(ENV['LIEBERT_UPS_HOSTNAME'])
|
9
9
|
pass_arguments(ups)
|
10
10
|
end
|
data/lib/liebert/scrapable.rb
CHANGED
@@ -32,7 +32,7 @@ module Scrapable
|
|
32
32
|
response = RestClient.get(self.endpoint_uri)
|
33
33
|
@parsed_response = Nokogiri::HTML.parse(response.body)
|
34
34
|
rescue
|
35
|
-
raise "You forgot to set the
|
35
|
+
raise "You forgot to set the hostname to your Liebert unit. More information can be found here: https://github.com/bswinnerton/liebert/blob/master/README.md"
|
36
36
|
end
|
37
37
|
end
|
38
38
|
@parsed_response
|
data/lib/liebert/ups.rb
CHANGED
data/lib/liebert/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Liebert
|
2
|
-
VERSION = '0.0.
|
3
|
-
end
|
2
|
+
VERSION = '0.0.4'
|
3
|
+
end
|
data/spec/airconditioner_spec.rb
CHANGED
@@ -4,7 +4,7 @@ vcr_options = { cassette_name: 'airconditioner' }
|
|
4
4
|
|
5
5
|
describe AirConditioner, vcr: vcr_options do
|
6
6
|
before :all do
|
7
|
-
@ac = AirConditioner.new(ENV['
|
7
|
+
@ac = AirConditioner.new(ENV['LIEBERT_AIRCONDITIONER_HOSTNAME'])
|
8
8
|
end
|
9
9
|
|
10
10
|
it 'responds to temperature' do
|
@@ -12,10 +12,10 @@ describe AirConditioner, vcr: vcr_options do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'responds to humidity' do
|
15
|
-
expect(@ac.humidity).to eq "Humidity\
|
15
|
+
expect(@ac.humidity).to eq "Humidity\t43.0"
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'responds to all' do
|
19
|
-
expect(@ac.all).to eq "Temperature\t65.0\nHumidity\
|
19
|
+
expect(@ac.all).to eq "Temperature\t65.0\nHumidity\t43.0\n"
|
20
20
|
end
|
21
21
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: http://liebertac1.bobst.nyu.edu/graphic/env.htm
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -121,7 +121,7 @@ http_interactions:
|
|
121
121
|
deviceInfo.tempSetpt=65;
|
122
122
|
deviceInfo.tempTol=2.0;
|
123
123
|
|
124
|
-
deviceInfo.humid=
|
124
|
+
deviceInfo.humid=43;
|
125
125
|
deviceInfo.humidSetpt=48;
|
126
126
|
deviceInfo.humidTol=5;
|
127
127
|
// -->
|
@@ -151,7 +151,7 @@ http_interactions:
|
|
151
151
|
<td class="leftAlignAreaStyle">Stage</td><td class="leftAlignAreaStyle">
|
152
152
|
0 </td></tr><tr>
|
153
153
|
<td class="leftAlignAreaStyle">Capacity </td><td class="leftAlignAreaStyle">
|
154
|
-
|
154
|
+
10 %
|
155
155
|
</td></tr></table></div><div id="HumidityFrame" class="humidityFrame">
|
156
156
|
<table border="1" width="485" height="110">
|
157
157
|
<tr><td> </td></tr></table></div><div id="HumidityArea" class="humidityArea">
|
@@ -171,5 +171,5 @@ http_interactions:
|
|
171
171
|
<td class="headerTextStyle" width="250">Active Alarms:</td></tr></table></div>
|
172
172
|
</body></html>
|
173
173
|
http_version:
|
174
|
-
recorded_at:
|
174
|
+
recorded_at: Fri, 06 Dec 2013 16:15:19 GMT
|
175
175
|
recorded_with: VCR 2.8.0
|
data/spec/cassettes/ups.yml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: http://liebert1.bobst.nyu.edu/graphic/smallUps.htm
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -216,7 +216,7 @@ http_interactions:
|
|
216
216
|
<td>Volts:</td><td></td><td><script language="JavaScript" type="text/javascript">if(deviceInfo.numInputLines <= 1)document.write("V");</script>
|
217
217
|
</td><td></td><td class="unitColumnStyle"><script language="JavaScript" type="text/javascript">if(deviceInfo.numInputLines >= 3)document.write("V");</script></td></tr><tr id="InputAmps" class="inputAmps">
|
218
218
|
<td>Amps:</td><td>16.4 </td><td class="unitColumnStyle">A</td></tr><tr>
|
219
|
-
<td>Freq:</td><td>60.
|
219
|
+
<td>Freq:</td><td>60.0 </td><td class="unitColumnStyle">Hz</td></tr></table></center></td></tr></table></div><div id="Output" class="upsOutputArea">
|
220
220
|
<table border="1">
|
221
221
|
<tr><td><center>
|
222
222
|
<a href="../monitor/upsOutput.htm"><b>OUTPUT</b></a><table border="0" width="135" align=center cellspacing="0" cellpadding="1">
|
@@ -269,5 +269,5 @@ http_interactions:
|
|
269
269
|
|
270
270
|
</body></html>
|
271
271
|
http_version:
|
272
|
-
recorded_at:
|
272
|
+
recorded_at: Fri, 06 Dec 2013 16:15:19 GMT
|
273
273
|
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Command Line' do
|
4
|
+
it 'should respond when no parameters are passed' do
|
5
|
+
command_line = %x( liebert ac )
|
6
|
+
expect(command_line).to include "Temperature\t"
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'should respond when parameters are passed' do
|
10
|
+
command_line = %x( liebert ups --charge )
|
11
|
+
expect(command_line).to include "Charge\t"
|
12
|
+
end
|
13
|
+
end
|
data/spec/ups_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liebert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooks Swinnerton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -131,6 +131,7 @@ extensions: []
|
|
131
131
|
extra_rdoc_files: []
|
132
132
|
files:
|
133
133
|
- .gitignore
|
134
|
+
- .travis.yml
|
134
135
|
- Gemfile
|
135
136
|
- LICENSE.txt
|
136
137
|
- README.md
|
@@ -145,6 +146,7 @@ files:
|
|
145
146
|
- spec/airconditioner_spec.rb
|
146
147
|
- spec/cassettes/airconditioner.yml
|
147
148
|
- spec/cassettes/ups.yml
|
149
|
+
- spec/command_line_spec.rb
|
148
150
|
- spec/scrapable_spec.rb
|
149
151
|
- spec/spec_helper.rb
|
150
152
|
- spec/support/vcr.rb
|
@@ -177,6 +179,7 @@ test_files:
|
|
177
179
|
- spec/airconditioner_spec.rb
|
178
180
|
- spec/cassettes/airconditioner.yml
|
179
181
|
- spec/cassettes/ups.yml
|
182
|
+
- spec/command_line_spec.rb
|
180
183
|
- spec/scrapable_spec.rb
|
181
184
|
- spec/spec_helper.rb
|
182
185
|
- spec/support/vcr.rb
|