bolognese 0.8.12 → 0.8.13

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: 908ebf930f87a917517af6c80e8e125e298a3356
4
- data.tar.gz: e73f82d5defc0eb50f3958f158f2538b51e0ccbb
3
+ metadata.gz: 2369ba9f739cdf61b879479f95a5732f967eb37e
4
+ data.tar.gz: 6d707dfe7018625eec5fcb0717562be17cabebdf
5
5
  SHA512:
6
- metadata.gz: c9a0f37edfdb9c2ca090c740ae09694b7f193d9934f44826d179c754a884fa7a05af4130f26dbb7663322a947b15387eb39c83581bbd3407fd77ffb069d16008
7
- data.tar.gz: 8c5a7f8db36646e15a5beddfdc9bdf13bb45bbfcf098da46faa23320cd6c77fc089b817d6c705f239f11cb32fb4857274af3469bbafe7a7fd907e976e3b35b4d
6
+ metadata.gz: 3f634c7a9ca25143d6d0af60e147a753de70471d55016f98bf2f5f75fbd2cc509c19c731ddca33ce25823ae37674763c674689a316491363c5af1bf73886ef5a
7
+ data.tar.gz: 1958c1d8d9938e8c26ed04b3f39100f3f0a95822ff3959f3ad6ac501ee3f0c85654f47f5c1deb579e73d07f4c657ae4c67c6d9ed470a8a9c7961d6a9405c01a3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (0.8.12)
4
+ bolognese (0.8.13)
5
5
  activesupport (~> 4.2, >= 4.2.5)
6
6
  bibtex-ruby (~> 4.1)
7
7
  builder (~> 3.2, >= 3.2.2)
@@ -124,4 +124,4 @@ DEPENDENCIES
124
124
  webmock (~> 1.22, >= 1.22.3)
125
125
 
126
126
  BUNDLED WITH
127
- 1.12.5
127
+ 1.14.6
@@ -22,7 +22,7 @@ module Bolognese
22
22
  def doi_from_url(url)
23
23
  if /\A(?:(http|https):\/\/(dx\.)?doi.org\/)?(doi:)?(10\.\d{4,5}\/.+)\z/.match(url)
24
24
  uri = Addressable::URI.parse(url)
25
- uri.path[1..-1].downcase
25
+ uri.path.gsub(/^\//, '').downcase
26
26
  end
27
27
  end
28
28
 
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "0.8.12"
2
+ VERSION = "0.8.13"
3
3
  end
@@ -66,6 +66,23 @@ describe Bolognese::Metadata, vcr: true do
66
66
  end
67
67
  end
68
68
 
69
+ context "doi_from_url" do
70
+ it "url" do
71
+ doi = subject.doi_from_url("https://doi.org/10.5061/dryad.8515")
72
+ expect(doi).to eq("10.5061/dryad.8515")
73
+ end
74
+
75
+ it "doi" do
76
+ doi = subject.doi_from_url("10.5061/dryad.8515")
77
+ expect(doi).to eq("10.5061/dryad.8515")
78
+ end
79
+
80
+ it "not a doi" do
81
+ doi = subject.doi_from_url("https://doi.org/10.5061")
82
+ expect(doi).to be nil
83
+ end
84
+ end
85
+
69
86
  context "doi registration agency" do
70
87
  it "datacite" do
71
88
  doi = "https://doi.org/10.5061/dryad.8515"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolognese
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.12
4
+ version: 0.8.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-10 00:00:00.000000000 Z
11
+ date: 2017-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma