nova-api 1.4.3 → 1.4.6

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: ade5522e27034c1d827abb8890c13526e70b4e827af7ec55065953768ba0359b
4
- data.tar.gz: 83a1ebc2c75b187d7173d1dde47e88298e5e3c40f77cbbe9364ca52da50e58f4
3
+ metadata.gz: 4a236ca75cc785c3010e6fc1b9992038318cdb1518ea54d864e0e8fb21bee85d
4
+ data.tar.gz: d1d5eef3db768d89f0dd9b9fb6884bcd0ddd5fa473e7a6098d210d739fc6f738
5
5
  SHA512:
6
- metadata.gz: 9d9bc983dbe38b9ffe7da9a9f13ac1f5b98804e2b1d5cc1180cd8d58237084c0b94622d6929700f7eb7fda5cb4c92cc02538b0a82513531deb7724a6d76d34c0
7
- data.tar.gz: d6a70c102842e9493a3a7d8bab966ff84c5c189f4819a5ed9c7ffde0ca374f3f3afbb5229e13bdbf579c6f7240046b50e4eaf3a19be74c4b1664818a9489b42d
6
+ metadata.gz: c84eaff31e3cec92bd7675cfa395ef5723e49d95d6137e2b921157e528e8afc7ab6ab178c4f5dd88ebbbbc1f9a25f310808db0799bdfd695aa84e708ae1edba1
7
+ data.tar.gz: 22018019dd877ca2c2162108abb456695793c191276caa0c8bfcde3d9ef067b36a04d75b342afc123c0a3073e7c35bfd62a6437c280fce6e60cc896708b36f55
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nova-api (1.4.3)
4
+ nova-api (1.4.6)
5
5
  dry-struct (~> 1.6)
6
6
  dry-types (~> 1.7)
7
7
  httparty (~> 0.1)
data/lib/nova/api/base.rb CHANGED
@@ -46,7 +46,7 @@ module Nova
46
46
  def do_delete(endpoint)
47
47
  set_base_uri
48
48
 
49
- Kernel.p "[NOVA-API] Issuing DELETE to #{endpoint}, headers: #{authorization_header}" if configuration.debug?
49
+ Kernel.p "[NOVA-API] Issuing DELETE to #{self.class.base_uri}#{endpoint}, headers: #{authorization_header}" if configuration.debug?
50
50
 
51
51
  response = self.class.delete(endpoint, headers: authorization_header)
52
52
 
@@ -56,7 +56,7 @@ module Nova
56
56
  def do_patch(endpoint, data)
57
57
  set_base_uri
58
58
 
59
- Kernel.p "[NOVA-API] Issuing PATCH to #{endpoint}, headers: #{authorization_header}" if configuration.debug?
59
+ Kernel.p "[NOVA-API] Issuing PATCH to #{self.class.base_uri}#{endpoint}, headers: #{authorization_header}" if configuration.debug?
60
60
 
61
61
  if data.nil? || data.empty?
62
62
  response = self.class.patch(endpoint, headers: authorization_header)
@@ -75,7 +75,7 @@ module Nova
75
75
  def do_post(endpoint, data)
76
76
  set_base_uri
77
77
 
78
- Kernel.p "[NOVA-API] Issuing POST to #{endpoint}, headers: #{authorization_header}" if configuration.debug?
78
+ Kernel.p "[NOVA-API] Issuing POST to #{self.class.base_uri}#{endpoint}, headers: #{authorization_header}" if configuration.debug?
79
79
 
80
80
  response = self.class.post(endpoint, body: data, headers: authorization_header)
81
81
 
@@ -91,7 +91,7 @@ module Nova
91
91
  def self.perform_get(endpoint, query, headers = {})
92
92
  set_base_uri
93
93
 
94
- Kernel.p "[NOVA-API] Issuing GET to #{endpoint}, headers: #{headers.merge(authorization_header)}" if configuration.debug?
94
+ Kernel.p "[NOVA-API] Issuing GET to #{base_uri}#{endpoint}, headers: #{headers.merge(authorization_header)}" if configuration.debug?
95
95
 
96
96
  response =
97
97
  if query
@@ -112,9 +112,13 @@ module Nova
112
112
  def_delegator self, :configuration
113
113
 
114
114
  def self.set_base_uri
115
- base_uri base_url
115
+ if configuration.debug?
116
+ debug_output $stdout
116
117
 
117
- debug_output $stdout if configuration.debug?
118
+ Kernel.p "[NOVA-API] Changing base URI from #{base_uri} to #{base_url}"
119
+ end
120
+
121
+ default_options[:base_uri] = base_url
118
122
  end
119
123
  def_delegator self, :set_base_uri
120
124
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nova
4
4
  module API
5
- VERSION = '1.4.3'
5
+ VERSION = '1.4.6'
6
6
  end
7
7
  end
@@ -1,9 +1,14 @@
1
1
  module Nova
2
2
  module API
3
3
  class Configuration
4
- attr_accessor :api_key, :subdomain, :use_staging, :debug
5
- attr_reader :host
6
- attr_reader :scheme
4
+ attr_accessor :api_key, :use_staging, :debug
5
+ attr_reader :subdomain
6
+
7
+ def subdomain=(value)
8
+ Kernel.p "[NOVA-API] Changed subdomain from #{@subdomain} to #{value}" if debug?
9
+
10
+ @subdomain = value
11
+ end
7
12
 
8
13
  def use_staging?
9
14
  [true, 'true'].include?(use_staging)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nova-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coyô Software
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-03 00:00:00.000000000 Z
11
+ date: 2024-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler