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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e2e0077beb0dadb4ef9df9fcce7b7d55d54e8a6
4
- data.tar.gz: 712b2769781e8b1ea55ecb25a501d886a939e307
3
+ metadata.gz: 55cf891db20054fa8dee78ebb422af2a2d2cb25c
4
+ data.tar.gz: f5c777f653ab0a52ba7e3d071d89f0bd62763954
5
5
  SHA512:
6
- metadata.gz: a2348fa9b757abe44be69c0d21e5c61bc41e87eaae80d11bafff115201f40793d2724d6fe5f518c3c3f26308696febd4c772f8a7e989f085949ea6ab584c7264
7
- data.tar.gz: 221cdadd0bcaf5df156cb668465b6a60e7471a5a650ddcce703a602a646dac19dee008a4de088ed037695289d7fa983792d1a5397ea40cfe843a39bf50155bb0
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] = details_hash[:isbn]
176
- book_hash[:isbn_13] = details_hash[:isbn_13].nil? ? nil : details_hash[:isbn_13]
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
@@ -1,3 +1,3 @@
1
1
  module Bookshark
2
- VERSION = "1.0.0.pre.1"
2
+ VERSION = "1.0.0.pre.2"
3
3
  end
@@ -72,7 +72,7 @@
72
72
  }
73
73
  ],
74
74
  "isbn": "978-960-524-394-4",
75
- "isbn_13": null,
75
+ "isbn_13": "978-960-524-394-4",
76
76
  "award": [
77
77
 
78
78
  ],
@@ -17,7 +17,7 @@
17
17
  "b_id": "7628"
18
18
  },
19
19
  "isbn": "978-960-89288-3-1",
20
- "isbn_13": null,
20
+ "isbn_13": "978-960-89288-3-1",
21
21
  "award": [
22
22
 
23
23
  ],
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bookshark
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.1
4
+ version: 1.0.0.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitris Klisiaris