deepstack 1.1.1 → 1.2.0

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: b13995c10316b274d2b292316076cf96c96f945ac7304835ca5dc25fd873eaeb
4
- data.tar.gz: 585b76987b8d1db73e05e78b777bf6fcd716e38f40c7c1e9b9150a7c833d84ec
3
+ metadata.gz: caf4cf801a5a99ff308e5afc06ed19dac86d8348388c519880770d482fd1bb0b
4
+ data.tar.gz: de77bacb1bd1ffb46c4dff277ab16e1195ef423f005ad98394b49cab6e248fa3
5
5
  SHA512:
6
- metadata.gz: 41f4207559f4976ebf42864186661a538f6d45978958ec22a951c2e1ddac17685c67a2050de1064fe070c10f39fd9d3b954807be40bd04b14be5cf4e24221e5c
7
- data.tar.gz: ceac07d54df401e92619d2c48e493ced1e6b2543a71bfe8dc79ccb5b1be53e34aa96d38eaf395b6bfbd919739c7476a886fac54fdb1fb9bf945a60cce6c0bba4
6
+ metadata.gz: 6836c3bc1e6dc367542c4bd9e3e089ddf2cf3a7e612d6230dfabf3f3a38a4651965eead00bba50dd5916e5a9d8fcc44c624f3743b17165fbda24cff8c9ea7ec8
7
+ data.tar.gz: 5f5c98987f6fae82a67ef8fa57a557aa300bd22da6108a8575eabe6e3ac8d1f301f57caad1f86b533629b503d53db4bb40e101ff630abddce1b2659637e2b177
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'pp'
4
3
  require 'net/http'
5
4
  require 'json'
6
5
  require_relative 'face'
@@ -16,9 +15,19 @@ class DeepStack
16
15
  include DeepStack::Scene
17
16
  include DeepStack::Custom
18
17
 
18
+ #
19
19
  # Create a deepstack object connected to the given URL
20
- def initialize(base_url)
20
+ #
21
+ # @param [String] base_url the url to DeepStack's server:port
22
+ # @param [String] api_key an optional API-KEY to use when connecting to DeepStack
23
+ # @param [String] admin_key an optional ADMIN-KEY to use when connecting to DeepStack
24
+ #
25
+ # @example
26
+ # DeepStack.new('http://127.0.0.1:5000')
27
+ #
28
+ def initialize(base_url, api_key: nil, admin_key: nil)
21
29
  @base_url = base_url
30
+ @auth = { api_key: api_key, admin_key: admin_key }.select { |_k, v| v } # remove nil values
22
31
  @http_mutex = Mutex.new
23
32
  end
24
33
 
@@ -33,6 +42,7 @@ class DeepStack
33
42
  #
34
43
  def api_post(path, *images, **args)
35
44
  uri = build_uri(path)
45
+ args = @auth.merge(args)
36
46
 
37
47
  result = nil
38
48
  10.times do
@@ -5,5 +5,5 @@
5
5
  #
6
6
  class DeepStack
7
7
  # @return [String] Version of DeepStack helper libraries
8
- VERSION = '1.1.1'
8
+ VERSION = '1.2.0'
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deepstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Tanagra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-10 00:00:00.000000000 Z
11
+ date: 2022-05-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: