supergood 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: 37e6e9b772961c8468ce6b56f08b88e16f6be31e22b123ec629695da7a1d0e06
4
- data.tar.gz: 57497dfc8b8609f8e97c063079e908db68252cce6d59bb5ff80096fee39873e2
3
+ metadata.gz: a20e9c78ef66594eaed117db23b1581b3531497aaf3a087ad92466f76a8e07a8
4
+ data.tar.gz: 22e62c82c3cea5bfba10a8d5199ebf1a385bab78861c6f20efcd55921e65eee0
5
5
  SHA512:
6
- metadata.gz: 35716cb5a956905973fb36193e13fa57527184291ee6f557d721f01dac2d7e53c139fdf924b4a2c68a568aec9dcc909cdf0ba8e40f6ac6a99945841de1685bc0
7
- data.tar.gz: 40d19c986a555912c4e7040f4bf2d4ee57680738c3506ae6c341f771b60ed1e51fa3c8fb4f3482469f898e493e165d9b2e8bc969188f25ffb488e64ee6250bb8
6
+ metadata.gz: da801337729a2975cd42231da0de2e773aafdcc0a391a69111b4acb55dfe1d8126e1017e72481688dcf410d23a072c51204e9885e8938d9903ed1f947de94bfc
7
+ data.tar.gz: b9848d4363bcb7b04bb19b46dc61f8adcb8bbf9b911664a3ba367721f171e2ad950c3fdcb3d236192fe5c160e4d33aa926615583647c7b3e44b0038fc4ed6c27
data/README.md CHANGED
@@ -12,7 +12,7 @@ gem install supergood
12
12
 
13
13
  **Environment variables**
14
14
 
15
- Set the environment variables `SUPERGOOD_CLIENT_ID` and `SUPERGOOD_CLIENT_SECRET` using the API keys generated in the [getting started instructions](../../getting-started.md).
15
+ Set the environment variables `SUPERGOOD_CLIENT_ID` and `SUPERGOOD_CLIENT_SECRET` using the API keys generated in the [getting started instructions](https://github.com/supergoodsystems/docs/blob/main/getting-started.md).
16
16
 
17
17
  Initialize the Supergood client at the root of your application, or anywhere you're making API calls with the following code:
18
18
 
@@ -26,7 +26,7 @@ Supergood.init()
26
26
 
27
27
  You can also pass the API keys in manually without setting environment variables.\
28
28
  \
29
- Replace `<CLIENT_ID>` and `<CLIENT_SECRET>` with the API keys you generated in the [getting started instructions](../../getting-started.md).
29
+ Replace `<CLIENT_ID>` and `<CLIENT_SECRET>` with the API keys you generated in the [getting started instructions](https://github.com/supergoodsystems/docs/blob/main/getting-started.md).
30
30
 
31
31
  ```ruby
32
32
  require 'supergood'
data/lib/supergood/api.rb CHANGED
@@ -29,7 +29,7 @@ module Supergood
29
29
  if @local_only
30
30
  @log.debug(payload)
31
31
  else
32
- uri = URI(@base_url + '/api/events')
32
+ uri = URI(@base_url + '/events')
33
33
  response = Net::HTTP.post(uri, payload.to_json, @header_options)
34
34
  if response.code == '200'
35
35
  return JSON.parse(response.body, symbolize_names: true)
@@ -45,7 +45,7 @@ module Supergood
45
45
  if @local_only
46
46
  @log.debug(payload)
47
47
  else
48
- uri = URI(@base_url + '/api/errors')
48
+ uri = URI(@base_url + '/errors')
49
49
  response = Net::HTTP.post(uri, payload.to_json, @header_options)
50
50
  if response.code == '200'
51
51
  return JSON.parse(response.body, symbolize_names: true)
@@ -11,7 +11,7 @@ Dotenv.load
11
11
 
12
12
  module Supergood
13
13
 
14
- DEFAULT_SUPERGOOD_BASE_URL = 'https://dashboard.supergood.ai'
14
+ DEFAULT_SUPERGOOD_BASE_URL = 'https://api.supergood.ai'
15
15
  class << self
16
16
  def init(config={})
17
17
  supergood_client_id = config[:client_id] || ENV['SUPERGOOD_CLIENT_ID']
@@ -120,11 +120,13 @@ module Supergood
120
120
  request_id = SecureRandom.uuid
121
121
  requested_at = Time.now
122
122
  if !ignored?(request[:domain])
123
+ puts "Caching Request"
123
124
  cache_request(request_id, requested_at, request)
124
125
  end
125
126
 
126
127
  response = yield
127
128
  if !ignored?(request[:domain]) && defined?(response)
129
+ puts "Caching Response"
128
130
  cache_response(request_id, requested_at, response)
129
131
  end
130
132
 
@@ -1,3 +1,3 @@
1
1
  module Supergood
2
- VERSION = '0.1.4'.freeze
2
+ VERSION = '0.1.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: supergood
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Klarfeld