bolognese 2.5.2 → 2.6.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.
@@ -668,7 +668,7 @@ module Bolognese
668
668
  return nil unless uri && uri.host && %w(http https).include?(uri.scheme)
669
669
 
670
670
  # clean up URL
671
- PostRank::URI.clean(id)
671
+ normalize_uri_with_path_cleanup(uri)
672
672
  rescue Addressable::URI::InvalidURIError
673
673
  nil
674
674
  end
@@ -688,9 +688,7 @@ module Bolognese
688
688
  uri.scheme = "https" if options[:https]
689
689
 
690
690
  # clean up URL
691
- uri.path = PostRank::URI.clean(uri.path)
692
-
693
- uri.to_s
691
+ normalize_uri_with_path_cleanup(uri)
694
692
  rescue Addressable::URI::InvalidURIError
695
693
  nil
696
694
  end
@@ -1493,5 +1491,13 @@ module Bolognese
1493
1491
  }.compact
1494
1492
  end
1495
1493
  end
1494
+
1495
+ private
1496
+
1497
+ def normalize_uri_with_path_cleanup(uri)
1498
+ normalized_uri = uri.normalize
1499
+ normalized_uri.path = normalized_uri.path.sub(%r{/\z}, "") if normalized_uri.path.present?
1500
+ normalized_uri.to_s
1501
+ end
1496
1502
  end
1497
1503
  end
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "2.5.2"
2
+ VERSION = "2.6.1"
3
3
  end
data/lib/bolognese.rb CHANGED
@@ -3,9 +3,7 @@
3
3
  require 'active_support/all'
4
4
  require 'nokogiri'
5
5
  require 'maremma'
6
- require 'postrank-uri'
7
6
  require 'bibtex'
8
- require 'colorize'
9
7
  require 'loofah'
10
8
  require 'json/ld'
11
9
  require 'rdf/turtle'
@@ -13,13 +11,12 @@ require 'rdf/rdfxml'
13
11
  require 'logger'
14
12
  require 'iso8601'
15
13
  require 'jsonlint'
16
- require 'benchmark_methods'
17
14
  require 'gender_detector'
18
- require 'citeproc/ruby'
19
15
  require 'citeproc'
20
16
  require 'csl/styles'
21
17
  require 'edtf'
22
18
 
19
+ require "bolognese/citeproc_extensions"
23
20
  require "bolognese/version"
24
21
  require "bolognese/metadata"
25
22
  require "bolognese/cli"