ninja_van 1.0.1 → 1.0.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: 8297ee72de90f1aae35dbcc55e45c9c4ef45cc7e33b2321b79297c00fb2141c4
4
- data.tar.gz: f58ec85f3f33df65945cc92050efc24c53b5d389ad50176ada56daf6ad8266c7
3
+ metadata.gz: 24cf8abca79243b87cd06e79481b85b96777e1c7e36361635463dfe8a259cc8b
4
+ data.tar.gz: 2950dd4e494f3c80116717c0c3495096d0f6b066fdbb93684e9cdce6e9e88c14
5
5
  SHA512:
6
- metadata.gz: 072717163c7434eb40c9fcb554885f31def5fb57dc24f7dd5f833d663038ba20397ea20db77c6bd2e4de8c512cfcd342775e99384c231bcf361a592e5f71953e
7
- data.tar.gz: d7cb4fd454c269e87f89a53a7307d7b93bc9cf1c1d5314df94ec474424ae62c021c6f3a00becf4559c0c01adc1748ea53995355ffddb737d1686451a98d7b237
6
+ metadata.gz: 5e101edfb951230b42b63d2564c68b63f48f80875e32856b40e92fde5b5132b93d068e0c564be5087d4057febf2ddd4b05439ad92e5b5af43dc0581c0fffba86
7
+ data.tar.gz: 66cb594484960dc377fe76da10aebfed0c5bd4b34fdd92c9d86dff3877079e68057c09647d4f483b3643d8fa00650c34a1b20ea858ea3ae439dd400d9d9afe03
@@ -1,9 +1,11 @@
1
+ require "http"
2
+
1
3
  module NinjaVan
2
4
  class Request
3
5
 
4
6
  def self.post(endpoint, params={})
5
7
  full_endpoint = "#{NinjaVan.setup.require!(:domain)}#{endpoint}"
6
- response = Http.headers(content_type: 'application/json', accept: 'application/json')
8
+ response = HTTP.headers(content_type: 'application/json', accept: 'application/json')
7
9
  .auth("Bearer #{NinjaVan.setup.get_token_from_cache}")
8
10
  .post(full_endpoint, json: params)
9
11
  raise NinjaVan::ForbiddenError.new(full_endpoint) if response.code == 403
@@ -14,7 +16,7 @@ module NinjaVan
14
16
 
15
17
  def self.post_without_token(endpoint, params={})
16
18
  full_endpoint = "#{NinjaVan.setup.require!(:domain)}#{endpoint}"
17
- response = Http.headers(content_type: 'application/json', accept: 'application/json')
19
+ response = HTTP.headers(content_type: 'application/json', accept: 'application/json')
18
20
  .post(full_endpoint, json: params)
19
21
  raise NinjaVan::ForbiddenError.new(full_endpoint) if response.code == 403
20
22
  raise NinjaVan::ServerError.new(full_endpoint) if response.code == 500
@@ -24,7 +26,7 @@ module NinjaVan
24
26
 
25
27
  def self.get(endpoint, params={})
26
28
  full_endpoint = "#{NinjaVan.setup.require!(:domain)}#{endpoint}"
27
- response = Http.headers(content_type: 'application/json', accept: 'application/json')
29
+ response = HTTP.headers(content_type: 'application/json', accept: 'application/json')
28
30
  .auth("Bearer #{NinjaVan.setup.get_token_from_cache}")
29
31
  .get(full_endpoint, params: params)
30
32
  raise NinjaVan::ForbiddenError.new(full_endpoint) if response.code == 403
@@ -35,7 +37,7 @@ module NinjaVan
35
37
 
36
38
  def self.delete(endpoint, params={})
37
39
  full_endpoint = "#{NinjaVan.setup.require!(:domain)}#{endpoint}"
38
- response = Http.headers(content_type: 'application/json', accept: 'application/json')
40
+ response = HTTP.headers(content_type: 'application/json', accept: 'application/json')
39
41
  .auth("Bearer #{NinjaVan.setup.get_token_from_cache}")
40
42
  .delete(full_endpoint, params: params)
41
43
  raise NinjaVan::ForbiddenError.new(full_endpoint) if response.code == 403
@@ -1,3 +1,3 @@
1
1
  module NinjaVan
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
data/lib/ninja_van.rb CHANGED
@@ -1,4 +1,3 @@
1
- require "http"
2
1
  require "ninja_van/support/hash"
3
2
  require "ninja_van/version"
4
3
  require "ninja_van/error"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ninja_van
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - KhoaRB
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-24 00:00:00.000000000 Z
11
+ date: 2023-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,7 +105,7 @@ metadata:
105
105
  bug_tracker_uri: https://github.com/ThanhKhoaIT/ninja_van/issues
106
106
  wiki_uri: https://github.com/ThanhKhoaIT/ninja_van/wiki
107
107
  changelog_uri: https://github.com/ThanhKhoaIT/ninja_van/releases
108
- post_install_message:
108
+ post_install_message:
109
109
  rdoc_options: []
110
110
  require_paths:
111
111
  - lib
@@ -120,9 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubyforge_project:
124
- rubygems_version: 2.7.10
125
- signing_key:
123
+ rubygems_version: 3.2.3
124
+ signing_key:
126
125
  specification_version: 4
127
126
  summary: NinjaVan API Caller for Ruby
128
127
  test_files: []