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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0838bbb7b602377e64b923a7aa63878e6acd80dc
4
- data.tar.gz: 71e2ae701b964c380e8c83cf6edce0874a3296b7
3
+ metadata.gz: f126170d244787a7a219610a93000982925f093d
4
+ data.tar.gz: ca89cc561d0689cd0e1df606e132dc895931b634
5
5
  SHA512:
6
- metadata.gz: f1e36cd73b25e0c6baf1d72bc17d4e121a3ac6aec32cc987ae953b659a11c7a4aa5596db02637b6d47d0cd60ff6e8ece218c322fbeb155e34bfe65e3c56a2e29
7
- data.tar.gz: 7b995361cb2c05bebddbfb230b6230fe7f6742402fde34b06ced0679e68ec9795bd017915b689ac1bf1f2a15bc9c4e8136e6c20dfe9699afc322084992a1d2fa
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 })
@@ -6,6 +6,11 @@ module Howareya
6
6
  @api_key = nil
7
7
  @url = nil
8
8
  end
9
+
10
+ def reset
11
+ @api_key = nil
12
+ @url = nil
13
+ end
9
14
  end
10
15
  end
11
16
 
@@ -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 havent registered a metric at Howareya")
9
+ def initialize(msg="It looks like you haven't registered a metric at Howareya")
4
10
  super
5
11
  end
6
12
  end
@@ -1,3 +1,3 @@
1
1
  module Howareya
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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-13 00:00:00.000000000 Z
11
+ date: 2019-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler