olddoc 1.3.0 → 1.4.0

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
  SHA1:
3
- metadata.gz: 0f02849f5be5e9ecb197b2d0cbe22fe40ef5110a
4
- data.tar.gz: a7deb5ecea035aa9430419617fd8c0dcd4e0d86a
3
+ metadata.gz: 23c5d6ab7ac1202af4b9831610a7e49acf23e633
4
+ data.tar.gz: cf125761aea6c4860794a68f9c63c8039532f403
5
5
  SHA512:
6
- metadata.gz: 1787df0d30deb90919492d1830f9525b5e5be9cd203e22731b60e6a852d1a1a15e8ae74ac930d247e427d1d1732f074a2a28c83a2c351aaa83c1b626f3169d1f
7
- data.tar.gz: 521ea75c81d29f38b207496a18d42ead1302dcd28b5b995efafb634804705519cbb55b59c55f451564c18d03dbd5e5477037566bbf64e1e0626821d568857ad0
6
+ metadata.gz: 70640d38fd02f1df57e340d0535682462a71c1d409618051cf56118eb9bc5a827591d753d3793d89ce3b27b0b54b1b591ed64664c4abf0f645ce667d2ea7e9ff
7
+ data.tar.gz: 2db66bd166e5a4189803c09cfd72c3254b57bd42ff597010916acbcf1ef04933a9e01f1535e1f8887b1fad9165ed6cd98f562d2774030378e9ab74518ee844eb
data/GIT-VERSION-GEN CHANGED
@@ -5,7 +5,7 @@
5
5
  CONSTANT = "Olddoc::VERSION"
6
6
  RVF = "lib/olddoc/version.rb"
7
7
  GVF = "GIT-VERSION-FILE"
8
- DEF_VER = "v1.3.0"
8
+ DEF_VER = "v1.4.0"
9
9
  vn = DEF_VER.dup
10
10
 
11
11
  # First see if there is a version file (included in release tarballs),
@@ -1,11 +1,33 @@
1
1
  # Copyright (C) 2015-2016 all contributors <olddoc-public@80x24.org>
2
2
  # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
3
- require 'builder'
4
3
 
5
4
  module Olddoc::NewsAtom # :nodoc:
6
5
  include Olddoc::History
7
6
  include Olddoc::Readme
8
7
 
8
+ def x(dst, tag, text = nil, attrs = nil)
9
+ if Hash === text
10
+ attrs = text
11
+ text = nil
12
+ end
13
+ if attrs
14
+ attrs = attrs.map { |k,v| "#{k}=#{v.encode(xml: :attr)}" }
15
+ attrs = "\n#{attrs.join("\n")}"
16
+ end
17
+ case text
18
+ when nil
19
+ if block_given?
20
+ dst << "<#{tag}#{attrs}>"
21
+ yield
22
+ dst << "</#{tag}>"
23
+ else
24
+ dst << "<#{tag}#{attrs}/>"
25
+ end
26
+ else
27
+ dst << "<#{tag}#{attrs}>#{text.encode(xml: :text)}</#{tag}>"
28
+ end
29
+ end
30
+
9
31
  # generates an Atom feed based on git tags in the document directory
10
32
  def news_atom_xml
11
33
  project_name, short_desc, _ = readme_metadata
@@ -14,34 +36,36 @@ module Olddoc::NewsAtom # :nodoc:
14
36
  atom_uri.path += "NEWS.atom.xml"
15
37
  news_uri = @rdoc_uri.dup
16
38
  news_uri.path += "NEWS.html"
17
- x = Builder::XmlMarkup.new
18
- x.feed(xmlns: "http://www.w3.org/2005/Atom") do
19
- x.id(atom_uri.to_s)
20
- x.title("#{project_name} news")
21
- x.subtitle(short_desc)
22
- x.link(rel: 'alternate', type: 'text/html', href: news_uri.to_s)
23
- x.updated(new_tags.empty? ? '1970-01-01:00:00:00Z' : new_tags[0][:time])
39
+
40
+ dst = ''
41
+ x(dst, 'feed', xmlns: 'http://www.w3.org/2005/Atom') do
42
+ x(dst, 'id', atom_uri.to_s)
43
+ x(dst, 'title', "#{project_name} news")
44
+ x(dst, 'subtitle', short_desc)
45
+ x(dst, 'link', rel: 'alternate', type: 'text/html', href: news_uri.to_s)
46
+ x(dst, 'updated', new_tags.empty? ? '1970-01-01:00:00:00Z'
47
+ : new_tags[0][:time])
24
48
  new_tags.each do |tag|
25
- x.entry do
26
- x.title(tag[:subject])
27
- x.updated(tag[:time])
28
- x.published(tag[:time])
29
- x.author do
30
- x.name(tag[:tagger_name])
31
- x.email(tag[:tagger_email])
49
+ x(dst, 'entry') do
50
+ x(dst, 'title', tag[:subject])
51
+ x(dst, 'updated', tag[:time])
52
+ x(dst, 'published', tag[:time])
53
+ x(dst, 'author') do
54
+ x(dst, 'name', tag[:tagger_name])
55
+ x(dst, 'email', tag[:tagger_email])
32
56
  end
33
57
  uri = tag_uri(tag[:tag]).to_s
34
- x.link(rel: "alternate", type: 'text/html', href: uri)
35
- x.id(uri)
36
- x.content(type: :xhtml) do
37
- x.div(xmlns: 'http://www.w3.org/1999/xhtml') do
38
- x.pre(tag[:body])
39
- end
40
- end
58
+ x(dst, 'link', rel: 'alternate', type: 'text/html', href: uri)
59
+ x(dst, 'id', uri)
60
+ x(dst, 'content', type: 'xhtml') do
61
+ x(dst, 'div', xmlns: 'http://www.w3.org/1999/xhtml') do
62
+ x(dst, 'pre', tag[:body])
63
+ end # div
64
+ end # content
41
65
  end # entry
42
- end # new_tags
66
+ end # new_tags.each
43
67
  end # feed
44
- [ x.target!, new_tags ]
68
+ [ dst, new_tags ]
45
69
  end
46
70
 
47
71
  def news_atom(dest = "NEWS.atom.xml")
@@ -12,7 +12,6 @@ module Olddoc::NewsRdoc # :nodoc:
12
12
  fp.puts "=== #{tag[:subject]} / #{time}"
13
13
  fp.puts ""
14
14
 
15
- body = tag[:body]
16
15
  fp.puts tag[:body].gsub(/^/smu, " ").gsub(/[ \t]+$/smu, "")
17
16
  fp.puts ""
18
17
  end
@@ -46,7 +46,7 @@ id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details">
46
46
  seq ? " #{h(seq.strip)}" : "" %><%
47
47
  end %></b> <%= method_srclink(method) %></pre><%=
48
48
  method.comment ? method.description.strip : nd %><%
49
- if method.calls_super %>Calls superclass method<%=
49
+ if method.calls_super %>Calls superclass method <%=
50
50
  method.superclass_method ?
51
51
  method.formatter.link(method.superclass_method.full_name,
52
52
  method.superclass_method.full_name) : nil
data/olddoc.gemspec CHANGED
@@ -18,7 +18,6 @@ Gem::Specification.new do |s|
18
18
 
19
19
  # works fine with RDoc 5.x
20
20
  s.add_dependency('rdoc', ['>= 4.2', '< 6.0'])
21
- s.add_dependency('builder', '~> 3.2')
22
21
  s.required_ruby_version = '>= 1.9.3'
23
22
  s.homepage = Olddoc.config['rdoc_url']
24
23
  s.licenses = 'GPL-3.0+'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: olddoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - olddoc hackers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-02 00:00:00.000000000 Z
11
+ date: 2017-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -30,20 +30,6 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '6.0'
33
- - !ruby/object:Gem::Dependency
34
- name: builder
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '3.2'
40
- type: :runtime
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '3.2'
47
33
  description: |-
48
34
  olddoc contains old-fashioned document generators for those who do not
49
35
  wish to impose bloated, new-fangled web cruft on their readers.