pubid-core 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pubid/core/renderer/base.rb +2 -2
- data/lib/pubid/core/supplement.rb +10 -5
- data/lib/pubid/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64a6316ad207f1d35b7c91406887d54cdb839765ce1d7aed4fc4a2ce5c27b9ce
|
4
|
+
data.tar.gz: 9b54bb81e84b0e90a46e70ddbdf48c0cb73438e84c66c6e144bd010954f475ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b18da4c3bb53562b9556948b631be4525d62b9bd244f93889328c6359f73df90c1159f8a08ace0d641644255ac072c8378a48e3f720b909dce8cafa6d8a1deeb
|
7
|
+
data.tar.gz: be5beb7da4ef8741504375c6a044a3a400fda9edf4eac1c2042fa9ea3516d7656dbdb200156d6fbf77402d57106e974124f145046bc38627538651f2c2fe4944
|
@@ -50,11 +50,11 @@ module Pubid::Core::Renderer
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def render_amendments(amendments, _opts, _params)
|
53
|
-
amendments.map(&:render_pubid).join("+")
|
53
|
+
amendments.sort.map(&:render_pubid).join("+")
|
54
54
|
end
|
55
55
|
|
56
56
|
def render_corrigendums(corrigendums, _opts, _params)
|
57
|
-
corrigendums.map(&:render_pubid).join("+")
|
57
|
+
corrigendums.sort.map(&:render_pubid).join("+")
|
58
58
|
end
|
59
59
|
|
60
60
|
def render_type(type, opts, params)
|
@@ -1,13 +1,18 @@
|
|
1
1
|
module Pubid::Core
|
2
2
|
class Supplement
|
3
|
-
|
3
|
+
include Comparable
|
4
|
+
attr_accessor :version, :number
|
4
5
|
|
5
|
-
def initialize(version:, number: nil
|
6
|
-
@version, @number
|
6
|
+
def initialize(version:, number: nil)
|
7
|
+
@version, @number = version&.to_i, number&.to_i
|
7
8
|
end
|
8
9
|
|
9
|
-
def
|
10
|
-
|
10
|
+
def <=>(other)
|
11
|
+
return 0 if number.nil? && other.number
|
12
|
+
|
13
|
+
return number <=> other.number if version == other.version
|
14
|
+
|
15
|
+
(version <=> other.version) || number <=> other.number
|
11
16
|
end
|
12
17
|
|
13
18
|
def render_pubid_number
|
data/lib/pubid/core/version.rb
CHANGED
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: 0.1.
|
4
|
+
version: 0.1.8
|
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-06-
|
11
|
+
date: 2022-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|