harness 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54d0f17083fab798f91fd9ef53723d8ba9b043e5
4
- data.tar.gz: d32c8251b440a1baac09dc8b02af02a008a3d5e2
3
+ metadata.gz: 67b81f429da2eb6cf620c80daad0b9fb2a978d30
4
+ data.tar.gz: 1f590d74d8e61a6e6ab191a3a0180be4eb54217c
5
5
  SHA512:
6
- metadata.gz: 373a966fa9e100347e615dc254ec68d21a310b4db9816041d88d0bf44f88f68e7a2e82c57e27af6d95890020ecd9f36b8e114b518bd242da86b427b5a301483a
7
- data.tar.gz: 2897bcf4344ce24755ac65f82186cf452d7fa9f95f9c5c478bd82752912a5e922864d28bfb52ef0f10921d5020cddda45eae00a91c0cb8a0f2d1a4810525ab7c
6
+ metadata.gz: 132daddd9725611539455ccbf387b0e86f2431d3a9b79907c3e39b309818a96d6d74b6a0698a0f22a7cdbe35925a6ea733d201f18ecacdce6cd703bfcfb942a2
7
+ data.tar.gz: 5e3a47b69a9a3fd4aaa7997bcbe8930176518fa07ebd895e72721ee4fe33e5623430836b96aba66b3abd876c16cc9030d4ce8f517b2333c93485c2862789fe9d
@@ -3,6 +3,12 @@ require 'net/http'
3
3
 
4
4
  module Harness
5
5
  class LibratoAdapter
6
+ class NameTooLong < Harness::LoggingError
7
+ def to_s
8
+ "Name cannot be more than 63 characters long"
9
+ end
10
+ end
11
+
6
12
  class Config
7
13
  attr_accessor :email, :token
8
14
  end
@@ -12,7 +18,7 @@ module Harness
12
18
  end
13
19
 
14
20
  def log_gauge(gauge)
15
- raise Harness::LoggingError if gauge.id.length > 63
21
+ raise NameTooLong if gauge.id.length > 63
16
22
 
17
23
  post({:gauges => [{
18
24
  :name => sanitize(gauge.id),
@@ -25,7 +31,7 @@ module Harness
25
31
  end
26
32
 
27
33
  def log_counter(counter)
28
- raise Harness::LoggingError if counter.id.length > 63
34
+ raise NameTooLong if counter.id.length > 63
29
35
 
30
36
  post({:counters => [{
31
37
  :name => sanitize(counter.id),
@@ -54,7 +60,7 @@ module Harness
54
60
 
55
61
  response = http.request request
56
62
 
57
- unless response.code.to_i == 200
63
+ if response.code.to_i != 200
58
64
  text = %Q{
59
65
  Server Said: #{response.body}
60
66
  Sent: #{params.inspect}
@@ -1,3 +1,3 @@
1
1
  module Harness
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
@@ -77,7 +77,7 @@ class LibratoAdapterTest < MiniTest::Unit::TestCase
77
77
  def test_logging_gauge_raises_an_exception_when_id_is_too_long
78
78
  @gauge.id = "f" * 64
79
79
 
80
- assert_raises Harness::LoggingError do
80
+ assert_raises Harness::LibratoAdapter::NameTooLong do
81
81
  @adapter.log_gauge @gauge
82
82
  end
83
83
  end
@@ -153,7 +153,7 @@ class LibratoAdapterTest < MiniTest::Unit::TestCase
153
153
  def test_logging_counter_raises_an_exception_when_id_is_too_long
154
154
  @counter.id = "f" * 64
155
155
 
156
- assert_raises Harness::LoggingError do
156
+ assert_raises Harness::LibratoAdapter::NameTooLong do
157
157
  @adapter.log_counter @counter
158
158
  end
159
159
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ahawkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-24 00:00:00.000000000 Z
11
+ date: 2013-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport