pubid-core 1.3.0 → 1.4.0

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
  SHA256:
3
- metadata.gz: 044351542136162d7aca14a0c3f2997c922c7cee236b2ba5e849284ed3c0b2eb
4
- data.tar.gz: '07709b34769d3aef2501c8e715a5757273e0010f332b45760742fdf1b832c617'
3
+ metadata.gz: b1e2dbeb108d767054166d4fec9c0bb64e5c3a7ebb8811dc4f97de4c6cea4e93
4
+ data.tar.gz: 0aa8be27d6b839e6e985d8ce1a376d6fbe55ef07e87a664ac902c455e937c887
5
5
  SHA512:
6
- metadata.gz: c8485180c9bbfd44d7e7f2d8a80177171e17bbd3db278d22a440b470ee82747fbcf5e888872773522aa35106028360dd7318a7af4b091290dbcb11d2835d9f41
7
- data.tar.gz: d44abfc112288e85c383f0d9871bf0904cf8dd13a2e5808043371806961bec0b39fa263fd2bcf55e1e31ad099d96b8c80c0834b6258dcc706a9f5fae43646693
6
+ metadata.gz: 06b053ef1516f1fbe0524171fbc27afd6659e301cabb6692fb46be8b746807f6e21e081c48bc10f8cb1be282607154a7f084850f117c62e3748f8e2de1b25922
7
+ data.tar.gz: d3f441ccc72743f752b81eb993c7c71088442c1c53376412553a809464473048a29e80503673962d6b496dd9efc1979ed191f35dea08d9f3f19032073bba3711
@@ -86,21 +86,23 @@ module Pubid::Core::Renderer
86
86
  end
87
87
 
88
88
  def render_base(params, prefix = "")
89
- "%{publisher}%{copublisher}#{prefix} %{number}" % params
89
+ "%{publisher}#{prefix} %{number}" % params
90
90
  end
91
91
 
92
92
  def render_identifier(params)
93
93
  render_base(params)
94
94
  end
95
95
 
96
- def render_copublisher(copublisher, _opts, _params)
97
- # (!@copublisher.is_a?(Array) && [@copublisher]) || @copublisher
98
- if copublisher.is_a?(Array)
99
- copublisher.map(&:to_s).sort.map do |copublisher|
100
- "/#{copublisher.gsub('-', '/')}"
101
- end.join
96
+ def render_publisher(publisher, _opts, params)
97
+ return publisher unless params[:copublisher]
98
+
99
+ case params[:copublisher]
100
+ when Array
101
+ ([publisher] + params[:copublisher].map(&:to_s).sort.map(&:to_s)).map do |pub|
102
+ pub.gsub('-', '/')
103
+ end.join("/")
102
104
  else
103
- "/#{copublisher}"
105
+ [publisher, params[:copublisher]].join("/")
104
106
  end
105
107
  end
106
108
 
@@ -1,5 +1,5 @@
1
1
  module Pubid
2
2
  module Core
3
- VERSION = "1.3.0".freeze
3
+ VERSION = "1.4.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubid-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-01 00:00:00.000000000 Z
11
+ date: 2022-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake