relaton-isbn 1.18.1 → 1.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +6 -13
- data/lib/relaton_isbn/open_library.rb +4 -4
- data/lib/relaton_isbn/util.rb +1 -4
- data/lib/relaton_isbn/version.rb +1 -1
- data/lib/relaton_isbn.rb +0 -1
- metadata +8 -9
- data/lib/relaton_isbn/config.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 878ec251b7038e780fe8e283b413dbbce5c98671eb68030dbb148e47755e2892
|
4
|
+
data.tar.gz: fbd91513eedc98d1ab3baef8024b3ee0ce8399e180140f43e9b3f787703d7fb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71d254c3e69f318056ae64ca52af5daa4e157723757fc74f11ce8832272f141e2a56d5b15ce29edd94393d1f0dc49340440365ce533b1e773f4d1becb98e3a98
|
7
|
+
data.tar.gz: e7c6e7529f3886906c7d6a74f0a2a708237dda71a29583c64aee831105322a5fbfd6899a2e3dbf9613b6b71f4fe5c68e231d7dfa736e565b60f8d661e5057eca
|
data/README.adoc
CHANGED
@@ -39,26 +39,15 @@ $ gem install relaton-isbn
|
|
39
39
|
|
40
40
|
== Usage
|
41
41
|
|
42
|
-
===
|
42
|
+
=== Retrieving bibliographic items using OpenLibrary API
|
43
43
|
|
44
|
-
|
44
|
+
To retrieve bibliographic items, use `RelatonIsbn::OpenLibrary.get` method with ISBN-10 or ISBN-13 as an argument. Allowed prefixes are `ISBN`, `isbn:`. Prefix and hyphens are optional. The method returns `RelatonBib::BibliographicItem` object.
|
45
45
|
|
46
46
|
[source,ruby]
|
47
47
|
----
|
48
48
|
require 'relaton_isbn'
|
49
49
|
=> true
|
50
50
|
|
51
|
-
RelatonIsbn.configure do |config|
|
52
|
-
config.logger.level = Logger::DEBUG
|
53
|
-
end
|
54
|
-
----
|
55
|
-
|
56
|
-
=== Retrieving bibliographic items using OpenLibrary API
|
57
|
-
|
58
|
-
To retrieve bibliographic items, use `RelatonIsbn::OpenLibrary.get` method with ISBN-10 or ISBN-13 as an argument. Allowed prefixes are `ISBN`, `isbn:`. Prefix and hyphens are optional. The method returns `RelatonBib::BibliographicItem` object.
|
59
|
-
|
60
|
-
[source,ruby]
|
61
|
-
----
|
62
51
|
# get document by ISBN-13
|
63
52
|
> ibitem = RelatonIsbn::OpenLibrary.get "ISBN 978-0-12-064481-0"
|
64
53
|
[relaton-isbn] (ISBN 9780120644810) Fetching from OpenLibrary ...
|
@@ -129,6 +118,10 @@ To retrieve bibliographic items, use `RelatonIsbn::OpenLibrary.get` method with
|
|
129
118
|
"place"=>[{"city"=>"Boston"}, {"city"=>"London"}]}
|
130
119
|
----
|
131
120
|
|
121
|
+
=== Logging
|
122
|
+
|
123
|
+
RelatonIsbn uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
|
124
|
+
|
132
125
|
== Development
|
133
126
|
|
134
127
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
@@ -8,22 +8,22 @@ module RelatonIsbn
|
|
8
8
|
ENDPOINT = "http://openlibrary.org/api/volumes/brief/isbn/".freeze
|
9
9
|
|
10
10
|
def get(ref, _date = nil, _opts = {}) # rubocop:disable Metrics/MethodLength
|
11
|
-
Util.
|
11
|
+
Util.info "Fetching from OpenLibrary ...", key: ref
|
12
12
|
|
13
13
|
isbn = Isbn.new(ref).parse
|
14
14
|
unless isbn
|
15
|
-
Util.
|
15
|
+
Util.info "Incorrect ISBN.", key: ref
|
16
16
|
return
|
17
17
|
end
|
18
18
|
|
19
19
|
resp = request_api isbn
|
20
20
|
unless resp
|
21
|
-
Util.
|
21
|
+
Util.info "Not found.", key: ref
|
22
22
|
return
|
23
23
|
end
|
24
24
|
|
25
25
|
bib = Parser.parse resp
|
26
|
-
Util.
|
26
|
+
Util.info "Found: `#{bib.docidentifier.first.id}`", key: ref
|
27
27
|
bib
|
28
28
|
end
|
29
29
|
|
data/lib/relaton_isbn/util.rb
CHANGED
data/lib/relaton_isbn/version.rb
CHANGED
data/lib/relaton_isbn.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-isbn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: relaton-bib
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.20.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: 1.
|
26
|
+
version: 1.20.0
|
27
27
|
description: 'RelatonIsbn: retrieve publications by ISBN for bibliographic use using
|
28
28
|
the BibliographicItem model'
|
29
29
|
email:
|
@@ -38,7 +38,6 @@ files:
|
|
38
38
|
- README.adoc
|
39
39
|
- Rakefile
|
40
40
|
- lib/relaton_isbn.rb
|
41
|
-
- lib/relaton_isbn/config.rb
|
42
41
|
- lib/relaton_isbn/isbn.rb
|
43
42
|
- lib/relaton_isbn/open_library.rb
|
44
43
|
- lib/relaton_isbn/parser.rb
|
@@ -52,7 +51,7 @@ licenses:
|
|
52
51
|
metadata:
|
53
52
|
homepage_uri: https://github.com/relaton/relaton-isbn
|
54
53
|
source_code_uri: https://github.com/relaton/relaton-isbn
|
55
|
-
post_install_message:
|
54
|
+
post_install_message:
|
56
55
|
rdoc_options: []
|
57
56
|
require_paths:
|
58
57
|
- lib
|
@@ -67,8 +66,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
66
|
- !ruby/object:Gem::Version
|
68
67
|
version: '0'
|
69
68
|
requirements: []
|
70
|
-
rubygems_version: 3.3.
|
71
|
-
signing_key:
|
69
|
+
rubygems_version: 3.3.27
|
70
|
+
signing_key:
|
72
71
|
specification_version: 4
|
73
72
|
summary: 'RelatonIsbn: retrieve publications by ISBN for bibliographic use using the
|
74
73
|
BibliographicItem model'
|