rfcbib 0.2.0 → 0.2.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: e71d2a7180ac4890509e190af31b890f4e9484ecc78fdc140e76cee6c54a6868
4
- data.tar.gz: 7d5a90b55ae0fb17628b0ecac82e8ba6b50597d64730123ee7b94cc554a0309c
3
+ metadata.gz: ba5e03b00d32ab0dcbcdb229cbb3fe9b904de434bc26a51905995d8a1ad40839
4
+ data.tar.gz: dc4c30e94ff3f1af5242f4f9b5334397bcbdfe618ef1632331369c14646dfce3
5
5
  SHA512:
6
- metadata.gz: 9835849f913acdc11f5a9e30203077cfc04eae377344c4ffc39bf6a17ed10fdefebaa903a41821f14f5aea7db8efcbf8cae44219f595994ba7f483f945d1815b
7
- data.tar.gz: ca7371cb1cc578dac415673b2a7117a896b0765651902ca9670611536011252e9a557b656d23d152eb9bb8c49dac87a572354ec38ab5dcb65ab95baba821bf72
6
+ metadata.gz: 9550cb561a1859052ed5150c976dddba240cf9339d6cd7b1572345326c3cbb9dcd6bc2c5b496287cc0897438abb2c491fe81cc3847cacfda15f0d9b18e17cd3f
7
+ data.tar.gz: 1720386b6400c1bcd6389969a52d56c2f7959b9243e5d458f777ab589f25011f90e3c5f6dcd861f5871825572bc6aff65639f55f743d58a94b7b1048677439c2
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rfcbib (0.1.1)
5
- iso-bib-item (~> 0.2)
4
+ rfcbib (0.2.1)
5
+ iso-bib-item (~> 0.2.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -13,7 +13,7 @@ GEM
13
13
  docile (1.3.1)
14
14
  equivalent-xml (0.6.0)
15
15
  nokogiri (>= 1.4.3)
16
- iso-bib-item (0.2.1)
16
+ iso-bib-item (0.2.2)
17
17
  isoics (~> 0.1.6)
18
18
  nokogiri (~> 1.8.4)
19
19
  ruby_deep_clone (~> 0.8.0)
@@ -5,7 +5,7 @@ module Relaton
5
5
  class Processor < Relaton::Processor
6
6
  def initialize
7
7
  @short = :rfcbib
8
- @prefix = /^RFC|^I-D/
8
+ @prefix = /^(IETF Standard )?(RFC|I-D\.?|I\.-D\.) /
9
9
  end
10
10
 
11
11
  def get(code, date, opts)
@@ -33,7 +33,7 @@ module RfcBib
33
33
  def bib_item
34
34
  IsoBibItem::BibliographicItem.new(
35
35
  id: @reference[:anchor],
36
- docid: docids,
36
+ docid: docids(@reference[:anchor].sub(/^(RFC)/, "\\1 ")),
37
37
  status: status,
38
38
  language: [language],
39
39
  link: [{ type: 'src', content: @reference[:target] }],
@@ -163,14 +163,15 @@ module RfcBib
163
163
  #
164
164
  # @return [Array<IsoBibItem::DocumentIdentifier>]
165
165
  #
166
- def docids
167
- @reference.xpath('//seriesinfo').map do |si|
166
+ def docids(id)
167
+ ret = @reference.xpath('//seriesinfo').map do |si|
168
168
  next unless si[:name] == 'DOI'
169
169
  IsoBibItem::DocumentIdentifier.new(
170
170
  id: si[:value],
171
171
  type: si[:name]
172
172
  )
173
173
  end.compact
174
+ ret << IsoBibItem::DocumentIdentifier.new(type: "IETF", id: id)
174
175
  end
175
176
 
176
177
  #
@@ -1,3 +1,3 @@
1
1
  module Rfcbib
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rfcbib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.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-07-22 00:00:00.000000000 Z
11
+ date: 2018-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler