liebert 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23d26ab854e1a08dec090e0ff88ca0cf95327242
4
- data.tar.gz: d3854f707aaefa2ca5c3e195e18e044135b2db9f
3
+ metadata.gz: 268acf0ef9c9ff3310ea45d227dbf9176cb4b62d
4
+ data.tar.gz: 761189f5479a41bba0639bd9104710a129cfa3de
5
5
  SHA512:
6
- metadata.gz: 7e6a66dd848b911e0529cadcbca7470676ce528b752109918f7408ea2d337d84b501d4758185acb040f0d5c34bf99a7a0585e2d5d66558eb15f3eef837146342
7
- data.tar.gz: 5332b7bf0a0660a6e93ca4c3df204ef5bd1c8797cf600418bbffc2815f40e207c01e69e8dc573a1925a192864dfa53b6121251e86deee82cce6099ae611cf89b
6
+ metadata.gz: 8e96ca7007293d8a4fefa7d1a29a61d58da2c08cd58c8f105df9a23c603e412b5591503a51727034342915ed7856596329f7c152739dd9d521db4a3efa7bfc47
7
+ data.tar.gz: 3b7eebf2137dff8d7379d4d0fc9ee65a6c6feaf0a065fbbb0bc8239b2ffb1e300c959a5900424d902e6ee18af6fe7dc6b56ab5c69a2613c3f1ca2650204ea482
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Liebert
2
2
  [![Build Status](https://travis-ci.org/bswinnerton/liebert.png)](https://travis-ci.org/bswinnerton/liebert)
3
+ [![Dependency Status](https://gemnasium.com/bswinnerton/liebert.png)](https://gemnasium.com/bswinnerton/liebert)
3
4
  [![Code Climate](https://codeclimate.com/github/bswinnerton/liebert.png)](https://codeclimate.com/github/bswinnerton/liebert)
4
5
 
5
6
  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/).
@@ -31,8 +31,12 @@ module Scrapable
31
31
  begin
32
32
  response = RestClient.get(self.endpoint_uri)
33
33
  @parsed_response = Nokogiri::HTML.parse(response.body)
34
- rescue
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"
34
+ rescue ArgumentError
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
+ rescue URI::InvalidURIError
37
+ raise 'You\'ve set an invalid hostname in your environemnt variable'
38
+ rescue SocketError
39
+ raise "Unable to contact liebert unit at #{self.endpoint_uri}"
36
40
  end
37
41
  end
38
42
  @parsed_response
@@ -1,3 +1,3 @@
1
1
  module Liebert
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -1,8 +1,14 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Scrapable do
4
- it 'tells the user they forgot to enter a URI' do
4
+ it 'tells the user they forgot to enter a hostname' do
5
5
  ac = AirConditioner.new
6
- expect { ac.temperature }.to raise_error
6
+ expect { ac.temperature }.to raise_error(RuntimeError, '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')
7
+ end
8
+
9
+ it 'gracefully fails when it cannot contact the liebert unit' do
10
+ liebert_hostname = 'notaliebertunit.bobst.nyu.edu'
11
+ ac = AirConditioner.new(liebert_hostname)
12
+ expect { ac.temperature }.to raise_error(RuntimeError, "Unable to contact liebert unit at #{ac.endpoint_uri}")
7
13
  end
8
14
  end
@@ -1,6 +1,7 @@
1
1
  VCR.configure do |c|
2
2
  c.cassette_library_dir = 'spec/cassettes'
3
3
  c.hook_into :webmock
4
+ c.ignore_hosts 'notaliebertunit.bobst.nyu.edu'
4
5
  c.filter_sensitive_data('<AIRCONDITIONER_URI>') { ENV['LIEBERT_AIRCONDITIONER_URI'] }
5
6
  c.filter_sensitive_data('<UPS_URI>') { ENV['LIEBERT_UPS_URI'] }
6
7
  c.configure_rspec_metadata!
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.5
4
+ version: 0.0.6
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-06 00:00:00.000000000 Z
11
+ date: 2013-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler