harness 0.8.0 → 0.8.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67b81f429da2eb6cf620c80daad0b9fb2a978d30
|
4
|
+
data.tar.gz: 1f590d74d8e61a6e6ab191a3a0180be4eb54217c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
-
|
63
|
+
if response.code.to_i != 200
|
58
64
|
text = %Q{
|
59
65
|
Server Said: #{response.body}
|
60
66
|
Sent: #{params.inspect}
|
data/lib/harness/version.rb
CHANGED
@@ -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::
|
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::
|
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.
|
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-
|
11
|
+
date: 2013-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|