bookshark 1.0.0.pre.1 → 1.0.0.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/bookshark/extractors/book_extractor.rb +13 -2
- data/lib/bookshark/version.rb +1 -1
- data/spec/test_data/eager_book_184923.json +1 -1
- data/spec/test_data/search_01.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55cf891db20054fa8dee78ebb422af2a2d2cb25c
|
4
|
+
data.tar.gz: f5c777f653ab0a52ba7e3d071d89f0bd62763954
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83e1699c160bd1c578c1335e8b6a4e490598e3588da23c29549d47f7f2860f4d3995c326f583e582d115c06ba8c57a8df224f5a3d77ea3b4f45db95ebe2e91a9
|
7
|
+
data.tar.gz: 0364e7d5cd6c6f6a01863c1f29bd8a0a6e14f5a2cf44bb66ecee76f86f136ca2da479573e3d64b457939f1f7b2a8bd6ae6f9652818d5ea1984d6b2d4a3f3e42a
|
data/README.md
CHANGED
@@ -105,6 +105,11 @@ For more options, like book's title or author, use the search method which is de
|
|
105
105
|
* pretty_json
|
106
106
|
* eager : Perform eager extraction? (Boolean - default is false)
|
107
107
|
|
108
|
+
Useful one-liner:
|
109
|
+
```ruby
|
110
|
+
puts Bookshark::Extractor.new(format: 'pretty_json').book(id: 185281)
|
111
|
+
```
|
112
|
+
|
108
113
|
#### Eager Extraction
|
109
114
|
|
110
115
|
Each book has some attributes such as authors, contributors, categories etc which are actually references to other objects.
|
@@ -172,8 +172,19 @@ module Biblionet
|
|
172
172
|
|
173
173
|
# book_hash[:publication_year] = details_hash[:publication_year]
|
174
174
|
# book_hash[:pages] = details_hash[:pages]
|
175
|
-
book_hash[:isbn]
|
176
|
-
|
175
|
+
book_hash[:isbn] = details_hash[:isbn]
|
176
|
+
|
177
|
+
if details_hash[:isbn_13].nil?
|
178
|
+
if present?(details_hash[:isbn]) and (details_hash[:isbn].strip.gsub('-','').length == 13)
|
179
|
+
book_hash[:isbn_13] = book_hash[:isbn]
|
180
|
+
else
|
181
|
+
book_hash[:isbn_13] = nil
|
182
|
+
end
|
183
|
+
else
|
184
|
+
book_hash[:isbn_13] = details_hash[:isbn_13]
|
185
|
+
end
|
186
|
+
|
187
|
+
# book_hash[:isbn_13] = details_hash[:isbn_13].nil? ? nil : details_hash[:isbn_13]
|
177
188
|
# book_hash[:status] = details_hash[:status]
|
178
189
|
# book_hash[:price] = details_hash[:price]
|
179
190
|
book_hash[:award] = page.awards
|
data/lib/bookshark/version.rb
CHANGED