metanorma-nist 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/nist/render.rb +22 -7
- data/lib/metanorma/nist/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: 75fb9c059ae72c09ccc3d401bb440d5763ec93d1dcb4cba42e93e7f981fd79a4
|
4
|
+
data.tar.gz: 067a9a1a8ea310fc7948c3423bbd693fd5a5e63ff03b7dab5fe50dcd605f2150
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 678c8b927d107d784d1fddaabeb650f0e03b74b558e1ef4c75f8f959a94d96f00414ea76d4db8666f3ff502ffdfa349db9ca728fffa01a01d78a5a21ea86a8c2
|
7
|
+
data.tar.gz: 26f7b3f77ea5226a601b4dee47d4c7c6b62d3967e0840c713b0e2521d6cfc5da37b30b3398bf51001b403302cdb94acb5381c6f7140f9b57f5dda53ff7e6cc2e
|
data/lib/isodoc/nist/render.rb
CHANGED
@@ -166,13 +166,14 @@ module Iso690Render
|
|
166
166
|
doc.at("./series[not(@type)]") ||
|
167
167
|
doc.at("./series")
|
168
168
|
return "" unless s
|
169
|
-
f = s.at("./formattedref")
|
169
|
+
f = s.at("./formattedref")
|
170
|
+
return f.text if f
|
170
171
|
t = s.at("./title")
|
171
172
|
a = s.at("./abbreviation")
|
172
173
|
n = s.at("./number")
|
173
174
|
p = s.at("./partnumber")
|
174
175
|
dn = doc.at("./docnumber")
|
175
|
-
rev = doc&.at(".//edition")&.text
|
176
|
+
rev = doc&.at(".//edition")&.text&.sub(/^Revision /, "")
|
176
177
|
ret = ""
|
177
178
|
if t
|
178
179
|
title = included(type) ? wrap(t.text, " <I>", "</I>") : wrap(t.text, " ", "")
|
@@ -191,7 +192,6 @@ module Iso690Render
|
|
191
192
|
|
192
193
|
def self.standardidentifier(doc)
|
193
194
|
ret = []
|
194
|
-
require "byebug"; byebug
|
195
195
|
doc.xpath("./docidentifier").each do |id|
|
196
196
|
next if %w(nist-mr nist-long).include? id["type"]
|
197
197
|
ret << standardidentifier1(id)
|
@@ -201,7 +201,6 @@ module Iso690Render
|
|
201
201
|
|
202
202
|
def self.standardidentifier1(id)
|
203
203
|
r = ""
|
204
|
-
require "byebug"; byebug
|
205
204
|
r += "#{id['type']} " if id["type"] and
|
206
205
|
!%w(ISO IEC NIST).include? id["type"]
|
207
206
|
r += id.text
|
@@ -257,17 +256,33 @@ module Iso690Render
|
|
257
256
|
|
258
257
|
def self.monthyr(isodate)
|
259
258
|
return nil if isodate.nil?
|
260
|
-
|
259
|
+
arr = isodate.split("-")
|
260
|
+
date = if arr.size == 2
|
261
|
+
DateTime.new(*arr.map(&:to_i))
|
262
|
+
else
|
263
|
+
DateTime.parse(isodate)
|
264
|
+
end
|
265
|
+
date.localize(:en).to_additional_s("yMMMM")
|
261
266
|
end
|
262
267
|
|
263
268
|
def self.mmddyyyy(isodate)
|
264
269
|
return nil if isodate.nil?
|
265
|
-
|
270
|
+
arr = isodate.split("-")
|
271
|
+
date = if arr.size == 2
|
272
|
+
Date.new(*arr.map(&:to_i)).strftime("%m-%Y")
|
273
|
+
else
|
274
|
+
Date.parse(isodate).strftime("%m-%d-%Y")
|
275
|
+
end
|
266
276
|
end
|
267
277
|
|
268
278
|
def self.MMMddyyyy(isodate)
|
269
279
|
return nil if isodate.nil?
|
270
|
-
|
280
|
+
arr = isodate.split("-")
|
281
|
+
date = if arr.size == 2
|
282
|
+
Date.new(*arr.map(&:to_i)).strftime("%B, %Y")
|
283
|
+
else
|
284
|
+
Date.parse(isodate).strftime("%B %d, %Y")
|
285
|
+
end
|
271
286
|
end
|
272
287
|
|
273
288
|
def self.draft(doc)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-nist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.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: 2019-06-
|
11
|
+
date: 2019-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|