unit-ruby 0.2.1 → 0.2.2

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
  SHA256:
3
- metadata.gz: 2d8b81813df88504ba14e65cf47043260ab206244c8dc2eb495ce96cef2727f5
4
- data.tar.gz: 51d8b938a7f1662f8cc6d2f5c107ef28a711db4e228fdace953940c10bc2b342
3
+ metadata.gz: b94f80691a58f913f1859f9e9464e5c592e40449be00c16100865ada442276fe
4
+ data.tar.gz: c460db2362676311a5a461dc4dc267ae2b54ca4138806c8c1465000a0c172a5a
5
5
  SHA512:
6
- metadata.gz: 3bd7d484fe87d3ea9142bea165e1f28e4b9cd934830afca036b062805a15c8e2b044f92fb1fc6446bd009388c1477f099d2a43ae390bf22bb2bd63e00f359dec
7
- data.tar.gz: ea891a1b6445b49faa3e2891204fea3e255d6b27b6008942cb097ebcc682d33920da28ee040551e8fcbedfedb238081e8ae7a33facadea3ebd5a1356a5a91ab5
6
+ metadata.gz: fa5b025aa039ee66ada9bbd5d480553378f7c31a6f1e4687d0bc112c4427eab391aeba75f2979485b12d6a2e9844bfb9b944e6a1f404eb4d10cff63034532e29
7
+ data.tar.gz: 5aba68f5f9ebb354a3f158d72183897304de9f7d5e9e7ff0c377517443afc478da0202507cfb7067fe683d63140bd8b53aea83582af1a25b6a8f039c26c8dfad
data/README.md CHANGED
@@ -28,6 +28,7 @@ require 'unit-ruby'
28
28
  Unit.configure do |config|
29
29
  config.api_key = ENV['UNIT_API_KEY']
30
30
  config.base_url = ENV['UNIT_BASE_URL']
31
+ config.trust_token = ENV['UNIT_TRUST_TOKEN] # optional
31
32
  end
32
33
 
33
34
  ```
@@ -5,13 +5,14 @@ require 'active_support/core_ext/hash'
5
5
  module Unit
6
6
  class Connection
7
7
  class << self
8
- attr_accessor :api_key, :base_url
8
+ attr_accessor :api_key, :base_url, :trust_token
9
9
  end
10
10
 
11
11
  attr_reader :connection
12
12
 
13
13
  def initialize
14
14
  @connection = Faraday.new(self.class.base_url) do |f|
15
+ f.headers['UNIT_TRUST_TOKEN'] = self.class.trust_token if self.class.trust_token
15
16
  f.headers['Authorization'] = "Bearer #{self.class.api_key}"
16
17
  f.request :json # encode req bodies as JSON
17
18
  f.request :retry # retry transient failures
@@ -1,3 +1,3 @@
1
1
  module Unit
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
data/lib/unit-ruby.rb CHANGED
@@ -38,6 +38,7 @@ module Unit
38
38
  # Unit.configure do |config|
39
39
  # config.api_key = '<your api key>'
40
40
  # config.base_url = 'https://api.s.unit.sh'
41
+ # config.trust_token = '<your trust token key>'
41
42
  # end
42
43
  def self.configure
43
44
  yield(Connection)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unit-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chloe Isacke
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-03-17 00:00:00.000000000 Z
12
+ date: 2022-03-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport