kong 0.1.0 → 0.1.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 +4 -4
- data/.gitignore +1 -0
- data/README.md +4 -2
- data/lib/kong/base.rb +13 -0
- data/lib/kong/version.rb +1 -1
- data/spec/kong/base_spec.rb +14 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3aee0b2fdf56d12d85778e534f4c8165ff537938
|
4
|
+
data.tar.gz: 2ef60a6ddadc60cb9f29ca6dfef80bb881815556
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ab2f7efcd3f83b0213ac1e414ccb5de86284b40316518d9e7bb00e21e591b11f761c748a873ccdced21cb83f02d8b2c56f7e66d053e0f765c0663b0c80a21d0
|
7
|
+
data.tar.gz: fd7c4e700bd2869cfbfe88ef9090a41cd18e96d784cca01c9a61167b8d4ddc0f9f4b9c727c1655b47f96af2f12b5224df5cf0fecff7347792be4cc2dbb0c5b31
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[Kong](http://getkong.org) API client for Ruby
|
4
4
|
|
5
5
|
[](https://travis-ci.org/kontena/kong-client-ruby)
|
6
|
-
|
6
|
+
[](https://badge.fury.io/rb/kong)
|
7
7
|
## Installation
|
8
8
|
Add this line to your application's Gemfile:
|
9
9
|
|
@@ -167,7 +167,7 @@ auth.delete
|
|
167
167
|
#### BasicAuth
|
168
168
|
|
169
169
|
```ruby
|
170
|
-
Kong::
|
170
|
+
Kong::BasicAuth.create(attributes)
|
171
171
|
|
172
172
|
auth = Kong::BasicAuth.new({
|
173
173
|
consumer_id: 'a3dX2dh2-1adb-40a5-c042-63b19dbx83hF4',
|
@@ -199,6 +199,8 @@ token.create
|
|
199
199
|
token.update
|
200
200
|
token.save # requests create_or_update action
|
201
201
|
token.delete
|
202
|
+
|
203
|
+
token.oauth_app
|
202
204
|
```
|
203
205
|
|
204
206
|
## Contributing
|
data/lib/kong/base.rb
CHANGED
@@ -41,6 +41,19 @@ module Kong
|
|
41
41
|
super
|
42
42
|
end
|
43
43
|
end
|
44
|
+
|
45
|
+
def respond_to?(method, include_private = false)
|
46
|
+
if method.to_s.start_with?('find_by_')
|
47
|
+
attribute = method.to_s.sub('find_by_', '')
|
48
|
+
if self.attribute_names.include?(attribute)
|
49
|
+
return true
|
50
|
+
else
|
51
|
+
super
|
52
|
+
end
|
53
|
+
else
|
54
|
+
super
|
55
|
+
end
|
56
|
+
end
|
44
57
|
end
|
45
58
|
|
46
59
|
attr_accessor :attributes, :api_end_point
|
data/lib/kong/version.rb
CHANGED
data/spec/kong/base_spec.rb
CHANGED
@@ -46,6 +46,20 @@ describe Kong::Base do
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
describe '.respond_to' do
|
50
|
+
context 'when attribute exits' do
|
51
|
+
it 'will respond to find_by_* methods' do
|
52
|
+
expect(Klass.respond_to?(:find_by_name)).to be_truthy
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
context 'when attribute does not exit' do
|
57
|
+
it 'will not respond to find_by_* methods' do
|
58
|
+
expect(Klass.respond_to?(:find_by_invalid)).to be_falsey
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
49
63
|
describe '#get' do
|
50
64
|
it 'creates GET /:resource_end_point/:id request' do
|
51
65
|
expect(Kong::Client.instance).to receive(:get).with('/resources/12345').and_return({ data: [] })
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kong
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lauri Nevala
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
114
|
rubyforge_project:
|
115
|
-
rubygems_version: 2.
|
115
|
+
rubygems_version: 2.4.8
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
118
|
summary: A Ruby client for the Kong API
|