rfcbib 0.2.3 → 0.2.4

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: e21e2f90cfe142b28809bb2f54b99c58cb9221b6d1e47dcf15cf6a0d4b8038b4
4
- data.tar.gz: 16cbb242630b0541c63a7b2c5db5c11adbcbd2a992d229e4ae3ba55d2fd6ee38
3
+ metadata.gz: ad77029a892d6d83bf3bbe6c7f89846f5591466f879496ad52dffc0fe46247e2
4
+ data.tar.gz: 9bdcade50f7d7bf77a3dc7ec6255088affd70665e0edf3343e96994639d5c420
5
5
  SHA512:
6
- metadata.gz: 478643da005f8bede163284cd838820a50b37d88bd6d932d5652d9379d8d3b75207a293789ec33ec822d0831c0f5eaead44c8f698bc8eadb7395edaa111eebe7
7
- data.tar.gz: d1e0e72605031865e2bce5162b00029fe76d2a37f4c366e130d8839ba767cf98097e9713af275f155aabe0f6c09f7a5e963ac93aaad8596f5bedd52f224ca442
6
+ metadata.gz: a024522ab6812e6dd9f2ac5723681a2edd7f028bd37d77ba2185ca5e1aea274bfeb3f9c72b231bfbdcdbd8302ee7494025b47eb73fa4846031a9835abf23c59a
7
+ data.tar.gz: 5888832d1edf7c8f8a5909f671c3a43f4e5b1c02b83d53cecfe7772d2769dc3769e86ec3a498c5cf5620966c346a5bd92f90b7a263cfe49ac98d9c8b0879a750
@@ -146,6 +146,11 @@ module RfcBib
146
146
  author[:role] || 'author'
147
147
  end
148
148
 
149
+ def month(mo)
150
+ return mo if /^\d+$/.match mo
151
+ Date::MONTHNAMES.index(mo)
152
+ end
153
+
149
154
  #
150
155
  # Extract date from reference.
151
156
  #
@@ -153,7 +158,8 @@ module RfcBib
153
158
  #
154
159
  def dates
155
160
  return unless (date = @reference.at '//front/date')
156
- d = [date[:year], date[:month], date[:day]].compact.join '-'
161
+ d = [date[:year], month(date[:month]),
162
+ (date[:day] || "01")].compact.join '-'
157
163
  date = Time.parse(d).strftime '%Y-%m-%d'
158
164
  [IsoBibItem::BibliographicDate.new(type: 'published', on: date)]
159
165
  end
@@ -1,3 +1,3 @@
1
1
  module Rfcbib
2
- VERSION = '0.2.3'.freeze
2
+ VERSION = '0.2.4'.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.3
4
+ version: 0.2.4
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-08-28 00:00:00.000000000 Z
11
+ date: 2018-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler