isbn 2.0.10 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/isbn.gemspec +1 -0
- data/lib/isbn.rb +1 -1
- data/test/isbn_spec.rb +2 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c92ce156ae4d9d3ebf632e786fa35a9d93449305
|
4
|
+
data.tar.gz: 5bd5f2046649d7939458e1467795973372e1f3f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b548c27e14b3176b2dbbc2efe0feadec412c2f765ba1df9890e7e219fc747ae8aafbfd9d7d7ee8e8d7a0efeccaeeacbc87d5d7b218dd00152fc23bd0da7d058
|
7
|
+
data.tar.gz: b51f98a67423fa2323d055966392d50b6cd1fb4507067bb5ee39b4c9d802e436b4703d9e5b3f3354029f23c54ac9004ee40916fdab4812c08eda0f61626f3f91
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.11
|
data/isbn.gemspec
CHANGED
data/lib/isbn.rb
CHANGED
@@ -83,7 +83,7 @@ module ISBN
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def from_string(source)
|
86
|
-
regex = /(?:ISBN[- ]*13|ISBN[- ]*10|)\s*((?:(?:
|
86
|
+
regex = /(?:ISBN[- ]*13|ISBN[- ]*10|)\s*((?:(?:9[\s-]*7[\s-]*[89])?[ -]?(?:[0-9][ -]*){9})[ -]*(?:[0-9xX]))/
|
87
87
|
match = source.scan(regex).flatten
|
88
88
|
match.map! { |i| i.gsub(/[\s-]+/, "-") }
|
89
89
|
match = match.find {|i| ISBN.valid?(i) }
|
data/test/isbn_spec.rb
CHANGED
@@ -74,6 +74,8 @@ describe ISBN do
|
|
74
74
|
end
|
75
75
|
|
76
76
|
it "should get isbn from source string" do
|
77
|
+
ISBN.from_string("ISBN:9-7883-7659-303-6\nmore of content").must_equal "9-7883-7659-303-6"
|
78
|
+
ISBN.from_string("ISBN:97-908-7939-278-8\nmore of content").must_equal "97-908-7939-278-8"
|
77
79
|
ISBN.from_string("ISBN:978-83-7659-303-6\nmore of content").must_equal "978-83-7659-303-6"
|
78
80
|
ISBN.from_string("ISBN-13 978-3-540-49698-4 and more content").must_equal "978-3-540-49698-4"
|
79
81
|
ISBN.from_string("ISBN-10 3-921099-34-X and more content").must_equal "3-921099-34-X"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isbn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Kersey
|
@@ -9,10 +9,9 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-04-13 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description:
|
15
|
-
library to transform ISBN's from new to used, between 10 and 13, etc...
|
14
|
+
description: " library to transform ISBN's from new to used, between 10 and 13, etc...\n"
|
16
15
|
email: entangledstate@gmail.com
|
17
16
|
executables: []
|
18
17
|
extensions: []
|
@@ -27,7 +26,8 @@ files:
|
|
27
26
|
- lib/isbn.rb
|
28
27
|
- test/isbn_spec.rb
|
29
28
|
homepage: http://github.com/entangledstate/isbn
|
30
|
-
licenses:
|
29
|
+
licenses:
|
30
|
+
- MIT
|
31
31
|
metadata: {}
|
32
32
|
post_install_message:
|
33
33
|
rdoc_options: []
|
@@ -45,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
45
45
|
version: '0'
|
46
46
|
requirements: []
|
47
47
|
rubyforge_project:
|
48
|
-
rubygems_version: 2.
|
48
|
+
rubygems_version: 2.5.1
|
49
49
|
signing_key:
|
50
50
|
specification_version: 4
|
51
51
|
summary: a simple library of functions on ISBN's
|