watson-api-client 0.0.4 → 0.0.5
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/.travis.yml +6 -0
- data/Gemfile +0 -1
- data/README.md +1 -0
- data/lib/watson-api-client.rb +9 -5
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80d9217a623965243bfff5dc95daf624318a0460
|
|
4
|
+
data.tar.gz: eb67925572e32a0e57740abbb181cc51df8b1ed4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0ec54a0d0c8a1e9a3f9f9707e6b04d73e6169c44d530e0cbfa5f4822d7d7b9b7a1458a391b9211677b3a6bc194aa68260cd0f2c4a06c773f743b750ed563d828
|
|
7
|
+
data.tar.gz: 56946b3c2b36ce78a83e553a4a66c8483d64dfdf313b9d42fef734965a2fdc73e5e6eb77f5af63694e1965a07b8e26fabdb37ae6334ba93c2f100a435236cbd3
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
================================================================
|
|
3
3
|
|
|
4
4
|
[](http://badge.fury.io/rb/watson-api-client)
|
|
5
|
+
[](https://travis-ci.org/blueboxjesse/watson-api-client)
|
|
5
6
|
|
|
6
7
|
The [watson-api-client](http://rubygems.org/gems/watson-api-client) is a gem to use REST API on the IBM Watson™ Developer Cloud.
|
|
7
8
|
|
data/lib/watson-api-client.rb
CHANGED
|
@@ -6,7 +6,7 @@ require 'pp' if __FILE__ == $PROGRAM_NAME
|
|
|
6
6
|
|
|
7
7
|
class WatsonAPIClient
|
|
8
8
|
|
|
9
|
-
VERSION = '0.0.
|
|
9
|
+
VERSION = '0.0.5'
|
|
10
10
|
|
|
11
11
|
class << self
|
|
12
12
|
|
|
@@ -18,11 +18,14 @@ class WatsonAPIClient
|
|
|
18
18
|
# Watson API Explorer
|
|
19
19
|
host1 = doc_urls[:doc_base1][/^https?:\/\/[^\/]+/]
|
|
20
20
|
open(doc_urls[:doc_base1], Options, &:read).scan(/<a class="swagger-list--item-link" href="\/(.+?)".*?>\s*(.+?)\s*<\/a>/i) do
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
api['path']
|
|
21
|
+
begin
|
|
22
|
+
api = {'path'=>doc_urls[:doc_base1] + $1, 'title'=>$2.sub(/\s*\(.+?\)$/,'')}
|
|
23
|
+
open(api['path'], Options, &:read).scan(/url:\s*'(.+?)'/) do
|
|
24
|
+
api['path'] = host1 + $1
|
|
25
|
+
end
|
|
26
|
+
apis[api['title']] = api
|
|
27
|
+
rescue OpenURI::HTTPError
|
|
24
28
|
end
|
|
25
|
-
apis[api['title']] = api
|
|
26
29
|
end
|
|
27
30
|
|
|
28
31
|
# Watson Developercloud
|
|
@@ -146,6 +149,7 @@ class WatsonAPIClient
|
|
|
146
149
|
|
|
147
150
|
def rest_access_without_body(method, options={})
|
|
148
151
|
path, access = swagger_info(method, options)
|
|
152
|
+
options = { :params => options } if access.downcase == 'get'
|
|
149
153
|
@service[path].send(access, options)
|
|
150
154
|
end
|
|
151
155
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: watson-api-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Takashi SUGA
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-07-
|
|
11
|
+
date: 2016-07-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|
|
@@ -33,6 +33,7 @@ executables: []
|
|
|
33
33
|
extensions: []
|
|
34
34
|
extra_rdoc_files: []
|
|
35
35
|
files:
|
|
36
|
+
- ".travis.yml"
|
|
36
37
|
- Gemfile
|
|
37
38
|
- LICENSE
|
|
38
39
|
- README.md
|