kramdown-rfc2629 1.0.17 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77162c605ddf46855d7f888b073be3da19c49b7a
4
- data.tar.gz: a9749cb468679b2df0b7c9d050d2f4ea90f3af34
3
+ metadata.gz: 0b7cb03b26cc3280334da9e30264652850c904f4
4
+ data.tar.gz: 593ed4923195d254b3c27ace03e09a9e24a22f0e
5
5
  SHA512:
6
- metadata.gz: 939fb9aeacd5d43165e7dd5adbc38140c78299fe2a8fe953f76cfc3f4b83f01a55acb92eee3b57e3430ce16f0028a148124748ebd04f1959698bd7682b0c1432
7
- data.tar.gz: c90505e4f90e6777563c530127381f81cc109eb5f6e7426fc7ae24b6748204436c214a62f163ace98024526aa5063982a83ca641c4b259d6e299f3ee5d2ea295
6
+ metadata.gz: 6403e62c32307c3e66b93d7c130f6efe5b7ccc3587da9ba7f075a206820b476699ecf0dd1e83ae4bb815dbea94b7ada550a8f838ef6c395c08170df36a113352
7
+ data.tar.gz: 9698f63a545f44d08ddcd97aac1baf282b1171da5627e840a1be8a833ed8147e04f47b67d727feb1832786085670e9bf5e384ab253e89d9ea9f230cac7aa7c16
data/README.md CHANGED
@@ -14,7 +14,7 @@ their work in markdown.
14
14
  # Usage
15
15
 
16
16
  Start by installing the kramdown-rfc2629 gem (this automatically
17
- installs kramdown version 1.3.x as well):
17
+ installs kramdown version 1.4.x as well):
18
18
 
19
19
  sudo gem install kramdown-rfc2629
20
20
 
@@ -24,9 +24,8 @@ structure provided by kramdown. `bin/kramdown-rfc2629` started out as
24
24
  a simple command-line program showing how to use this, but can now do
25
25
  much more (see below).
26
26
 
27
- To use kramdown-rfc2629, you'll need a Ruby 1.9 or 2.0, the command
28
- "wget" (if you want to use the offline feature), and maybe [XML2RFC][]
29
- if you want to see the fruits of your work.
27
+ To use kramdown-rfc2629, you'll need a Ruby 1.9 or 2.x, and maybe
28
+ [XML2RFC][] if you want to see the fruits of your work.
30
29
 
31
30
  kramdown-rfc2629 mydraft.mkd >mydraft.xml
32
31
  xml2rfc mydraft.xml
@@ -180,7 +179,9 @@ spell it out like this:
180
179
  RFC6690:
181
180
 
182
181
  (as in the author list, `ins` is an abbreviation for
183
- "initials/surname".) Then you can simply reference `{{ASN.1}}` and
182
+ "initials/surname"; note that the first title had to be put in double
183
+ quotes as it contains a colon which is special syntax in YAML.)
184
+ Then you can simply reference `{{ASN.1}}` and
184
185
  `{{ECMA262}}` in the text. (Make sure the reference keys are valid XML
185
186
  names, though.)
186
187
 
@@ -199,13 +200,13 @@ Moving from XML to Markdown for RFC writing apparently is a
199
200
  no-brainer, so I'm not the only one who has written code for this.
200
201
 
201
202
  [Miek Gieben][] has done a [similar thing][pandoc2rfc] employing
202
- pandoc/asciidoc. He uses multiple input files instead of
203
+ pandoc, now documented in [RFC 7328][]. He uses multiple input files instead of
203
204
  kramdown-rfc2629's sectionized input format. He keeps the metadata in
204
205
  a separate XML file, similar to the way the previous version of
205
206
  kramdown-rfc2629 stored (and still can store) the metadata in XML in
206
207
  the markdown document. He also uses a slightly different referencing
207
208
  syntax, which is closer to what markdown does elsewhere but more
208
- verbose.
209
+ verbose (this syntax is now also supported in kramdown-rfc2629).
209
210
 
210
211
  # License
211
212
 
@@ -221,3 +222,4 @@ license.
221
222
  [Miek Gieben]: http://www.miek.nl/
222
223
  [pandoc2rfc]: https://github.com/miekg/pandoc2rfc/
223
224
  [XML2RFC]: http://xml.resource.org
225
+ [RFC 7328]: http://tools.ietf.org/html/rfc7328
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.0.17'
3
+ s.version = '1.0.18'
4
4
  s.summary = "Kramdown extension for generating RFC 2629 XML."
5
5
  s.description = %{An RFC2629 (XML2RFC) generating backend for Thomas Leitner's
6
6
  "kramdown" markdown parser. Mostly useful for RFC writers.}
@@ -10,7 +10,7 @@ spec = Gem::Specification.new do |s|
10
10
  s.executables = ['kramdown-rfc2629']
11
11
  s.default_executable = 'kramdown-rfc2629'
12
12
  s.required_ruby_version = '>= 1.9.2'
13
- s.requirements = 'wget'
13
+ # s.requirements = 'wget'
14
14
  # s.has_rdoc = true
15
15
  s.author = "Carsten Bormann"
16
16
  s.email = "cabo@tzi.org"
@@ -356,15 +356,34 @@ module Kramdown
356
356
  fn = "#{REFCACHEDIR}/#{File.basename(url)}"
357
357
  f = File.stat(fn) rescue nil
358
358
  if !f || tn - f.ctime >= tvalid
359
- $stderr.puts "#{fn}: #{f && tn-f.ctime}"
360
- `cd #{REFCACHEDIR}; wget -t 3 -T 20 -Nnv "#{url}"` # ignore errors if offline (hack)
361
- begin
362
- File.utime nil, nil, fn
363
- rescue Errno::ENOENT
364
- warn "Can't fetch #{url} -- is wget in path?"
359
+ $stderr.puts "#{fn}: #{f && "renewing (stale by #{"%.1f" % ((tn-f.ctime)/86400)} days)" || "fetching"}"
360
+ if ENV["HAVE_WGET"]
361
+ `cd #{REFCACHEDIR}; wget -t 3 -T 20 -Nnv "#{url}"` # ignore errors if offline (hack)
362
+ begin
363
+ File.utime nil, nil, fn
364
+ rescue Errno::ENOENT
365
+ warn "Can't fetch #{url} -- is wget in path?"
366
+ end
367
+ else
368
+ require 'open-uri'
369
+ require 'timeout'
370
+ begin
371
+ Timeout::timeout(f ? 10 : 30) do # give up quickly if just renewing
372
+ open(url) do |f|
373
+ s = f.read
374
+ if f.status[0] != "200"
375
+ warn "*** Status code #{status} while fetching #{url}"
376
+ else
377
+ File.write(fn, s)
378
+ end
379
+ end
380
+ end
381
+ rescue OpenURI::HTTPError, SocketError, Timeout::Error => e
382
+ warn "*** #{e} while fetching #{url}"
383
+ end
365
384
  end
366
385
  end
367
- File.read(fn)
386
+ File.read(fn) # this blows up if no cache available after fetch attempt
368
387
  end
369
388
 
370
389
  XML_RESOURCE_ORG_MAP = {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-rfc2629
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
4
+ version: 1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-16 00:00:00.000000000 Z
11
+ date: 2014-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown
@@ -57,8 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
- requirements:
61
- - wget
60
+ requirements: []
62
61
  rubyforge_project:
63
62
  rubygems_version: 2.2.2
64
63
  signing_key: