api_proxy 0.2.3 → 0.2.4
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/api_proxy/client.rb +26 -0
- data/lib/api_proxy/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4acf429f00bd4f21e26be48a06d25779105a8e1b4c273f277f8f0aa02ef4f149
|
4
|
+
data.tar.gz: b21eff23b34c8f9853de56e5f9b3b596bad320ac7993254dc85549222c366cf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed26b41bf56975a1eeda45abb4e36309c35e419cb6adf2ac29a9b4cbdd0c7feed899b8c87aa62b98dade566d97df48ade5a1f20cfa99ae3264c5d7e1ba39bb82
|
7
|
+
data.tar.gz: b0b44756095ab46be7696277f4a29d3fa3b163323bdd534aba9fbb4f733d65148a41e5689e100f017ccfe1beb78bc952a98b0a62999b95e497fd28ef25df4bda
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ApiProxy
|
4
|
+
class Client
|
5
|
+
def initialize(options = {})
|
6
|
+
@options = { namespace: :default }.merge(options)
|
7
|
+
end
|
8
|
+
|
9
|
+
[:get, :post, :patch, :put, :delete].each do |type|
|
10
|
+
define_method type do |path, options = {}|
|
11
|
+
perform_request(type, path, options)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def perform_request(type, path, options)
|
18
|
+
options = @options.merge(options)
|
19
|
+
|
20
|
+
config = ApiProxy.configuration(options[:namespace])
|
21
|
+
url = File.join(config.api_url, path)
|
22
|
+
|
23
|
+
ApiProxy::SignedRequest.new(type, url, options).perform
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/api_proxy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Malinovskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -214,6 +214,7 @@ files:
|
|
214
214
|
- bin/console
|
215
215
|
- bin/setup
|
216
216
|
- lib/api_proxy.rb
|
217
|
+
- lib/api_proxy/client.rb
|
217
218
|
- lib/api_proxy/config.rb
|
218
219
|
- lib/api_proxy/headers_filter.rb
|
219
220
|
- lib/api_proxy/middleware.rb
|