bolognese 0.4.1 → 0.4.2

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: 782e0858e5840b106b79b3c340a3d4bf572840b9
4
- data.tar.gz: d85f7f7b269377b12a0ab25581001448ecd1dc92
3
+ metadata.gz: bf10f195bc1be468c9dddb8fa414f071b9389752
4
+ data.tar.gz: 0adbaa0ec469a01e4f68c59c21dacc5e2d4440e9
5
5
  SHA512:
6
- metadata.gz: e59c29a2b61e97623e4ff6b1284e695c26cdb780bac6458006d9863e84b4e1728d47983222fc5d1ee86e18683a796ba717f167af03e2952aaa3d0fa8ce8be19c
7
- data.tar.gz: 5f6eaeabccd3a86ff1534ad78bd34934539c3aa7351636983c299e9e953038068641aea0cfb5f18954be61b5db5e5c2de5e1ac9398ef2b6345fffc3b22ec1fbf
6
+ metadata.gz: 0b29dc6ca64a5fd2f5c2cbfe4ac393a5eddbaac1334d0f6d07c9462a5471f81103855faa70f923d29de19fe184c50bbc19acc26863e0585c8549c4b7b694f6b1
7
+ data.tar.gz: 8cf3694170ba6a2ecdb80ee3507bdafbcbaff9e05f5cd3e3ce439f29d42c07b5501298850e9f05f9bc9ce0ba09bc95368a20f784a20a55ad58a5e27324531a7c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (0.4.1)
4
+ bolognese (0.4.2)
5
5
  activesupport (~> 4.2, >= 4.2.5)
6
6
  builder (~> 3.2, >= 3.2.2)
7
7
  dotenv (~> 2.1, >= 2.1.1)
@@ -115,4 +115,4 @@ DEPENDENCIES
115
115
  webmock (~> 1.22, >= 1.22.3)
116
116
 
117
117
  BUNDLED WITH
118
- 1.12.5
118
+ 1.14.4
@@ -16,11 +16,9 @@ module Bolognese
16
16
  end
17
17
 
18
18
  def doi_from_url(url)
19
- if /(http|https):\/\/(dx\.)?doi\.org\/(\w+)/.match(url)
19
+ if /\A(?:(http|https):\/\/(dx\.)?doi.org\/)?(doi:)?(10\.\d{4,5}\/.+)\z/.match(url)
20
20
  uri = Addressable::URI.parse(url)
21
21
  uri.path[1..-1].downcase
22
- elsif url.is_a?(String) && url.starts_with?("doi:")
23
- url[4..-1].downcase
24
22
  end
25
23
  end
26
24
 
@@ -24,9 +24,9 @@ module Bolognese
24
24
  end
25
25
 
26
26
  def find_provider(id)
27
- if /(http|https):\/\/(dx\.)?doi\.org\/(\w+)/.match(id)
27
+ if /\A(?:(http|https):\/\/(dx\.)?doi.org\/)?(doi:)?(10\.\d{4,5}\/.+)\z/.match(id)
28
28
  get_doi_ra(id).fetch("id", nil)
29
- elsif /\A(?:http:\/\/orcid\.org\/)?(\d{4}-\d{4}-\d{4}-\d{3}[0-9X]+)\z/.match(id)
29
+ elsif /\A(?:(http|https):\/\/orcid\.org\/)?(\d{4}-\d{4}-\d{4}-\d{3}[0-9X]+)\z/.match(id)
30
30
  "orcid"
31
31
  else
32
32
  "schema_org"
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolognese
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner