cat_api 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 +4 -4
- data/README.md +1 -1
- data/cat_api.gemspec +1 -1
- data/lib/cat_api/categories.rb +11 -0
- data/lib/cat_api/client.rb +5 -1
- data/lib/cat_api/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80d276b39f0e922dbece4c0a55e02ea1840ef619
|
4
|
+
data.tar.gz: 38a7f3af11239a2886f6f2591e562e6f77ae6ec4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06df321d4789afcf96ecad995cf6b1297a9770e1390a1a849f9696f835afa0cc35a7ba4c5c6f1aa53a85688eeb9909e3b55255efbdafb828bec6f76874dd0194
|
7
|
+
data.tar.gz: 101c9869f2a5d38754a301884e116e4ed76208ba8bf62a0a30a43a5dd54a89fe0f3fd9aec974a5f29b70bca2e1a539140521fad612c72a11bc6fc43962730014
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# CatAPI
|
2
2
|
|
3
|
-
I'm not sure how this happened, but there was not yet a Ruby wrapper for the awesome Cat API.
|
3
|
+
I'm not sure how this happened, but there was not yet a Ruby wrapper for the awesome Cat API. Well, problem solved. I'm putting this together for use in a class, so there are no specs and it only hits a single endpoint, but it's something.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
data/cat_api.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency 'rest-client', '~>
|
21
|
+
spec.add_dependency 'rest-client', '~> 2.0.0'
|
22
22
|
spec.add_dependency 'nokogiri', '~> 1.6.5'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
data/lib/cat_api/client.rb
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
require 'rest-client'
|
2
2
|
require 'nokogiri'
|
3
3
|
require 'cat_api/image_search'
|
4
|
+
require 'cat_api/categories'
|
4
5
|
|
5
6
|
class CatAPI::Client
|
7
|
+
attr_reader :categories
|
6
8
|
|
7
9
|
BASE_URL = 'http://thecatapi.com/api/'
|
8
10
|
|
9
11
|
def initialize(defaults={})
|
10
12
|
@defaults = defaults
|
13
|
+
response = get "#{ BASE_URL }categories/list"
|
14
|
+
@categories = CatAPI::Categories.new( Nokogiri::XML(response) ).results
|
11
15
|
end
|
12
16
|
|
13
17
|
def get_images(options={})
|
@@ -23,4 +27,4 @@ private
|
|
23
27
|
RestClient.get url
|
24
28
|
end
|
25
29
|
|
26
|
-
end
|
30
|
+
end
|
data/lib/cat_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cat_api
|
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
|
- Chris Fritz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- Rakefile
|
125
125
|
- cat_api.gemspec
|
126
126
|
- lib/cat_api.rb
|
127
|
+
- lib/cat_api/categories.rb
|
127
128
|
- lib/cat_api/client.rb
|
128
129
|
- lib/cat_api/image.rb
|
129
130
|
- lib/cat_api/image_search.rb
|
@@ -150,11 +151,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
151
|
version: '0'
|
151
152
|
requirements: []
|
152
153
|
rubyforge_project:
|
153
|
-
rubygems_version: 2.
|
154
|
+
rubygems_version: 2.5.1
|
154
155
|
signing_key:
|
155
156
|
specification_version: 4
|
156
157
|
summary: CatAPI is a Ruby gem to facilitate communication with the Cat API.
|
157
158
|
test_files:
|
158
159
|
- spec/lib/cat_api/client_spec.rb
|
159
160
|
- spec/spec_helper.rb
|
160
|
-
has_rdoc:
|