kong 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ff94e4776ba2b427f6513f14752a3a4cf3f8b94
4
- data.tar.gz: 8f7d004118ee6e4876ca226a3e4ebbe2e7f17ef6
3
+ metadata.gz: 3aee0b2fdf56d12d85778e534f4c8165ff537938
4
+ data.tar.gz: 2ef60a6ddadc60cb9f29ca6dfef80bb881815556
5
5
  SHA512:
6
- metadata.gz: f353890cd67c63cf8a9682f118a315216baf96708231a64428adc3c2054bb24aad040e8600443b288d54374cd76da485129238f2182059b5f308567ddf144d0a
7
- data.tar.gz: 2c6547e0f5338ff2e9a9fbaeab8f425611114ddafe510b79af105f719b8b3e7785306fd51bd5d79f407f0fc8440cb73e35f68e8fb3e060b4c952bef2d1b7ef04
6
+ metadata.gz: 4ab2f7efcd3f83b0213ac1e414ccb5de86284b40316518d9e7bb00e21e591b11f761c748a873ccdced21cb83f02d8b2c56f7e66d053e0f765c0663b0c80a21d0
7
+ data.tar.gz: fd7c4e700bd2869cfbfe88ef9090a41cd18e96d784cca01c9a61167b8d4ddc0f9f4b9c727c1655b47f96af2f12b5224df5cf0fecff7347792be4cc2dbb0c5b31
data/.gitignore CHANGED
@@ -11,5 +11,6 @@
11
11
  *.so
12
12
  *.o
13
13
  *.a
14
+ *.gem
14
15
  mkmf.log
15
16
  .idea
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [Kong](http://getkong.org) API client for Ruby
4
4
 
5
5
  [![Build Status](https://travis-ci.org/kontena/kong-client-ruby.svg?branch=master)](https://travis-ci.org/kontena/kong-client-ruby)
6
-
6
+ [![Gem Version](https://badge.fury.io/rb/kong.svg)](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::KeyAuth.create(attributes)
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
@@ -1,3 +1,3 @@
1
1
  module Kong
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
@@ -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.0
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-07-13 00:00:00.000000000 Z
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.5.1
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