kongkit 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +9 -0
- data/lib/kongkit/client.rb +3 -11
- data/lib/kongkit/version.rb +1 -1
- data/lib/kongkit.rb +3 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27a07fb91dbdac22f631ed9bca8c944cd2284b33
|
4
|
+
data.tar.gz: fc36610fb68f67d070ad0643bf3f3989f930ba30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 192a2966df0a1aaf62f6a79c2baee1e1a47c8548e117af52680126e42ba7a11fdac78d6050734ca0b3b45b9ed0bc6debc748d6d5176446a771ae52a3ae77e615
|
7
|
+
data.tar.gz: dcad30e65b60ba31e435973952bc1587f5b0a962888a0c6080c803b969c1b281b214c07adf94bdd3ccc3a1430722913883a05286f976e6cfc7298340bfa7f557
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -49,6 +49,15 @@ first_page = Kongkit.apis(size: 5)
|
|
49
49
|
next_page = first_page.next
|
50
50
|
```
|
51
51
|
|
52
|
+
### Configuration
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
Kongkit.configure do |config|
|
56
|
+
config.url = 'https://kong.enterprise.io:8001'
|
57
|
+
end
|
58
|
+
|
59
|
+
apis = Kongkit.apis
|
60
|
+
```
|
52
61
|
|
53
62
|
## Development
|
54
63
|
|
data/lib/kongkit/client.rb
CHANGED
@@ -20,19 +20,11 @@ module Kongkit
|
|
20
20
|
include Node
|
21
21
|
include Request
|
22
22
|
|
23
|
-
def initialize(
|
24
|
-
@
|
23
|
+
def initialize(url = 'http://localhost:8001')
|
24
|
+
@url = url
|
25
25
|
|
26
|
-
self.class.base_uri(
|
26
|
+
self.class.base_uri(@url)
|
27
27
|
self.class.headers('Accept' => 'application/json')
|
28
28
|
end
|
29
|
-
|
30
|
-
def same_url?(url)
|
31
|
-
configuration.url == url
|
32
|
-
end
|
33
|
-
|
34
|
-
private
|
35
|
-
|
36
|
-
attr_reader :configuration
|
37
29
|
end
|
38
30
|
end
|
data/lib/kongkit/version.rb
CHANGED
data/lib/kongkit.rb
CHANGED
@@ -12,16 +12,11 @@ module Kongkit
|
|
12
12
|
|
13
13
|
# API client
|
14
14
|
#
|
15
|
-
# @param url [String] Kong admin url
|
16
15
|
# @return [Kongkit::Client] API wrapper
|
17
|
-
def client
|
18
|
-
|
19
|
-
config.url = url
|
20
|
-
end
|
21
|
-
|
22
|
-
return @client if defined?(@client) && @client.same_url?(url)
|
16
|
+
def client
|
17
|
+
return @client if defined?(@client)
|
23
18
|
|
24
|
-
@client = Kongkit::Client.new(configuration)
|
19
|
+
@client = Kongkit::Client.new(configuration.url)
|
25
20
|
end
|
26
21
|
|
27
22
|
def configure
|