isbnranges 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -6
- data/lib/isbnranges/version.rb +1 -1
- data/lib/isbnranges.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c21b32ff122bd1e46c7df587c130fe86d28a0d2da68e2c7ed6d6b045bb61c74
|
4
|
+
data.tar.gz: 60d9978dd4480e5631cce9ebd600dc56d3ceae46bd316b01de77c1b73ab8b6aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51c93001c5bb43e2eadefa43d74fbb7a4c97775dd385947e0c81c6103ee1d5d2011011c9e5886314bfddec346b86ad4dfa4658358365d392fa0c3463f655bad1
|
7
|
+
data.tar.gz: 37779f2c820520e7e9745e8629d879109f18a659b315c919c60057bca890d1e98db20194702b1b65a6ef63f0efbe0664c74b0b3c184bedd13d670e91e7666679
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ The range definitions of ISBN registration groups and registrants.
|
|
5
5
|
This library provides programmer-friendly versions of data published by International ISBN Agency. It does NOT provide any manipulation of the data.
|
6
6
|
|
7
7
|
All ranges of registration groups and registrants are supported.
|
8
|
-
Those
|
8
|
+
Those depend on 'RangeMessage.xml' file, downloaded from [International ISBN Agency](https://www.isbn-international.org/range_file_generation).
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
@@ -24,11 +24,11 @@ After `require "isbnranges"`, you can refer to the following constants.
|
|
24
24
|
- `ISBNRanges::REGISTRATION_GROUP_RANGES`
|
25
25
|
- `ISBNRanges::REGISTRANT_RANGES`
|
26
26
|
|
27
|
-
Both constants are
|
27
|
+
Both constants are Hash objects with the prefix as the key. The value corresponding to the key is an Array object of ranges defined under the prefix. Each range is an Array object whose beginning and end are included, so it can be easily modified into a form that is convenient for you.
|
28
28
|
|
29
29
|
- `ISBNRanges::REGISTRATION_GROUP_AGENCY`
|
30
30
|
|
31
|
-
This constant is also a
|
31
|
+
This constant is also a Hash object with the prefix as the key, and the corresponding value is the national agency name to which the prefix is assigned.
|
32
32
|
|
33
33
|
- `ISBNRanges::RANGE_DATE`
|
34
34
|
|
@@ -38,10 +38,24 @@ This constant holds the defined date of the information contained in the range f
|
|
38
38
|
=> true
|
39
39
|
irb(main):002:0> ISBNRanges::REGISTRATION_GROUP_RANGES
|
40
40
|
=>
|
41
|
-
{"978"=>
|
42
|
-
|
41
|
+
{"978"=>
|
42
|
+
[["0", "5"],
|
43
|
+
["600", "649"],
|
44
|
+
["65", "65"],
|
45
|
+
["7", "7"],
|
46
|
+
["80", "94"],
|
47
|
+
["950", "989"],
|
48
|
+
["9900", "9989"],
|
49
|
+
["99900", "99999"]],
|
50
|
+
"979"=>[["10", "15"], ["8", "8"]]}
|
43
51
|
irb(main):003:0> ISBNRanges::REGISTRANT_RANGES["978-4"]
|
44
|
-
=>
|
52
|
+
=>
|
53
|
+
[["00", "19"],
|
54
|
+
["200", "699"],
|
55
|
+
["7000", "8499"],
|
56
|
+
["85000", "89999"],
|
57
|
+
["900000", "949999"],
|
58
|
+
["9500000", "9999999"]]
|
45
59
|
irb(main):004:0> ISBNRanges::REGISTRATION_GROUP_AGENCY["978-4"]
|
46
60
|
=> "Japan"
|
47
61
|
irb(main):005:0> ISBNRanges::RANGE_DATE
|
data/lib/isbnranges/version.rb
CHANGED
data/lib/isbnranges.rb
CHANGED
@@ -17,7 +17,7 @@ module ISBNRanges
|
|
17
17
|
f.each_line do |line|
|
18
18
|
next if line.start_with?("#")
|
19
19
|
g, r, a = line.chomp.split(":")
|
20
|
-
ranges[g] = r.split(",") unless r.nil?
|
20
|
+
ranges[g] = r.split(",").map{|r| r.split("-")} unless r.nil?
|
21
21
|
agencies[g] = a unless r.nil?
|
22
22
|
end
|
23
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isbnranges
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- takatoh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|