openlibrary 1.0.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +26 -7
- data/lib/openlibrary/client.rb +4 -3
- data/lib/openlibrary/client/login.rb +10 -0
- data/lib/openlibrary/client/save.rb +18 -0
- data/lib/openlibrary/request.rb +62 -9
- data/lib/openlibrary/version.rb +1 -1
- data/openlibrary.gemspec +1 -1
- data/spec/client_spec.rb +37 -0
- data/spec/fixtures/save_after_change.json +42 -0
- data/spec/fixtures/save_before_change.json +42 -0
- data/spec/spec_helper.rb +25 -4
- metadata +97 -68
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
== Openlibrary
|
1
|
+
== Openlibrary 2.0.0
|
2
2
|
|
3
3
|
The openlibrary gem provides Ruby clients for the {Open Library REST API}[http://openlibrary.org/dev/docs/restful_api] and {Books API}[http://openlibrary.org/dev/docs/api/books].
|
4
4
|
|
@@ -15,17 +15,18 @@ or in your Gemfile:
|
|
15
15
|
|
16
16
|
gem 'openlibrary'
|
17
17
|
|
18
|
-
|
19
18
|
== Usage
|
20
19
|
|
21
|
-
You can use the Books client to retrieve a book's Open Library listing information, and the REST client to
|
20
|
+
You can use the Books client to retrieve a book's Open Library listing information, and the REST client to perform more advanced queries and save changes to Open Library.
|
22
21
|
|
23
22
|
# just require
|
24
23
|
require 'openlibrary'
|
25
24
|
|
26
25
|
== REST Client
|
27
26
|
|
28
|
-
You can use the REST client to look up books, authors, the revision history of any Open Library object, and recent changes to Open Library.
|
27
|
+
You can use the REST client to look up books, authors, the revision history of any Open Library object, and recent changes to Open Library.
|
28
|
+
|
29
|
+
You can also use the REST client to log in and save changes to Open Library, after you register your profile (or your bot's profile) with the {API Usergroup}[http://openlibrary.org/usergroup/api]. Send a message to the {ol-tech mailing list}[http://mail.archive.org/cgi-bin/mailman/listinfo/ol-tech] to learn how!
|
29
30
|
|
30
31
|
=== Getting Started
|
31
32
|
|
@@ -35,7 +36,7 @@ Before anything else, create a new client:
|
|
35
36
|
|
36
37
|
=== Books
|
37
38
|
|
38
|
-
Since Open Library has varying amounts of information about the books in its database, and returns data in a schemaless format, not every book will have the same properties.
|
39
|
+
Since Open Library has varying amounts of information about the books in its database, and returns data in a schemaless format, not every book will have the same properties. Common properties include `title`, `works`, and `contributors`, but most books will have more.
|
39
40
|
|
40
41
|
Find a book by its OLID:
|
41
42
|
|
@@ -101,7 +102,7 @@ Get the revision history of any Open Library object:
|
|
101
102
|
|
102
103
|
history = client.rev_history('key')
|
103
104
|
|
104
|
-
The key should be in the format '/
|
105
|
+
The key should be in the format '/type/OLID'. E.g., '/books/OL9220552M', '/authors/OL27349A', or '/works/OL468516W'.
|
105
106
|
|
106
107
|
=== Recent Changes
|
107
108
|
|
@@ -109,6 +110,24 @@ Get an array of recent changes to Open Library:
|
|
109
110
|
|
110
111
|
changes = client.recent
|
111
112
|
|
113
|
+
=== Saving Changes
|
114
|
+
|
115
|
+
Use the login method to get a session cookie:
|
116
|
+
|
117
|
+
cookie = client.login('username', 'password')
|
118
|
+
|
119
|
+
Set the other parameters for the object you want to change:
|
120
|
+
|
121
|
+
key = '/type/OLID' # e.g., '/books/OL9220552M'
|
122
|
+
update = full_object_with_changes # must be JSON format
|
123
|
+
comment = 'changed X, Y, and Z'
|
124
|
+
|
125
|
+
Save your changes and receive the updated object as a response:
|
126
|
+
|
127
|
+
object = client.save(key, cookie, update, comment)
|
128
|
+
|
129
|
+
NOTICE: Before you can actually save changes to Open Library, you need to register your profile (or bot) with the {API Usergroup}[http://openlibrary.org/usergroup/api]. Send a message to the {ol-tech mailing list}[http://mail.archive.org/cgi-bin/mailman/listinfo/ol-tech] to learn how!
|
130
|
+
|
112
131
|
== Books Client
|
113
132
|
|
114
133
|
There are two classes in the openlibrary gem you can use to access the {Books API}[http://openlibrary.org/dev/docs/api/books]. Use Openlibrary::View to look up Open Library listing information, and Openlibrary::Data to get a book's full metadata details.
|
@@ -162,8 +181,8 @@ Other built-in finder methods:
|
|
162
181
|
== CONTRIBUTORS
|
163
182
|
|
164
183
|
* Jay Fajardo https://github.com/jayfajardo
|
184
|
+
* John Shutt https://github.com/pemulis
|
165
185
|
* Robert Berry https://github.com/bdigital
|
166
186
|
* Eric Larson https://github.com/ewlarson
|
167
187
|
* Charles Horn https://github.com/hornc
|
168
|
-
* John Shutt https://github.com/pemulis
|
169
188
|
* Alex Grant https://github.com/grantovich
|
data/lib/openlibrary/client.rb
CHANGED
@@ -4,6 +4,8 @@ require 'openlibrary/client/authors'
|
|
4
4
|
require 'openlibrary/client/history'
|
5
5
|
require 'openlibrary/client/recent'
|
6
6
|
require 'openlibrary/client/editions'
|
7
|
+
require 'openlibrary/client/login'
|
8
|
+
require 'openlibrary/client/save'
|
7
9
|
|
8
10
|
module Openlibrary
|
9
11
|
class Client
|
@@ -13,6 +15,8 @@ module Openlibrary
|
|
13
15
|
include Openlibrary::History
|
14
16
|
include Openlibrary::Recent
|
15
17
|
include Openlibrary::Editions
|
18
|
+
include Openlibrary::Login
|
19
|
+
include Openlibrary::Save
|
16
20
|
|
17
21
|
# Initialize an Openlibrary::Client instance
|
18
22
|
#
|
@@ -20,9 +24,6 @@ module Openlibrary
|
|
20
24
|
unless options.kind_of?(Hash)
|
21
25
|
raise ArgumentError, "Options hash required."
|
22
26
|
end
|
23
|
-
|
24
|
-
# For future versions, options may include cookie information
|
25
|
-
# and alternative Accept headers (e.g., RDF instead of JSON)
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Openlibrary
|
2
|
+
module Save
|
3
|
+
# Save changes to Open Library
|
4
|
+
#
|
5
|
+
# key - Open Library object key
|
6
|
+
# cookie - Cookie retrieved by login method
|
7
|
+
# update - Complete, updated Open Library JSON object
|
8
|
+
# comment - String comment describing the changes
|
9
|
+
#
|
10
|
+
# Note that 'update' can reference an external JSON file or
|
11
|
+
# a properly formatted Ruby object.
|
12
|
+
#
|
13
|
+
def save(key, cookie, update, comment)
|
14
|
+
response = update("#{key}", "#{cookie}", "#{update}", "#{comment}")
|
15
|
+
Hashie::Mash.new(response)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/openlibrary/request.rb
CHANGED
@@ -10,14 +10,15 @@ module Openlibrary
|
|
10
10
|
|
11
11
|
protected
|
12
12
|
|
13
|
-
# Perform
|
13
|
+
# Perform a GET request
|
14
14
|
#
|
15
15
|
# path - Request path
|
16
16
|
#
|
17
|
-
def request(path)
|
17
|
+
def request(path, params={})
|
18
|
+
params.merge!(accept: :json)
|
18
19
|
url = "#{API_URL}#{path}"
|
19
20
|
|
20
|
-
resp = RestClient.get(url,
|
21
|
+
resp = RestClient.get(url, params) do |response, request, result, &block|
|
21
22
|
case response.code
|
22
23
|
when 200
|
23
24
|
response.return!(request, result, &block)
|
@@ -30,14 +31,16 @@ module Openlibrary
|
|
30
31
|
parse(resp)
|
31
32
|
end
|
32
33
|
|
34
|
+
|
33
35
|
# Get the history of an object in Open Library
|
34
36
|
#
|
35
|
-
# object -
|
37
|
+
# object - Object key, e.g., '/books/OL1M'
|
36
38
|
#
|
37
|
-
def history(object)
|
39
|
+
def history(object, params={})
|
40
|
+
params.merge!(accept: :json)
|
38
41
|
url = "#{API_URL}#{object}.json?m=history"
|
39
42
|
|
40
|
-
resp = RestClient.get(url,
|
43
|
+
resp = RestClient.get(url, params) do |response, request, result, &block|
|
41
44
|
case response.code
|
42
45
|
when 200
|
43
46
|
response.return!(request, result, &block)
|
@@ -52,12 +55,62 @@ module Openlibrary
|
|
52
55
|
|
53
56
|
# Perform a query using the Query API
|
54
57
|
#
|
55
|
-
#
|
58
|
+
# query - Query path, e.g. "type=/type/edition&isbn_10=XXXXXXXXXX"
|
56
59
|
#
|
57
|
-
def query(query)
|
60
|
+
def query(query, params={})
|
61
|
+
params.merge!(accept: :json)
|
58
62
|
url = "#{API_URL}/query.json?#{query}"
|
59
63
|
|
60
|
-
resp = RestClient.get(url,
|
64
|
+
resp = RestClient.get(url, params) do |response, request, result, &block|
|
65
|
+
case response.code
|
66
|
+
when 200
|
67
|
+
response.return!(request, result, &block)
|
68
|
+
when 401
|
69
|
+
raise Openlibrary::Unauthorized
|
70
|
+
when 404
|
71
|
+
raise Openlibrary::NotFound
|
72
|
+
end
|
73
|
+
end
|
74
|
+
parse(resp)
|
75
|
+
end
|
76
|
+
|
77
|
+
def protected_login(username, password, params={})
|
78
|
+
params.merge!(content_type: :json, accept: :json)
|
79
|
+
url = "#{API_URL}/account/login"
|
80
|
+
login = { 'username' => username, 'password' => password }.to_json
|
81
|
+
|
82
|
+
resp = RestClient.post(url, login, params) do |response|
|
83
|
+
case response.code
|
84
|
+
when 200
|
85
|
+
session = response.cookies
|
86
|
+
session
|
87
|
+
when 401
|
88
|
+
raise Openlibrary::Unauthorized
|
89
|
+
when 404
|
90
|
+
raise Openlibrary::NotFound
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Update an Open Library object
|
96
|
+
#
|
97
|
+
# key - Object key the Open Library resource
|
98
|
+
# cookie - Cookie retrieved by the login method
|
99
|
+
# update - Complete updated Open Library object in JSON format
|
100
|
+
# comment - Comment describing the change(s) to the object
|
101
|
+
#
|
102
|
+
def update(key, cookie, update, comment, params={})
|
103
|
+
cookie_header = { 'Cookie' => cookie }
|
104
|
+
comment_header = {
|
105
|
+
'Opt' => '"http://openlibrary.org/dev/docs/api"; ns=42',
|
106
|
+
'42-comment' => comment
|
107
|
+
}
|
108
|
+
params.merge!(cookie_header)
|
109
|
+
params.merge!(comment_header)
|
110
|
+
params.merge!(content_type: :json, accept: :json)
|
111
|
+
url = "#{API_URL}#{key}"
|
112
|
+
|
113
|
+
resp = RestClient.put(url, update, params) do |response, request, result, &block|
|
61
114
|
case response.code
|
62
115
|
when 200
|
63
116
|
response.return!(request, result, &block)
|
data/lib/openlibrary/version.rb
CHANGED
data/openlibrary.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
21
|
s.add_development_dependency 'rspec', '~> 2.13'
|
22
|
-
s.add_development_dependency 'webmock', '~> 1.
|
22
|
+
s.add_development_dependency 'webmock', '~> 1.11'
|
23
23
|
|
24
24
|
s.add_runtime_dependency 'json', '~> 1.7.7'
|
25
25
|
s.add_runtime_dependency 'rest-client', '~> 1.6'
|
data/spec/client_spec.rb
CHANGED
@@ -191,4 +191,41 @@ describe 'Client' do
|
|
191
191
|
# editions.entries[0].number_of_pages.should eq 322
|
192
192
|
end
|
193
193
|
end
|
194
|
+
|
195
|
+
describe '#login' do
|
196
|
+
before do
|
197
|
+
stub_http_request(:post, "www.openlibrary.org/account/login").
|
198
|
+
with( body: "{\"username\":\"username\",\"password\":\"password\"}" ).
|
199
|
+
to_return( status: 200, headers: {'Set-Cookie' => 'session=cookie'} )
|
200
|
+
end
|
201
|
+
|
202
|
+
it 'logs in to Open Library' do
|
203
|
+
expect { client.login('username', 'password') }.not_to raise_error
|
204
|
+
|
205
|
+
cookie = client.login('username', 'password')
|
206
|
+
cookie.should eq "cookie"
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
describe '#after_save' do
|
211
|
+
before do
|
212
|
+
key = "/books/OL9674499M"
|
213
|
+
comment = 'update weight and number of pages'
|
214
|
+
stub_put(key, 'save_after_change.json', comment)
|
215
|
+
end
|
216
|
+
|
217
|
+
it 'PUTs the updated object, and receives the updated object as a response' do
|
218
|
+
key = "/books/OL9674499M"
|
219
|
+
cookie = 'cookie'
|
220
|
+
update = fixture('save_after_change.json')
|
221
|
+
comment = 'update weight and number of pages'
|
222
|
+
|
223
|
+
expect { client.save(key, cookie, update, comment) }.not_to raise_error
|
224
|
+
|
225
|
+
object = client.save(key, cookie, update, comment)
|
226
|
+
|
227
|
+
object.weight.should eq '1.5 pounds'
|
228
|
+
object.number_of_pages.should eq 1103
|
229
|
+
end
|
230
|
+
end
|
194
231
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
{ "authors" : [ { "key" : "/authors/OL448939A" } ],
|
2
|
+
"covers" : [ 187816 ],
|
3
|
+
"created" : { "type" : "/type/datetime",
|
4
|
+
"value" : "2008-04-30T09:38:13.731961"
|
5
|
+
},
|
6
|
+
"edition_name" : "10 Anv edition",
|
7
|
+
"first_sentence" : { "type" : "/type/text",
|
8
|
+
"value" : "I am seated in an office, surrounded by heads and bodies."
|
9
|
+
},
|
10
|
+
"ia_box_id" : [ "IA138916" ],
|
11
|
+
"identifiers" : { "goodreads" : [ "75786" ],
|
12
|
+
"librarything" : [ "903" ]
|
13
|
+
},
|
14
|
+
"isbn_10" : [ "0316066524" ],
|
15
|
+
"isbn_13" : [ "9780316066525" ],
|
16
|
+
"key" : "/books/OL9674499M",
|
17
|
+
"languages" : [ { "key" : "/languages/eng" } ],
|
18
|
+
"last_modified" : { "type" : "/type/datetime",
|
19
|
+
"value" : "2012-02-19T03:27:30.858827"
|
20
|
+
},
|
21
|
+
"latest_revision" : 8,
|
22
|
+
"number_of_pages" : 1103,
|
23
|
+
"ocaid" : "infinitejestnove00wall",
|
24
|
+
"physical_dimensions" : "8.9 x 5.9 x 1.8 inches",
|
25
|
+
"physical_format" : "Paperback",
|
26
|
+
"publish_date" : "November 13, 2006",
|
27
|
+
"publishers" : [ "Back Bay Books" ],
|
28
|
+
"revision" : 8,
|
29
|
+
"source_records" : [ "ia:infinitejestnove00wall" ],
|
30
|
+
"subjects" : [ "Popular American Fiction",
|
31
|
+
"Fiction",
|
32
|
+
"Fiction - General",
|
33
|
+
"General",
|
34
|
+
"Fiction / General",
|
35
|
+
"Addicts",
|
36
|
+
"Compulsive behavior"
|
37
|
+
],
|
38
|
+
"title" : "Infinite Jest",
|
39
|
+
"type" : { "key" : "/type/edition" },
|
40
|
+
"weight" : "1.5 pounds",
|
41
|
+
"works" : [ { "key" : "/works/OL2943602W" } ]
|
42
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
{ "authors" : [ { "key" : "/authors/OL448939A" } ],
|
2
|
+
"covers" : [ 187816 ],
|
3
|
+
"created" : { "type" : "/type/datetime",
|
4
|
+
"value" : "2008-04-30T09:38:13.731961"
|
5
|
+
},
|
6
|
+
"edition_name" : "10 Anv edition",
|
7
|
+
"first_sentence" : { "type" : "/type/text",
|
8
|
+
"value" : "I am seated in an office, surrounded by heads and bodies."
|
9
|
+
},
|
10
|
+
"ia_box_id" : [ "IA138916" ],
|
11
|
+
"identifiers" : { "goodreads" : [ "75786" ],
|
12
|
+
"librarything" : [ "903" ]
|
13
|
+
},
|
14
|
+
"isbn_10" : [ "0316066524" ],
|
15
|
+
"isbn_13" : [ "9780316066525" ],
|
16
|
+
"key" : "/books/OL9674499M",
|
17
|
+
"languages" : [ { "key" : "/languages/eng" } ],
|
18
|
+
"last_modified" : { "type" : "/type/datetime",
|
19
|
+
"value" : "2012-02-19T03:27:30.858827"
|
20
|
+
},
|
21
|
+
"latest_revision" : 8,
|
22
|
+
"number_of_pages" : 1104,
|
23
|
+
"ocaid" : "infinitejestnove00wall",
|
24
|
+
"physical_dimensions" : "8.9 x 5.9 x 1.8 inches",
|
25
|
+
"physical_format" : "Paperback",
|
26
|
+
"publish_date" : "November 13, 2006",
|
27
|
+
"publishers" : [ "Back Bay Books" ],
|
28
|
+
"revision" : 8,
|
29
|
+
"source_records" : [ "ia:infinitejestnove00wall" ],
|
30
|
+
"subjects" : [ "Popular American Fiction",
|
31
|
+
"Fiction",
|
32
|
+
"Fiction - General",
|
33
|
+
"General",
|
34
|
+
"Fiction / General",
|
35
|
+
"Addicts",
|
36
|
+
"Compulsive behavior"
|
37
|
+
],
|
38
|
+
"title" : "Infinite Jest",
|
39
|
+
"type" : { "key" : "/type/edition" },
|
40
|
+
"weight" : "1.4 pounds",
|
41
|
+
"works" : [ { "key" : "/works/OL2943602W" } ]
|
42
|
+
}
|
data/spec/spec_helper.rb
CHANGED
@@ -13,11 +13,32 @@ end
|
|
13
13
|
|
14
14
|
def stub_get(path, fixture_name)
|
15
15
|
stub_request(:get, api_url(path)).
|
16
|
-
with(:
|
16
|
+
with(headers: {
|
17
|
+
'Accept'=>'application/json'
|
18
|
+
}).
|
17
19
|
to_return(
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
20
|
+
status: 200,
|
21
|
+
body: fixture(fixture_name),
|
22
|
+
headers: {}
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
def stub_put(path, fixture_name, comment)
|
27
|
+
stub_request(:put, api_url(path)).
|
28
|
+
with(
|
29
|
+
body: fixture(fixture_name),
|
30
|
+
headers: {
|
31
|
+
'Accept' => 'application/json',
|
32
|
+
'Content-Type' => 'application/json',
|
33
|
+
'Opt' => '"http://openlibrary.org/dev/docs/api"; ns=42',
|
34
|
+
'42-comment' => comment,
|
35
|
+
'Cookie' => 'cookie',
|
36
|
+
'User-Agent' => 'Ruby'
|
37
|
+
}).
|
38
|
+
to_return(
|
39
|
+
status: 200,
|
40
|
+
body: fixture(fixture_name),
|
41
|
+
headers: {}
|
21
42
|
)
|
22
43
|
end
|
23
44
|
|
metadata
CHANGED
@@ -1,93 +1,119 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: openlibrary
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.0
|
4
5
|
prerelease:
|
5
|
-
version: 1.0.2
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Jay Fajardo
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-04-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: rspec
|
17
|
-
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
19
17
|
none: false
|
20
|
-
requirements:
|
18
|
+
requirements:
|
21
19
|
- - ~>
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version:
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.13'
|
24
22
|
type: :development
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: webmock
|
28
23
|
prerelease: false
|
29
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
25
|
none: false
|
31
|
-
requirements:
|
26
|
+
requirements:
|
32
27
|
- - ~>
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version:
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.13'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: webmock
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.11'
|
35
38
|
type: :development
|
36
|
-
version_requirements: *id002
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: json
|
39
39
|
prerelease: false
|
40
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
|
-
requirements:
|
42
|
+
requirements:
|
43
43
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.11'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: json
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
45
53
|
version: 1.7.7
|
46
54
|
type: :runtime
|
47
|
-
version_requirements: *id003
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: rest-client
|
50
55
|
prerelease: false
|
51
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.7.7
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rest-client
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
52
65
|
none: false
|
53
|
-
requirements:
|
66
|
+
requirements:
|
54
67
|
- - ~>
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version:
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.6'
|
57
70
|
type: :runtime
|
58
|
-
version_requirements: *id004
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
name: hashie
|
61
71
|
prerelease: false
|
62
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
73
|
none: false
|
64
|
-
requirements:
|
74
|
+
requirements:
|
65
75
|
- - ~>
|
66
|
-
- !ruby/object:Gem::Version
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1.6'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: hashie
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
67
85
|
version: 2.0.2
|
68
86
|
type: :runtime
|
69
|
-
version_requirements: *id005
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: activesupport
|
72
87
|
prerelease: false
|
73
|
-
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
89
|
none: false
|
75
|
-
requirements:
|
90
|
+
requirements:
|
76
91
|
- - ~>
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version:
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 2.0.2
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: activesupport
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '3'
|
79
102
|
type: :runtime
|
80
|
-
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '3'
|
81
110
|
description: Openlibrary.org API Interface
|
82
|
-
email:
|
111
|
+
email:
|
83
112
|
- jmrfajardo@gmail.com
|
84
113
|
executables: []
|
85
|
-
|
86
114
|
extensions: []
|
87
|
-
|
88
115
|
extra_rdoc_files: []
|
89
|
-
|
90
|
-
files:
|
116
|
+
files:
|
91
117
|
- .gitignore
|
92
118
|
- Gemfile
|
93
119
|
- README.rdoc
|
@@ -98,7 +124,9 @@ files:
|
|
98
124
|
- lib/openlibrary/client/books.rb
|
99
125
|
- lib/openlibrary/client/editions.rb
|
100
126
|
- lib/openlibrary/client/history.rb
|
127
|
+
- lib/openlibrary/client/login.rb
|
101
128
|
- lib/openlibrary/client/recent.rb
|
129
|
+
- lib/openlibrary/client/save.rb
|
102
130
|
- lib/openlibrary/data.rb
|
103
131
|
- lib/openlibrary/details.rb
|
104
132
|
- lib/openlibrary/errors.rb
|
@@ -115,36 +143,35 @@ files:
|
|
115
143
|
- spec/fixtures/editions.json
|
116
144
|
- spec/fixtures/history.json
|
117
145
|
- spec/fixtures/recent.json
|
146
|
+
- spec/fixtures/save_after_change.json
|
147
|
+
- spec/fixtures/save_before_change.json
|
118
148
|
- spec/openlibrary_spec.rb
|
119
149
|
- spec/spec_helper.rb
|
120
150
|
homepage: http://www.proudcloud.net
|
121
151
|
licenses: []
|
122
|
-
|
123
152
|
post_install_message:
|
124
153
|
rdoc_options: []
|
125
|
-
|
126
|
-
require_paths:
|
154
|
+
require_paths:
|
127
155
|
- lib
|
128
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
129
157
|
none: false
|
130
|
-
requirements:
|
131
|
-
- -
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
version:
|
134
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ! '>='
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
163
|
none: false
|
136
|
-
requirements:
|
137
|
-
- -
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version:
|
164
|
+
requirements:
|
165
|
+
- - ! '>='
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
140
168
|
requirements: []
|
141
|
-
|
142
169
|
rubyforge_project: openlibrary
|
143
|
-
rubygems_version: 1.8.
|
170
|
+
rubygems_version: 1.8.23
|
144
171
|
signing_key:
|
145
172
|
specification_version: 3
|
146
173
|
summary: Ruby Interface for the Openlibrary.org API
|
147
|
-
test_files:
|
174
|
+
test_files:
|
148
175
|
- spec/client_spec.rb
|
149
176
|
- spec/fixtures/author.json
|
150
177
|
- spec/fixtures/book.json
|
@@ -154,5 +181,7 @@ test_files:
|
|
154
181
|
- spec/fixtures/editions.json
|
155
182
|
- spec/fixtures/history.json
|
156
183
|
- spec/fixtures/recent.json
|
184
|
+
- spec/fixtures/save_after_change.json
|
185
|
+
- spec/fixtures/save_before_change.json
|
157
186
|
- spec/openlibrary_spec.rb
|
158
187
|
- spec/spec_helper.rb
|