howareya 0.1.2 → 0.1.3
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/howareya.rb +5 -0
- data/lib/howareya/configuration.rb +5 -0
- data/lib/howareya/errors.rb +7 -1
- data/lib/howareya/version.rb +1 -1
- 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: f126170d244787a7a219610a93000982925f093d
|
|
4
|
+
data.tar.gz: ca89cc561d0689cd0e1df606e132dc895931b634
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7aa38bba361888e74d9d7a062450825e14dde0382015dec7e4bd5628d394dc00424d76fad9ffe4e17b96bb43824ea2d10c721ed2c772a17697ef197af1b8f722
|
|
7
|
+
data.tar.gz: 18e1210e2d8220427a7c9b2136976ee1ee86bdbc4c00971da05e8bcd9c41dcbbc78a8a301e6b5fe1cc381275e5b35c8f420db6e3f05298c4f23da71065996727
|
data/lib/howareya.rb
CHANGED
|
@@ -20,7 +20,12 @@ module Howareya
|
|
|
20
20
|
{ api_key: @configuration.api_key, url: @configuration.url}
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
def self.reset_configuration
|
|
24
|
+
@configuration.reset
|
|
25
|
+
end
|
|
26
|
+
|
|
23
27
|
def self.record_metric key, value
|
|
28
|
+
raise Howareya::MissingConfigError unless @configuration.url && @configuration.api_key
|
|
24
29
|
response = ::HTTParty.post(@configuration.url, :body => { :api_key => @configuration.api_key,
|
|
25
30
|
:key => key,
|
|
26
31
|
:value => value })
|
data/lib/howareya/errors.rb
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
module Howareya
|
|
2
|
+
class MissingConfigError < StandardError
|
|
3
|
+
def initialize(msg="It looks like you haven't set up the config for Howareya")
|
|
4
|
+
super
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
|
|
2
8
|
class MissingMetricError < StandardError
|
|
3
|
-
def initialize(msg="It looks like you
|
|
9
|
+
def initialize(msg="It looks like you haven't registered a metric at Howareya")
|
|
4
10
|
super
|
|
5
11
|
end
|
|
6
12
|
end
|
data/lib/howareya/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: howareya
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Anders Fisher
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-03-
|
|
11
|
+
date: 2019-03-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|