diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a0340484..e4636cfc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- ruby: ["3.1", "3.2", "3.3"]
+ ruby: ["3.2", "3.3", "3.4", "4.0"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index aecb8cf1..c3a9ad47 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -14,7 +14,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
- ruby-version: "3.2.9"
+ ruby-version: "4.0.1"
- name: Build
run: |
diff --git a/Gemfile.lock b/Gemfile.lock
index 406215a5..10bed3de 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,250 +1,270 @@
PATH
remote: .
specs:
- bolognese (2.5.2)
- activesupport (= 7.2.3)
- benchmark_methods (~> 0.7)
- bibtex-ruby (>= 5.1.0)
- builder (~> 3.2, >= 3.2.2)
- citeproc-ruby (~> 1.1, >= 1.1.12)
- colorize (~> 0.8.1)
- concurrent-ruby (~> 1.1, >= 1.1.5)
- csl-styles (~> 1.0, >= 1.0.1.10)
- edtf (~> 3.0, >= 3.0.4)
- gender_detector (~> 0.1.2)
- iso8601 (~> 0.9.1)
- json-ld-preloaded (~> 3.1, >= 3.1.3)
- jsonlint (~> 0.3.0)
- loofah (~> 2.0, >= 2.0.3)
- maremma (~> 5.0)
- namae (~> 1.0)
- nokogiri (~> 1.16, >= 1.16.2)
- oj (~> 3.10)
- oj_mimic_json (~> 1.0, >= 1.0.1)
- postrank-uri (~> 1.0, >= 1.0.18)
- rdf-rdfxml (~> 3.1)
- rdf-turtle (~> 3.1)
- thor (>= 0.19)
+ bolognese (2.6.0)
+ activesupport (~> 8.1, >= 8.1.2)
+ bibtex-ruby (~> 6.2)
+ builder (~> 3.3)
+ citeproc-ruby (~> 2.1, >= 2.1.8)
+ concurrent-ruby (~> 1.3, >= 1.3.6)
+ csl-styles (~> 2.0, >= 2.0.2)
+ csv (~> 3.3, >= 3.3.5)
+ edtf (~> 3.2)
+ gender_detector (~> 2.1)
+ iso8601 (~> 0.13.0)
+ json-ld-preloaded (~> 3.3, >= 3.3.2)
+ jsonlint (~> 0.4.0)
+ loofah (~> 2.25)
+ maremma (~> 6.0)
+ namae (~> 1.2)
+ nokogiri (~> 1.19, >= 1.19.1)
+ oj (~> 3.16, >= 3.16.15)
+ rdf-rdfxml (~> 3.3)
+ rdf-turtle (~> 3.3, >= 3.3.1)
+ thor (~> 1.5)
GEM
remote: https://rubygems.org/
specs:
- activesupport (7.2.3)
+ activesupport (8.1.2)
base64
- benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
+ json
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
- addressable (2.8.1)
- public_suffix (>= 2.0.2, < 6.0)
+ uri (>= 0.13.1)
+ addressable (2.8.9)
+ public_suffix (>= 2.0.2, < 8.0)
base64 (0.3.0)
- benchmark (0.5.0)
- benchmark_methods (0.7)
- bibtex-ruby (6.0.0)
+ bcp47_spec (0.2.1)
+ bibtex-ruby (6.2.0)
latex-decode (~> 0.0)
+ logger (~> 1.7)
+ racc (~> 1.7)
bigdecimal (3.3.1)
- builder (3.2.4)
+ builder (3.3.0)
byebug (11.1.3)
citeproc (1.0.10)
namae (~> 1.0)
- citeproc-ruby (1.1.14)
+ citeproc-ruby (2.1.8)
citeproc (~> 1.0, >= 1.0.9)
- csl (~> 1.6)
- colorize (0.8.1)
- concurrent-ruby (1.3.5)
+ csl (~> 2.0)
+ observer (< 1.0)
+ concurrent-ruby (1.3.6)
connection_pool (2.5.5)
- crack (0.4.5)
+ crack (1.0.1)
+ bigdecimal
rexml
crass (1.0.6)
- csl (1.6.0)
+ csl (2.0.0)
namae (~> 1.0)
rexml
- csl-styles (1.0.1.11)
- csl (~> 1.0)
- diff-lcs (1.5.0)
- docile (1.4.0)
+ csl-styles (2.0.2)
+ csl (~> 2.0)
+ csv (3.3.5)
+ date (3.5.1)
+ diff-lcs (1.6.2)
+ docile (1.4.1)
drb (2.2.3)
- ebnf (2.3.3)
+ ebnf (2.6.0)
+ base64 (~> 0.2)
htmlentities (~> 4.3)
- rdf (~> 3.2)
+ rdf (~> 3.3)
scanf (~> 1.0)
- sxp (~> 1.2)
+ sxp (~> 2.0)
unicode-types (~> 1.8)
- edtf (3.1.1)
- activesupport (>= 3.0, < 8.0)
- excon (0.71.1)
- faraday (2.7.6)
- faraday-net_http (>= 2.0, < 3.1)
- ruby2_keywords (>= 0.0.4)
- faraday-encoding (0.0.5)
+ edtf (3.2.0)
+ activesupport (>= 3.0, < 9.0)
+ erb (6.0.2)
+ excon (1.4.0)
+ logger
+ faraday (2.14.1)
+ faraday-net_http (>= 2.0, < 3.5)
+ json
+ logger
+ faraday-encoding (0.0.6)
faraday
- faraday-excon (2.1.0)
- excon (>= 0.27.4)
- faraday (~> 2.0)
- faraday-follow_redirects (0.3.0)
+ faraday-excon (2.4.0)
+ excon (>= 1.0.0)
+ faraday (>= 2.11.0, < 3)
+ faraday-follow_redirects (0.5.0)
faraday (>= 1, < 3)
- faraday-gzip (0.1.0)
- faraday (>= 1.0)
- zlib (~> 2.1)
- faraday-multipart (1.0.4)
- multipart-post (~> 2)
- faraday-net_http (3.0.2)
- gender_detector (0.1.2)
- unicode_utils (>= 1.3.0)
- haml (5.2.2)
- temple (>= 0.8.0)
- tilt
+ faraday-gzip (3.1.0)
+ faraday (>= 2.0, < 3)
+ zlib (~> 3.0)
+ faraday-multipart (1.2.0)
+ multipart-post (~> 2.0)
+ faraday-net_http (3.4.2)
+ net-http (~> 0.5)
+ gender_detector (2.1.0)
hashdiff (1.0.1)
htmlentities (4.3.4)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
- iso8601 (0.9.1)
+ io-console (0.8.2)
+ irb (1.17.0)
+ pp (>= 0.6.0)
+ prism (>= 1.3.0)
+ rdoc (>= 4.0.0)
+ reline (>= 0.4.2)
+ iso8601 (0.13.0)
json (2.6.2)
- json-canonicalization (0.3.1)
- json-ld (3.2.4)
+ json-canonicalization (1.0.0)
+ json-ld (3.3.2)
htmlentities (~> 4.3)
- json-canonicalization (~> 0.3)
+ json-canonicalization (~> 1.0)
link_header (~> 0.0, >= 0.0.8)
multi_json (~> 1.15)
rack (>= 2.2, < 4)
- rdf (~> 3.2, >= 3.2.10)
- json-ld-preloaded (3.2.2)
- json-ld (~> 3.2)
- rdf (~> 3.2)
- jsonlint (0.3.0)
+ rdf (~> 3.3)
+ rexml (~> 3.2)
+ json-ld-preloaded (3.3.2)
+ json-ld (~> 3.3)
+ rdf (~> 3.3)
+ jsonlint (0.4.0)
oj (~> 3)
optimist (~> 3)
latex-decode (0.4.0)
link_header (0.0.8)
logger (1.7.0)
- loofah (2.21.3)
+ loofah (2.25.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
- maremma (5.0.0)
- activesupport (>= 4.2.5)
- addressable (>= 2.3.6)
+ maremma (6.0.0)
+ activesupport (~> 8.1, >= 8.1.2)
+ addressable (~> 2.8, >= 2.8.9)
builder (~> 3.2, >= 3.2.2)
- excon (~> 0.71.0)
+ excon (~> 1.3, >= 1.3.2)
faraday (>= 2.0)
- faraday-encoding (~> 0.0.5)
- faraday-excon (~> 2.1.0)
- faraday-follow_redirects (~> 0.3.0)
- faraday-gzip (~> 0.1.0)
- faraday-multipart (~> 1.0.4)
- nokogiri (~> 1.16, >= 1.16.2)
- oj (>= 2.8.3)
+ faraday-encoding (~> 0.0.6)
+ faraday-excon (~> 2.4.0)
+ faraday-follow_redirects (~> 0.5.0)
+ faraday-gzip (~> 3.1.0)
+ faraday-multipart (~> 1.2.0)
+ nokogiri (~> 1.19, >= 1.19.1)
+ oj (~> 3.16, >= 3.16.15)
oj_mimic_json (~> 1.0, >= 1.0.1)
matrix (0.4.2)
mini_portile2 (2.8.5)
- minitest (5.18.0)
+ minitest (6.0.2)
+ drb (~> 2.0)
+ prism (~> 1.5)
multi_json (1.15.0)
- multipart-post (2.3.0)
- namae (1.1.1)
- nokogiri (1.16.2)
+ multipart-post (2.4.1)
+ namae (1.2.0)
+ racc (~> 1.7)
+ net-http (0.9.1)
+ uri (>= 0.11.1)
+ nokogiri (1.19.1)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
- oj (3.14.2)
+ observer (0.1.2)
+ oj (3.16.15)
+ bigdecimal (>= 3.0)
+ ostruct (>= 0.2)
oj_mimic_json (1.0.1)
optimist (3.0.1)
- postrank-uri (1.0.24)
- addressable (>= 2.4.0)
- nokogiri (>= 1.8.0)
- public_suffix (>= 2.0.0, < 2.1)
- public_suffix (2.0.5)
- racc (1.6.0)
+ ostruct (0.6.3)
+ pp (0.6.3)
+ prettyprint
+ prettyprint (0.2.0)
+ prism (1.9.0)
+ psych (5.3.1)
+ date
+ stringio
+ public_suffix (4.0.7)
+ racc (1.8.1)
rack (2.2.4)
- rack-test (0.8.3)
- rack (>= 1.0, < 3)
- rake (12.3.3)
- rdf (3.2.11)
+ rack-test (2.2.0)
+ rack (>= 1.3)
+ rake (13.3.1)
+ rdf (3.3.4)
+ bcp47_spec (~> 0.2)
+ bigdecimal (~> 3.1, >= 3.1.5)
link_header (~> 0.0, >= 0.0.8)
- rdf-aggregate-repo (3.2.1)
- rdf (~> 3.2)
- rdf-rdfa (3.2.2)
- haml (>= 5.2, < 7)
- htmlentities (~> 4.3)
- rdf (~> 3.2)
- rdf-aggregate-repo (~> 3.2)
- rdf-vocab (~> 3.2)
- rdf-xsd (~> 3.2)
- rdf-rdfxml (3.2.1)
- haml (~> 5.2)
+ logger (~> 1.5)
+ ostruct (~> 0.6)
+ readline (~> 0.0)
+ rdf-rdfxml (3.3.0)
+ builder (~> 3.2, >= 3.2.4)
htmlentities (~> 4.3)
- rdf (~> 3.2)
- rdf-rdfa (~> 3.2)
- rdf-xsd (~> 3.2)
- rdf-turtle (3.2.1)
- ebnf (~> 2.3)
- rdf (~> 3.2)
- rdf-vocab (3.2.6)
- rdf (~> 3.2, >= 3.2.4)
- rdf-xsd (3.2.1)
- rdf (~> 3.2)
+ rdf (~> 3.3)
+ rdf-xsd (~> 3.3)
+ rdf-turtle (3.3.1)
+ base64 (~> 0.2)
+ bigdecimal (~> 3.1, >= 3.1.5)
+ ebnf (~> 2.5)
+ rdf (~> 3.3)
+ rdf-xsd (3.3.0)
+ rdf (~> 3.3)
rexml (~> 3.2)
+ rdoc (7.2.0)
+ erb
+ psych (>= 4.0.0)
+ tsort
+ readline (0.0.4)
+ reline
+ reline (0.6.3)
+ io-console (~> 0.5)
rexml (3.2.5)
- rspec (3.11.0)
- rspec-core (~> 3.11.0)
- rspec-expectations (~> 3.11.0)
- rspec-mocks (~> 3.11.0)
- rspec-core (3.11.0)
- rspec-support (~> 3.11.0)
- rspec-expectations (3.11.1)
+ rspec (3.13.2)
+ rspec-core (~> 3.13.0)
+ rspec-expectations (~> 3.13.0)
+ rspec-mocks (~> 3.13.0)
+ rspec-core (3.13.6)
+ rspec-support (~> 3.13.0)
+ rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.11.0)
- rspec-mocks (3.11.1)
+ rspec-support (~> 3.13.0)
+ rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.11.0)
- rspec-support (3.11.1)
- rspec-xsd (0.1.0)
- nokogiri (~> 1.6)
- rspec (~> 3)
- ruby2_keywords (0.0.5)
+ rspec-support (~> 3.13.0)
+ rspec-support (3.13.7)
scanf (1.0.0)
securerandom (0.4.1)
- simplecov (0.17.1)
+ simplecov (0.22.0)
docile (~> 1.1)
- json (>= 1.8, < 3)
- simplecov-html (~> 0.10.0)
- simplecov-html (0.10.2)
- sxp (1.2.4)
+ simplecov-html (~> 0.11)
+ simplecov_json_formatter (~> 0.1)
+ simplecov-html (0.13.2)
+ simplecov_json_formatter (0.1.4)
+ stringio (3.2.0)
+ sxp (2.0.0)
matrix (~> 0.4)
- rdf (~> 3.2)
- temple (0.10.2)
- thor (1.2.2)
- tilt (2.2.0)
+ rdf (~> 3.3)
+ thor (1.5.0)
+ tsort (0.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-types (1.8.0)
- unicode_utils (1.4.0)
- vcr (3.0.3)
- webmock (3.18.1)
+ uri (1.1.1)
+ vcr (6.4.0)
+ webmock (3.26.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
- zlib (2.1.1)
+ zlib (3.2.2)
PLATFORMS
ruby
DEPENDENCIES
bolognese!
- bundler (>= 1.0)
+ bundler (>= 2.0)
byebug
- hashdiff (>= 1.0.0.beta1, < 2.0.0)
- json-canonicalization (= 0.3.1)
- rack-test (~> 0)
- rake (~> 12.0)
- rspec (~> 3.4)
- rspec-xsd (~> 0.1.0)
- simplecov (= 0.17.1)
- vcr (~> 3.0, >= 3.0.3)
- webmock (~> 3.0, >= 3.0.1)
+ irb
+ rack-test (~> 2.2)
+ rake (~> 13.3, >= 13.3.1)
+ rspec (~> 3.13, >= 3.13.2)
+ simplecov (= 0.22.0)
+ vcr (~> 6.4)
+ webmock (~> 3.26, >= 3.26.1)
BUNDLED WITH
2.5.5
diff --git a/bolognese.gemspec b/bolognese.gemspec
index 96231b06..79b24e68 100644
--- a/bolognese.gemspec
+++ b/bolognese.gemspec
@@ -13,43 +13,38 @@ Gem::Specification.new do |s|
s.version = Bolognese::VERSION
s.extra_rdoc_files = ["README.md"]
s.license = 'MIT'
- s.required_ruby_version = ['>= 3.1', '<= 3.3.10']
+ s.required_ruby_version = ['>= 3.2', '< 4.1']
# Declare dependencies here, rather than in the Gemfile
- s.add_dependency 'maremma', '~> 5.0'
- s.add_dependency 'nokogiri', '~> 1.16', '>= 1.16.2'
- s.add_dependency 'loofah', '~> 2.0', '>= 2.0.3'
- s.add_dependency 'builder', '~> 3.2', '>= 3.2.2'
- s.add_dependency 'activesupport', '7.2.3'
- s.add_dependency 'bibtex-ruby', '>= 5.1.0'
- s.add_dependency 'thor', '>= 0.19'
- s.add_dependency 'colorize', '~> 0.8.1'
- s.add_dependency 'namae', '~> 1.0'
- s.add_dependency 'edtf', '~> 3.0', '>= 3.0.4'
- s.add_dependency 'citeproc-ruby', '~> 1.1', '>= 1.1.12'
- s.add_dependency 'csl-styles', '~> 1.0', '>= 1.0.1.10'
- s.add_dependency 'iso8601', '~> 0.9.1'
- s.add_dependency 'postrank-uri', '~> 1.0', '>= 1.0.18'
- s.add_dependency 'json-ld-preloaded', '~> 3.1', '>= 3.1.3'
- s.add_dependency 'jsonlint', '~> 0.3.0'
- s.add_dependency 'oj', '~> 3.10'
- s.add_dependency "oj_mimic_json", "~> 1.0", ">= 1.0.1"
- s.add_dependency 'rdf-turtle', '~> 3.1'
- s.add_dependency 'rdf-rdfxml', '~> 3.1'
- s.add_dependency 'benchmark_methods', '~> 0.7'
- s.add_dependency 'gender_detector', '~> 0.1.2'
- s.add_dependency 'concurrent-ruby', '~> 1.1', '>= 1.1.5'
- s.add_development_dependency 'bundler', '>= 1.0'
- s.add_development_dependency 'rspec', '~> 3.4'
- s.add_development_dependency 'rspec-xsd', '~> 0.1.0'
- s.add_development_dependency 'rake', '~> 12.0'
- s.add_development_dependency 'rack-test', '~> 0'
- s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.3'
- s.add_development_dependency 'webmock', '~> 3.0', '>= 3.0.1'
- s.add_development_dependency 'simplecov', '0.17.1'
- s.add_development_dependency 'hashdiff', ['>= 1.0.0.beta1', '< 2.0.0']
+ s.add_dependency 'maremma', '~> 6.0'
+ s.add_dependency 'nokogiri', '~> 1.19', '>= 1.19.1'
+ s.add_dependency 'loofah', '~> 2.25'
+ s.add_dependency 'builder', '~> 3.3'
+ s.add_dependency 'activesupport', "~> 8.1", ">= 8.1.2"
+ s.add_dependency 'bibtex-ruby', '~> 6.2'
+ s.add_dependency 'thor', '~> 1.5'
+ s.add_dependency 'namae', '~> 1.2'
+ s.add_dependency 'edtf', '~> 3.2'
+ s.add_dependency 'citeproc-ruby', '~> 2.1', '>= 2.1.8'
+ s.add_dependency 'csl-styles', '~> 2.0', '>= 2.0.2'
+ s.add_dependency 'iso8601', '~> 0.13.0'
+ s.add_dependency 'json-ld-preloaded', '~> 3.3', '>= 3.3.2'
+ s.add_dependency 'jsonlint', '~> 0.4.0'
+ s.add_dependency 'oj', '~> 3.16', '>= 3.16.15'
+ s.add_dependency 'rdf-turtle', '~> 3.3', '>= 3.3.1'
+ s.add_dependency 'rdf-rdfxml', '~> 3.3'
+ s.add_dependency 'gender_detector', '~> 2.1'
+ s.add_dependency 'concurrent-ruby', '~> 1.3', '>= 1.3.6'
+ s.add_dependency 'csv', '~> 3.3', '>= 3.3.5'
+ s.add_development_dependency 'bundler', '>= 2.0'
+ s.add_development_dependency 'irb'
+ s.add_development_dependency 'rspec', '~> 3.13', '>= 3.13.2'
+ s.add_development_dependency 'rake', '~> 13.3', '>= 13.3.1'
+ s.add_development_dependency 'rack-test', '~> 2.2'
+ s.add_development_dependency 'vcr', '~> 6.4'
+ s.add_development_dependency 'webmock', '~> 3.26', '>= 3.26.1'
+ s.add_development_dependency 'simplecov', '0.22.0'
s.add_development_dependency 'byebug'
- s.add_development_dependency 'json-canonicalization', '0.3.1'
s.require_paths = ["lib"]
s.files = `git ls-files`.split($/).reject { |f| f.match(%r{^(test|spec|features)/}) }
diff --git a/lib/bolognese.rb b/lib/bolognese.rb
index 364807b5..0a697b63 100644
--- a/lib/bolognese.rb
+++ b/lib/bolognese.rb
@@ -3,9 +3,7 @@
require 'active_support/all'
require 'nokogiri'
require 'maremma'
-require 'postrank-uri'
require 'bibtex'
-require 'colorize'
require 'loofah'
require 'json/ld'
require 'rdf/turtle'
@@ -13,9 +11,7 @@
require 'logger'
require 'iso8601'
require 'jsonlint'
-require 'benchmark_methods'
require 'gender_detector'
-require 'citeproc/ruby'
require 'citeproc'
require 'csl/styles'
require 'edtf'
diff --git a/lib/bolognese/author_utils.rb b/lib/bolognese/author_utils.rb
index 128652f2..a269de33 100644
--- a/lib/bolognese/author_utils.rb
+++ b/lib/bolognese/author_utils.rb
@@ -4,9 +4,6 @@
module Bolognese
module AuthorUtils
- # include BenchmarkMethods
- #
- # benchmark :get_authors
IDENTIFIER_SCHEME_URIS = {
"ORCID" => "https://orcid.org/"
diff --git a/lib/bolognese/metadata_utils.rb b/lib/bolognese/metadata_utils.rb
index 4cbf434f..718aa20d 100644
--- a/lib/bolognese/metadata_utils.rb
+++ b/lib/bolognese/metadata_utils.rb
@@ -33,7 +33,6 @@
module Bolognese
module MetadataUtils
- # include BenchmarkMethods
include Bolognese::DoiUtils
include Bolognese::AuthorUtils
include Bolognese::DataciteUtils
diff --git a/lib/bolognese/readers/datacite_reader.rb b/lib/bolognese/readers/datacite_reader.rb
index f989b09b..151a8269 100644
--- a/lib/bolognese/readers/datacite_reader.rb
+++ b/lib/bolognese/readers/datacite_reader.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: true
+require 'base64'
+
module Bolognese
module Readers
module DataciteReader
diff --git a/lib/bolognese/utils.rb b/lib/bolognese/utils.rb
index 97ec7fa8..7ae2b762 100644
--- a/lib/bolognese/utils.rb
+++ b/lib/bolognese/utils.rb
@@ -668,7 +668,7 @@ def normalize_id(id, options={})
return nil unless uri && uri.host && %w(http https).include?(uri.scheme)
# clean up URL
- PostRank::URI.clean(id)
+ normalize_uri_with_path_cleanup(uri)
rescue Addressable::URI::InvalidURIError
nil
end
@@ -688,9 +688,7 @@ def normalize_url(id, options={})
uri.scheme = "https" if options[:https]
# clean up URL
- uri.path = PostRank::URI.clean(uri.path)
-
- uri.to_s
+ normalize_uri_with_path_cleanup(uri)
rescue Addressable::URI::InvalidURIError
nil
end
@@ -1493,5 +1491,13 @@ def generate_container(types, related_items, related_identifiers, descriptions)
}.compact
end
end
+
+ private
+
+ def normalize_uri_with_path_cleanup(uri)
+ normalized_uri = uri.normalize
+ normalized_uri.path = normalized_uri.path.sub(%r{/\z}, "") if normalized_uri.path.present?
+ normalized_uri.to_s
+ end
end
end
diff --git a/lib/bolognese/version.rb b/lib/bolognese/version.rb
index 5473321f..35681ef1 100644
--- a/lib/bolognese/version.rb
+++ b/lib/bolognese/version.rb
@@ -1,3 +1,3 @@
module Bolognese
- VERSION = "2.5.2"
+ VERSION = "2.6.0"
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 0a54f32d..7a0af919 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -11,13 +11,11 @@
require 'rspec'
require 'rack/test'
require 'webmock/rspec'
-require 'rspec/xsd'
require 'nokogiri'
require 'vcr'
RSpec.configure do |config|
config.order = :random
- config.include RSpec::XSD
config.include WebMock::API
config.include Rack::Test::Methods
config.expect_with :rspec do |c|
diff --git a/spec/writers/citation_writer_spec.rb b/spec/writers/citation_writer_spec.rb
index 39f1857a..4195d0d5 100644
--- a/spec/writers/citation_writer_spec.rb
+++ b/spec/writers/citation_writer_spec.rb
@@ -24,7 +24,7 @@
input = "https://doi.org/10.5061/DRYAD.8515"
subject = Bolognese::Metadata.new(input: input, from: "datacite")
- expect(subject.citation).to eq("Ollomo, B., Durand, P., Prugnolle, F., Douzery, E. J. P., Arnathau, C., Nkoghe, D., Leroy, E., & Renaud, F. (2011). Data from: A new malaria agent in African hominids. (Version 1) [Data set]. Dryad. https://doi.org/10.5061/dryad.8515")
+ expect(subject.citation).to eq("Ollomo, B., Durand, P., Prugnolle, F., Douzery, E. J. P., Arnathau, C., Nkoghe, D., Leroy, E., & Renaud, F. (2011). Data from: A new malaria agent in African hominids. (Version 1) [Dataset]. Dryad. https://doi.org/10.5061/dryad.8515")
end
it "Missing author" do
@@ -38,7 +38,7 @@
subject = Bolognese::Metadata.new(input: input, from: "datacite")
expect(subject.style).to eq("apa")
expect(subject.locale).to eq("en-US")
- expect(subject.citation).to eq("Lab for Exosphere and Near Space Environment Studies. (2019). lenses-lab/LYAO_RT-2018JA026426: Original Release (Version 1.0.0) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.2598836")
+ expect(subject.citation).to eq("Lab for Exosphere and Near Space Environment Studies. (2019). lenses-lab/LYAO_RT-2018JA026426: Original Release (Version 1.0.0). Zenodo. https://doi.org/10.5281/zenodo.2598836")
end
it "interactive resource without dates" do
@@ -46,7 +46,7 @@
subject = Bolognese::Metadata.new(input: input, from: "datacite")
expect(subject.style).to eq("apa")
expect(subject.locale).to eq("en-US")
- expect(subject.citation).to eq("Clark, D. (2019). Exploring the \"Many analysts, one dataset\" project from COS. Gigantum, Inc. https://doi.org/10.34747/g6yb-3412")
+ expect(subject.citation).to eq('Clark, D. (2019). Exploring the "Many analysts, one dataset" project from COS. Gigantum, Inc. https://doi.org/10.34747/g6yb-3412')
end
it "journal article with container title" do
@@ -65,7 +65,7 @@
subject = Bolognese::Metadata.new(input: input)
expect(subject.style).to eq("apa")
expect(subject.locale).to eq("en-US")
- expect(subject.citation).to eq('Fenner, M. (2016). Eating your own Dog Food. In Understanding the fictional John Smith (No.1; Version 1.0, 1st ed., Vol. 776, Issue 1, pp. 50–60). DataCite. https://doi.org/10.5438/4k3m-nyvg')
+ expect(subject.citation).to eq("Fenner, M. (2016). Eating your own Dog Food. In Understanding the fictional John Smith (No. 1; Version 1.0, 1st ed., Vol. 776, Issue 1, pp. 50–60). DataCite. https://doi.org/10.5438/4k3m-nyvg")
end
it "journal article with full container harvard citation" do
@@ -74,7 +74,7 @@
subject.style = "harvard-cite-them-right"
expect(subject.style).to eq("harvard-cite-them-right")
expect(subject.locale).to eq("en-US")
- expect(subject.citation).to eq('Fenner, M. (2016) “Eating your own Dog Food,” Understanding the fictional John Smith. 1st edn. DataCite. doi: 10.5438/4k3m-nyvg.')
+ expect(subject.citation).to eq('Fenner, M. (2016) “Eating your own Dog Food,” Understanding the fictional John Smith. 1st edn. DataCite. Available at: https://doi.org/10.5438/4k3m-nyvg.')
end
it "journal article with full container and mla citation" do
@@ -83,7 +83,7 @@
subject.style = "modern-language-association"
expect(subject.style).to eq("modern-language-association")
expect(subject.locale).to eq("en-US")
- expect(subject.citation).to eq('Fenner, Martin. “Eating Your Own Dog Food.” Understanding the Fictional John Smith, 1st ed., 1.0, vol. 776, no. 1, 1, DataCite, 20 Dec. 2016, pp. 50–60, doi:10.5438/4k3m-nyvg.')
+ expect(subject.citation).to eq('Fenner, Martin. “Eating Your Own Dog Food.” Understanding the Fictional John Smith, 1st ed., version 1.0, vol. 776, no. 1, no. 1, DataCite, 20 Dec. 2016, pp. 50–60, https://doi.org/10.5438/4k3m-nyvg.')
end
it "journal article with full container and vancouver citation" do
@@ -92,16 +92,16 @@
subject.style = "vancouver"
expect(subject.style).to eq("vancouver")
expect(subject.locale).to eq("en-US")
- expect(subject.citation).to eq('Fenner M. Eating your own Dog Food [Internet]. 1st ed. Vol. 776, Understanding the fictional John Smith. DataCite; 2016. p. 50–60. Available from: https://datacite.org/blog/eating-your-own-dog-food.html')
+ expect(subject.citation).to eq("Fenner M. Eating your own Dog Food [Internet]. 1st ed. Vol. 776, Understanding the fictional John Smith. DataCite; 2016. p. 50–60. Available from: https://datacite.org/blog/eating-your-own-dog-food.html")
end
it "journal article with full container and chicago citation" do
input = fixture_path + "datacite_with_container_and_seriesinformation_and_relateditem.json"
subject = Bolognese::Metadata.new(input: input)
- subject.style = "chicago-fullnote-bibliography"
- expect(subject.style).to eq("chicago-fullnote-bibliography")
+ subject.style = "chicago-notes-bibliography"
+ expect(subject.style).to eq("chicago-notes-bibliography")
expect(subject.locale).to eq("en-US")
- expect(subject.citation).to eq('Fenner, Martin. “Eating Your Own Dog Food.” Understanding the Fictional John Smith. DataCite, December 20, 2016. https://doi.org/10.5438/4k3m-nyvg.')
+ expect(subject.citation).to eq('Fenner, Martin. “Eating Your Own Dog Food.” Chap. 1 in Understanding the Fictional John Smith, No. 1, version 1.0, 1st ed., vol. 776. no. 1. DataCite, 2016. https://doi.org/10.5438/4k3m-nyvg.')
end
it "journal article with full container and ieee citation" do
@@ -110,7 +110,7 @@
subject.style = "ieee"
expect(subject.style).to eq("ieee")
expect(subject.locale).to eq("en-US")
- expect(subject.citation).to eq('M. Fenner, “Eating your own Dog Food,” Understanding the fictional John Smith, vol. 776, no. 1. DataCite, pp. 50–60, Dec. 20, 2016, doi: 10.5438/4k3m-nyvg.')
+ expect(subject.citation).to eq("M. Fenner, “Eating your own Dog Food,” Understanding the fictional John Smith, vol. 776, no. 1. DataCite, pp. 50–60, Dec. 20, 2016. doi: 10.5438/4k3m-nyvg.")
end
end
end