skull_island 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/lib/skull_island/exceptions/ambiguous_find.rb +9 -0
- data/lib/skull_island/resource.rb +4 -1
- data/lib/skull_island/version.rb +1 -1
- data/lib/skull_island.rb +1 -0
- 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: 8321e31b43685f8bcf071f1cbcfc227bbcf29f18f4e3f1da1377ec3cc7538ef9
|
4
|
+
data.tar.gz: 9e3c1f19171ec4d3c45c2f074374bba6249f03884741cffd3b16df7ea2862f57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb3422efbea9ac46ec54ac1ecf8ba11ef161327719032411e2cc2e0caf3dcb12703963523ffa253afe9ff5006f0ab5874b2a87de906c15068214cf928dd0bd3c
|
7
|
+
data.tar.gz: 78956b6591c0d8de32b084ede4d1a9f73160bb6fff2a94f0f23792a3cdbfc6371e1c96a9800c2c590bb6e089bb4d2b4b273ec7398e559b9bd45707f1411eca7c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -144,7 +144,7 @@ APIClient.server_status
|
|
144
144
|
# => {"database"=>{"reachable"=>true...
|
145
145
|
```
|
146
146
|
|
147
|
-
This SDK also makes use of automatic (and mostly unobtrusive) caching behind the scenes. As long as this tool is the only tool making changes to the Admin API (at least while it is being used), this should be fine. Eventually, there will be an option to disable this cache (at the cost of poor performance). For now, it is possible to query this cache and even
|
147
|
+
This SDK also makes use of automatic (and mostly unobtrusive) caching behind the scenes. As long as this tool is the only tool making changes to the Admin API (at least while it is being used), this should be fine. Eventually, there will be an option to disable this cache (at the cost of poor performance). For now, it is possible to query this cache and even flush it manually when required:
|
148
148
|
|
149
149
|
```ruby
|
150
150
|
APIClient.lru_cache
|
@@ -248,6 +248,8 @@ resource.created_at
|
|
248
248
|
|
249
249
|
#### Consumers (and their Credentials)
|
250
250
|
|
251
|
+
Note that for Consumer credentials, only [`key-auth`](https://docs.konghq.com/hub/kong-inc/key-auth/) and [`basic-auth`](https://docs.konghq.com/hub/kong-inc/basic-auth/) are currently supported.
|
252
|
+
|
251
253
|
```ruby
|
252
254
|
resource = Resources::Consumer.new
|
253
255
|
|
@@ -138,7 +138,10 @@ module SkullIsland
|
|
138
138
|
# Returns the first (and hopefully only) resource given some criteria
|
139
139
|
# This is a very crude helper and could be made much better
|
140
140
|
def self.find(attribute, value, options = {})
|
141
|
-
where(attribute, value, options)
|
141
|
+
results = where(attribute, value, options)
|
142
|
+
raise Exceptions::AmbiguousFind, 'Found more than one result' if results.size > 1
|
143
|
+
|
144
|
+
results.first
|
142
145
|
end
|
143
146
|
|
144
147
|
def self.get(id, options = {})
|
data/lib/skull_island/version.rb
CHANGED
data/lib/skull_island.rb
CHANGED
@@ -23,6 +23,7 @@ String.include CoreExtensions::String::Transformations
|
|
23
23
|
|
24
24
|
require 'skull_island/version'
|
25
25
|
require 'skull_island/api_exception'
|
26
|
+
require 'skull_island/exceptions/ambiguous_find'
|
26
27
|
require 'skull_island/exceptions/api_client_not_configured'
|
27
28
|
require 'skull_island/exceptions/immutable_modification'
|
28
29
|
require 'skull_island/exceptions/invalid_arguments'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skull_island
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Gnagy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deepsort
|
@@ -232,6 +232,7 @@ files:
|
|
232
232
|
- lib/skull_island/api_client_base.rb
|
233
233
|
- lib/skull_island/api_exception.rb
|
234
234
|
- lib/skull_island/cli.rb
|
235
|
+
- lib/skull_island/exceptions/ambiguous_find.rb
|
235
236
|
- lib/skull_island/exceptions/api_client_not_configured.rb
|
236
237
|
- lib/skull_island/exceptions/immutable_modification.rb
|
237
238
|
- lib/skull_island/exceptions/invalid_arguments.rb
|