isbndb 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/isbndb.gemspec +1 -1
- data/lib/isbndb/result_set.rb +2 -2
- metadata +4 -4
data/README.markdown
CHANGED
@@ -34,7 +34,7 @@ Where you list your access keys. This was in response to security holes in versi
|
|
34
34
|
Now you're ready to get started:
|
35
35
|
|
36
36
|
```ruby
|
37
|
-
@query = ISBNdb::Query.
|
37
|
+
@query = ISBNdb::Query.find_book_by_title('Ruby')
|
38
38
|
```
|
39
39
|
|
40
40
|
ActiveRecord-like Usage
|
data/isbndb.gemspec
CHANGED
data/lib/isbndb/result_set.rb
CHANGED
@@ -17,7 +17,7 @@ module ISBNdb
|
|
17
17
|
# messages. An ISBNdb::AccessKeyError will be raised if the results contain any errors.
|
18
18
|
# Finally, this method then actually builds the ResultSet.
|
19
19
|
def initialize(uri, collection, current_page = 1)
|
20
|
-
@uri = uri
|
20
|
+
@uri = URI.escape(uri)
|
21
21
|
@collection = collection.to_s.titleize.singularize
|
22
22
|
@current_page = current_page
|
23
23
|
@parsed_response = self.class.get(@uri).parsed_response['ISBNdb']
|
@@ -75,7 +75,7 @@ module ISBNdb
|
|
75
75
|
# each child. This method works because the API always returns #{@collection}List followed by a subset
|
76
76
|
# of #{@collection}Data. These results are all pushed into the @results array for accessing.
|
77
77
|
def build_results
|
78
|
-
@results = @parsed_response["#{@collection}List"]["#{@collection}Data"].collect{ |json| Result.new(json) }
|
78
|
+
@results = (@parsed_response["#{@collection}List"]["#{@collection}Data"] || []).collect{ |json| Result.new(json) }
|
79
79
|
end
|
80
80
|
|
81
81
|
# This helper method is mainly designed for use with the go_to_page(page) method. It parses the XML
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isbndb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06
|
12
|
+
date: 2012-07-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -163,7 +163,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
163
163
|
version: '0'
|
164
164
|
segments:
|
165
165
|
- 0
|
166
|
-
hash: -
|
166
|
+
hash: -3629372956676132832
|
167
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
168
|
none: false
|
169
169
|
requirements:
|
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
172
|
version: '0'
|
173
173
|
segments:
|
174
174
|
- 0
|
175
|
-
hash: -
|
175
|
+
hash: -3629372956676132832
|
176
176
|
requirements: []
|
177
177
|
rubyforge_project:
|
178
178
|
rubygems_version: 1.8.24
|