isbn 2.0.10 → 2.0.11

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: d530f192ddd236c70bd7b27b0313367692f31873
4
- data.tar.gz: 24fc8d2238f0d0a1d66d355928499553f0be3f25
3
+ metadata.gz: c92ce156ae4d9d3ebf632e786fa35a9d93449305
4
+ data.tar.gz: 5bd5f2046649d7939458e1467795973372e1f3f6
5
5
  SHA512:
6
- metadata.gz: 0d3bb5e674f99e880ad41c4bb39821fe761fd33321867528963fbbdaba084a2ae6e24ab6fffe074e2c72d3405b627014ea3692daebc0941f5c02d6b2575c8a33
7
- data.tar.gz: 97f7b76332c69e9c25e3f600164349e327e4f95d8a015b16a1baf2a8d1336c9240e25207d407cd9c0bf54b56d6a878e5d5dfc5dc87497ebc4e2d0a200e8451a7
6
+ metadata.gz: 7b548c27e14b3176b2dbbc2efe0feadec412c2f765ba1df9890e7e219fc747ae8aafbfd9d7d7ee8e8d7a0efeccaeeacbc87d5d7b218dd00152fc23bd0da7d058
7
+ data.tar.gz: b51f98a67423fa2323d055966392d50b6cd1fb4507067bb5ee39b4c9d802e436b4703d9e5b3f3354029f23c54ac9004ee40916fdab4812c08eda0f61626f3f91
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.10
1
+ 2.0.11
@@ -12,6 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.email = "entangledstate@gmail.com"
13
13
  s.authors = ["Tim Kersey", "Jakub Kaflik"]
14
14
  s.has_rdoc = false
15
+ s.license = 'MIT'
15
16
 
16
17
  s.files = `git ls-files`.split("\n")
17
18
  s.test_files = `git ls-files test`.split("\n")
@@ -83,7 +83,7 @@ module ISBN
83
83
  end
84
84
 
85
85
  def from_string(source)
86
- regex = /(?:ISBN[- ]*13|ISBN[- ]*10|)\s*((?:(?:97[89])?[ -]?(?:[0-9][ -]*){9})[ -]*(?:[0-9xX]))/
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) }
@@ -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.10
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: 2014-10-05 00:00:00.000000000 Z
12
+ date: 2016-04-13 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: |2
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.4.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