pubid-jis 0.1.1 → 0.2.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: aaeab5258bdddf833c4ab9918d0973abfb23993ac3e6433b9fd73e4c9c6b2f6d
4
- data.tar.gz: ef707e6ec8b8d989b2376a46266388c4a9fdb1f577b25b991accf56dcc772877
3
+ metadata.gz: 9c0c791095c83e4b8722ee5231a32aaa67ef83bc79c7819010bc7b3b39896b86
4
+ data.tar.gz: 73e325a24c1e57418037c4d14b793029c6203122325a0af3baf9de358e59d86c
5
5
  SHA512:
6
- metadata.gz: 450467f6397bad16e962d7b15628d1cb8b91d169cf5d6d76b551593b63a99df3a1910bfd415b97ac805964c6b31eb3ca76649f3c0c3d9caeb599fc1e55d4c1dc
7
- data.tar.gz: 1a1ba91e716740b9d1e9b135a9c72e3dca0f351ce0682d9fc92bf763e3438df6d706be880f15f6e5f2821c14032c273ebe45de0c36d89ce02a681aadca7797d7
6
+ metadata.gz: 072776bc60700e55cf0ba6c34f8be8aabb368d93f388e78ca676a7483cc093c051178336370eb301a26797a8d74d9f8f2f026e3c92bc543abf34e2cd9b175b80
7
+ data.tar.gz: bbcf78001e99c6043dbcf41efc7c0df69612c6f449e75864a2da9de1d7fd7d1d459717c1b79c4917cd9812bfd6e68496f5fbb5bed54f13fb52b3a925b75e1a6c
@@ -25,13 +25,21 @@ module Pubid::Jis
25
25
 
26
26
  def ==(other)
27
27
  if all_parts? || other.all_parts?
28
- return get_params.reject { |k, _| [:part, :all_parts].include?(k) } ==
29
- other.get_params.reject { |k, _| [:part, :all_parts].include?(k) }
28
+ return get_params.reject { |k, _| [:year, :part, :all_parts].include?(k) } ==
29
+ other.get_params.reject { |k, _| [:year, :part, :all_parts].include?(k) }
30
30
  end
31
31
 
32
32
  super
33
33
  end
34
34
 
35
+ # @param with_publisher [Boolean] add publisher to output
36
+ def to_s(with_publisher: true)
37
+ options = {}
38
+ options[:with_publisher] = with_publisher
39
+
40
+ self.class.get_renderer_class.new(get_params).render(**options)
41
+ end
42
+
35
43
  class << self
36
44
  def transform_supplements(supplements_params, base_params)
37
45
  supplements = supplements_params.map do |supplement|
@@ -6,8 +6,12 @@ module Pubid::Jis::Renderer
6
6
  "%{publisher}%{series} %{number}%{part}%{year}%{all_parts}" % params
7
7
  end
8
8
 
9
- def render_series(series, _opts, _params)
10
- " #{series}"
9
+ def render_publisher(publisher, opts, params)
10
+ super if opts[:with_publisher]
11
+ end
12
+
13
+ def render_series(series, opts, _params)
14
+ opts[:with_publisher] ? " #{series}" : series
11
15
  end
12
16
 
13
17
  def render_part(part, opts, _params)
@@ -1,5 +1,5 @@
1
1
  module Pubid
2
2
  module Jis
3
- VERSION = "0.1.1".freeze
3
+ VERSION = "0.2.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubid-jis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.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: 2023-04-01 00:00:00.000000000 Z
11
+ date: 2023-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake