iso-bib-item 0.3.0 → 0.3.1

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: 9151a606d6472ed717dd72355de133f60267115db58ad044487e90c6dd8121f0
4
- data.tar.gz: 582951ceb750e9a04249adce617003dfa0ae0846d6b2d26c2325e06fea3daf85
3
+ metadata.gz: 9ac47530f7bb6fa50858b2b0b013864059215c1766a86fcb9691ed2065ed7f0f
4
+ data.tar.gz: c93b38d67f60d01897b4a8393009f62b2c18fe3aa53d3aa464a8b37ec1b2aa8c
5
5
  SHA512:
6
- metadata.gz: 326360eeb3139af52a7fd7fe7f839ce72c9c20b33bc3ac73a4427e6167e047a48e13536bd4894ea1da638bbd7657d0cbb570af43c05349a896163b291cddc5bb
7
- data.tar.gz: 587f9215a2668f7170e269305e90b9601c5963560fb5eb7871961f3e5016843954eba2041b3f525ecfde9d776b0ff79a13e4306ad44b94d3a38070bdf756b08e
6
+ metadata.gz: ae4298fbec9d77cde74109953eba1f7208234eb507cd2ca1f1383965386553513b498961cf6d57d2632537507b67ccd0bade9bb0127e71044f8f595c2c9b6170
7
+ data.tar.gz: 7734059bb6fc9e4caed7108fca5a2ff6caa60f7c525278c6c4286f5c8f05d36e5c95d42f8e9510680f524497885e5c9c6702735c75b55ba3cad3ff9a942693fd
@@ -32,9 +32,10 @@ module IsoBibItem
32
32
  type = did.at("./@type")
33
33
  if did.text == "IEV" then ret << IsoBibItem::IsoDocumentId.new(project_number: "IEV", part_number: nil, prefix: nil)
34
34
  else
35
- id = did.text.match(/^(?<project>.*\d+)(?<hyphen>-)?(?(<hyphen>)(?<part>\d*))$/)
35
+ id = did.text.match(/^(?<project>.*\d+)(?<hyphen>-)?(?(<hyphen>)(?<part>\d*))(-(?<subpart>\d+))?$/)
36
36
  ret << IsoBibItem::IsoDocumentId.new(project_number: id.nil? ? did.text : id[:project],
37
37
  part_number: id.nil? ? nil : id[:part],
38
+ subpart_number: id.nil? ? nil : id[:subpart],
38
39
  prefix: nil,
39
40
  id: did.text,
40
41
  type: type&.text)
@@ -29,20 +29,28 @@ module IsoBibItem
29
29
  # @return [Integer]
30
30
  attr_reader :part_number
31
31
 
32
+ # @return [Integer]
33
+ attr_reader :subpart_number
34
+
32
35
  # @return [String]
33
36
  attr_reader :id
34
37
 
35
- # @return [Prefix]
38
+ # @return [String]
36
39
  attr_reader :prefix
37
40
 
38
- # @return [Prefix]
41
+ # @return [String]
39
42
  attr_reader :type
40
43
 
41
44
  # @param project_number [Integer]
42
45
  # @param part_number [Integer]
43
- def initialize(project_number:, part_number:, prefix:, id:, type: nil)
46
+ # @param subpart_number [Integer]
47
+ # @param prefix [String]
48
+ # @param id [String]
49
+ # @param type [String]
50
+ def initialize(project_number:, part_number:, subpart_number: nil, prefix:, id:, type: nil)
44
51
  @project_number = project_number
45
52
  @part_number = part_number
53
+ @subpart_number = subpart_number
46
54
  @prefix = prefix
47
55
  @type = type
48
56
  @id = id
@@ -51,6 +59,7 @@ module IsoBibItem
51
59
  # in docid manipulations, assume ISO as the default: id-part:year
52
60
  def remove_part
53
61
  @part_number = nil
62
+ @subpart_number = nil
54
63
  case @type
55
64
  when "Chinese Standard" then @id = @id.sub(/\.\d+/, "")
56
65
  else
@@ -164,7 +173,7 @@ module IsoBibItem
164
173
  super(super_args)
165
174
  args[:docid] = [args[:docid]] unless args[:docid].is_a?(Array)
166
175
  @docidentifier = args[:docid].map do |t|
167
- t.is_a?(Hash) ? IsoDocumentId.new(t) : t
176
+ t.is_a?(Hash) ? IsoDocumentId.new(t) : t
168
177
  end
169
178
  @edition = args[:edition]
170
179
  @title = args[:titles].map do |t|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module IsoBibItem
4
- VERSION = '0.3.0'.freeze
4
+ VERSION = '0.3.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iso-bib-item
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-04 00:00:00.000000000 Z
11
+ date: 2018-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler