kongkit 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: db763514c1f32625e9e630d8057eb5f9d4c65d66
4
- data.tar.gz: 3942dfd42fbc24a7a89dde9e34c1e8d6c0beaa94
3
+ metadata.gz: 27a07fb91dbdac22f631ed9bca8c944cd2284b33
4
+ data.tar.gz: fc36610fb68f67d070ad0643bf3f3989f930ba30
5
5
  SHA512:
6
- metadata.gz: 1bd31d999c8ba8e73290b8af3ce4abb154be3bb0e2f6cd11ee073ba3fc623ea0b80da9dfe8929caeaef23c17da3083b9efc02ae77409c9981aed6a7cefacd840
7
- data.tar.gz: 943a2aa6f20c647aab03c7c14607002730413a2f41ce19e03b4dda6c4606031745b2a22a3dd668a56c1519cdfb05de26ed2c29bd836a4a09f99b23bad25c5cf7
6
+ metadata.gz: 192a2966df0a1aaf62f6a79c2baee1e1a47c8548e117af52680126e42ba7a11fdac78d6050734ca0b3b45b9ed0bc6debc748d6d5176446a771ae52a3ae77e615
7
+ data.tar.gz: dcad30e65b60ba31e435973952bc1587f5b0a962888a0c6080c803b969c1b281b214c07adf94bdd3ccc3a1430722913883a05286f976e6cfc7298340bfa7f557
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /*.gem
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
 
@@ -20,19 +20,11 @@ module Kongkit
20
20
  include Node
21
21
  include Request
22
22
 
23
- def initialize(configuration)
24
- @configuration = configuration
23
+ def initialize(url = 'http://localhost:8001')
24
+ @url = url
25
25
 
26
- self.class.base_uri(configuration.url)
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
@@ -1,3 +1,3 @@
1
1
  module Kongkit
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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(url = 'http://localhost:8001')
18
- configure do |config|
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kongkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabian Mettler