identifiers 0.9.0 → 0.9.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17d7278289ac40fc4fa68b488e85c98ada612f6f
4
- data.tar.gz: e846cd17ac15a7cb87705c288eb8c41336721183
3
+ metadata.gz: ec8a0b18c19c41e22a23fe7232fba3d68f6284bc
4
+ data.tar.gz: 6aabefd1543b85621dcb2fd8ef7efac9c90663ce
5
5
  SHA512:
6
- metadata.gz: 5a978d601dee61a25f5f66330e6e9bcd995fe1f217bdf43284350cc678574a1890a25ff289ad50ccebb25545da98acd459cd421e98e32d4e3c5266a41a84eb69
7
- data.tar.gz: 30ef27cea3bc785f8f0ed841ac1f8cbfaa1e261b8a00afa9f0d942db0b8bc913f4e39f6ea91068f8eb7054a4cae1d04b17bd47956d3c7759d5ff9d5c2bed01b3
6
+ metadata.gz: f2adc7eb0afd80c19a11613d31ca6a9cdbb78fde6c2db5da5fc3e17c70f0c21bd898b642c8c8bb7bc870bd00dcaef0f108d96b9f86c68ada261dd64ac629a63d
7
+ data.tar.gz: f55f43f354984751504c3b9f91790b544a0c66396d6c189b750f835a7eb0c2bac3a71ff4ca20e0b6e49a6363c1303f13ab01bc3b908983c26da33aecabd5fbf7
data/CHANGELOG.md CHANGED
@@ -2,9 +2,14 @@
2
2
  All notable changes to this project will be documented in this file. This
3
3
  project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [0.9.1] - 2017-08-01
6
+ ### Fixed
7
+ - Don't extract duplicate ISBN-10s from within ISBN-13s
8
+
5
9
  ## [0.9.0] - 2017-07-31
6
10
  ### Added
7
11
  - Support extraction of multiple ISBNs separated by a single space
12
+ - Support passing nil to any of the extract methods
8
13
 
9
14
  ## [0.8.1] - 2017-04-10
10
15
  ### Fixed
@@ -57,3 +62,4 @@ project adheres to [Semantic Versioning](http://semver.org/).
57
62
  [0.8.0]: https://github.com/altmetric/identifiers/releases/tag/v0.8.0
58
63
  [0.8.1]: https://github.com/altmetric/identifiers/releases/tag/v0.8.1
59
64
  [0.9.0]: https://github.com/altmetric/identifiers/releases/tag/v0.9.0
65
+ [0.9.1]: https://github.com/altmetric/identifiers/releases/tag/v0.9.1
@@ -12,6 +12,10 @@ module Identifiers
12
12
  \b
13
13
  /x
14
14
  ISBN_10_REGEXP = /
15
+ (?<! # Don't match a hyphenated or spaced ISBN-13
16
+ 97[89]
17
+ [\p{Pd}\p{Zs}]
18
+ )
15
19
  \b
16
20
  (?:
17
21
  \d # Digit
@@ -86,4 +86,12 @@ RSpec.describe Identifiers::ISBN do
86
86
  it 'does not extract invalid 10-digit ISBNs' do
87
87
  expect(described_class.extract('3319217280')).to be_empty
88
88
  end
89
+
90
+ it 'does not extract ISBN-10s from hyphenated ISBN-13s' do
91
+ expect(described_class.extract('978-0-309-57079-4')).to contain_exactly('9780309570794')
92
+ end
93
+
94
+ it 'does not extract ISBN-10s from space-separated ISBN-13s' do
95
+ expect(described_class.extract('978 0 309 57079 4')).to contain_exactly('9780309570794')
96
+ end
89
97
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: identifiers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Hernandez
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-07-31 00:00:00.000000000 Z
12
+ date: 2017-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: urn