wrongdoc 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.wrongdoc.yml +2 -0
- data/GIT-VERSION-GEN +1 -1
- data/README +1 -1
- data/bin/wrongdoc +4 -2
- data/lib/wrongdoc/final.rb +47 -1
- data/lib/wrongdoc/news_atom.rb +1 -1
- data/lib/wrongdoc/release.rb +3 -2
- data/pkg.mk +14 -7
- data/wrongdoc.gemspec +2 -2
- data/wrongdoc.sh +5 -0
- metadata +13 -14
data/.wrongdoc.yml
CHANGED
data/GIT-VERSION-GEN
CHANGED
data/README
CHANGED
data/bin/wrongdoc
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
2
|
+
tasks = %w(prepare release_notes release_changes all)
|
3
|
+
usage = "Usage: #{File.basename($0)} [#{tasks.join('|')}]"
|
3
4
|
$stderr.sync = $stdout.sync = true
|
4
5
|
require 'wrongdoc'
|
5
6
|
opts = Wrongdoc.config
|
@@ -16,5 +17,6 @@ when "all"
|
|
16
17
|
Wrongdoc::Merge.new(opts).run
|
17
18
|
Wrongdoc::Final.new(opts, ARGV[1]).run
|
18
19
|
else
|
19
|
-
|
20
|
+
warn "#{$0.inspect} #{ARGV.inspect} not understood"
|
21
|
+
abort usage
|
20
22
|
end
|
data/lib/wrongdoc/final.rb
CHANGED
@@ -4,6 +4,7 @@ require 'fileutils'
|
|
4
4
|
class Wrongdoc::Final
|
5
5
|
include Wrongdoc::ParseXML
|
6
6
|
include Wrongdoc::NewsAtom
|
7
|
+
SE_URL = 'http://kernel.org/pub/software/scm/git/docs/git-send-email.html'
|
7
8
|
|
8
9
|
def run
|
9
10
|
Find.find('doc') { |path| /\.html\z/ =~ path and fix(path) }
|
@@ -14,6 +15,8 @@ class Wrongdoc::Final
|
|
14
15
|
def initialize(opts, git_tag = nil)
|
15
16
|
@cgit_uri = URI.parse(opts[:cgit_url])
|
16
17
|
@rdoc_uri = URI.parse(opts[:rdoc_url])
|
18
|
+
@public_email = opts[:public_email] or warn ":public_email unset"
|
19
|
+
@private_email = opts[:private_email] or warn ":private_email unset"
|
17
20
|
@git_tag = git_tag
|
18
21
|
end
|
19
22
|
|
@@ -74,7 +77,7 @@ class Wrongdoc::Final
|
|
74
77
|
doc.search('div#validator-badges p small').each { |x|
|
75
78
|
if /\AGenerated/ =~ x.content
|
76
79
|
first = x.children.first
|
77
|
-
first.content = first.content.gsub
|
80
|
+
first.content = first.content.gsub(/\AG/, "Originally g")
|
78
81
|
last = x.children.last
|
79
82
|
last.content = "#{last.content}, modified by "
|
80
83
|
|
@@ -82,6 +85,49 @@ class Wrongdoc::Final
|
|
82
85
|
a["href"] = "http://bogomips.org/wrongdoc/"
|
83
86
|
a.content = "wrongdoc"
|
84
87
|
last.add_next_sibling(a)
|
88
|
+
|
89
|
+
@public_email && @private_email or return
|
90
|
+
txt = <<-EOF
|
91
|
+
We love to hear from you!<br />
|
92
|
+
Email patches (with <a href="#{SE_URL}">git send-email</a>),
|
93
|
+
pull requests, questions, bug reports, suggestions, etc.
|
94
|
+
to us publically at
|
95
|
+
<a href="mailto:#@public_email">#@public_email</a>.<br />
|
96
|
+
EOF
|
97
|
+
|
98
|
+
case @public_email
|
99
|
+
when /@librelist\.(?:com|org)\z/
|
100
|
+
txt << <<-EOF
|
101
|
+
To subscribe, just send any email to
|
102
|
+
<a href="mailto:#@public_email">#@public_email</a>,
|
103
|
+
and respond to the automated confirmation message.
|
104
|
+
EOF
|
105
|
+
when /\A(.+)@(rubyforge\.org)\z/ # Mailman
|
106
|
+
requests = "#$1-request@#$2"
|
107
|
+
txt << <<-EOF
|
108
|
+
No subscription to the mailing list is necessary,
|
109
|
+
just let us know to <b>Cc:</b> you if you're unsubscribed.<br />
|
110
|
+
To subscribe, email
|
111
|
+
<a href="mailto:#{requests}?subject=subscribe">#{requests}</a>
|
112
|
+
with \"subscribe\" in the Subject
|
113
|
+
and respond to the automated confirmation message.
|
114
|
+
EOF
|
115
|
+
end
|
116
|
+
|
117
|
+
txt << <<-EOF
|
118
|
+
<br />
|
119
|
+
<b>
|
120
|
+
Do not waste bandwidth with HTML, HTML mail will not be read.<br />
|
121
|
+
Quote only parts you're responding to and do not
|
122
|
+
<a href="http://catb.org/jargon/html/T/top-post.html">top post</a>.
|
123
|
+
<br />
|
124
|
+
</b>
|
125
|
+
For sensitive topics, email us privately at
|
126
|
+
<a href="mailto:#@private_email">#@private_email</a>.
|
127
|
+
EOF
|
128
|
+
para = Nokogiri::XML.fragment(txt)
|
129
|
+
|
130
|
+
last.parent.parent.add_next_sibling(para)
|
85
131
|
end
|
86
132
|
}
|
87
133
|
end
|
data/lib/wrongdoc/news_atom.rb
CHANGED
@@ -4,7 +4,7 @@ module Wrongdoc::NewsAtom
|
|
4
4
|
|
5
5
|
# generates an Atom feed based on git tags in the document directory
|
6
6
|
def news_atom
|
7
|
-
project_name, short_desc, _ =
|
7
|
+
project_name, short_desc, _ = readme_metadata
|
8
8
|
new_tags = tags[0,10]
|
9
9
|
atom_uri = @rdoc_uri.dup
|
10
10
|
atom_uri.path += "NEWS.atom.xml"
|
data/lib/wrongdoc/release.rb
CHANGED
@@ -20,12 +20,12 @@ module Wrongdoc::Release
|
|
20
20
|
io.sync = true
|
21
21
|
cmds.each_with_index do |cmd,i|
|
22
22
|
i > 0 and io.puts
|
23
|
-
|
23
|
+
_, status = Process.waitpid2(fork do
|
24
24
|
if io.fileno != $stdout.fileno
|
25
25
|
$stdout.reopen(io)
|
26
26
|
io.close
|
27
27
|
end
|
28
|
-
exec
|
28
|
+
exec(*cmd)
|
29
29
|
end)
|
30
30
|
status.success? or abort status.inspect
|
31
31
|
end
|
@@ -41,6 +41,7 @@ module Wrongdoc::Release
|
|
41
41
|
io.puts "* #{spec.homepage}"
|
42
42
|
io.puts "* #{spec.email}"
|
43
43
|
io.puts "* #{opts[:git_url] || opts[:cgit_url]}"
|
44
|
+
io.puts "* #{spec.homepage}NEWS.atom.xml"
|
44
45
|
|
45
46
|
io.print "\nChanges:\n\n"
|
46
47
|
io.puts body
|
data/pkg.mk
CHANGED
@@ -7,7 +7,7 @@ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
|
|
7
7
|
@./GIT-VERSION-GEN
|
8
8
|
-include GIT-VERSION-FILE
|
9
9
|
-include local.mk
|
10
|
-
DLEXT := $(shell $(RUBY) -rrbconfig -e 'puts
|
10
|
+
DLEXT := $(shell $(RUBY) -rrbconfig -e 'puts RbConfig::CONFIG["DLEXT"]')
|
11
11
|
RUBY_VERSION := $(shell $(RUBY) -e 'puts RUBY_VERSION')
|
12
12
|
RUBY_ENGINE := $(shell $(RUBY) -e 'puts((RUBY_ENGINE rescue "ruby"))')
|
13
13
|
lib := lib
|
@@ -44,29 +44,32 @@ $(ext_dl): $(ext_src) $(ext_pfx_src) $(ext_pfx)/$(ext)/Makefile
|
|
44
44
|
$(MAKE) -C $(@D)
|
45
45
|
lib := $(lib):$(ext_pfx)/$(ext)
|
46
46
|
build: $(ext_dl)
|
47
|
+
else
|
48
|
+
build:
|
47
49
|
endif
|
48
50
|
|
49
|
-
pkg_extra
|
51
|
+
pkg_extra += GIT-VERSION-FILE NEWS ChangeLog LATEST
|
50
52
|
ChangeLog: GIT-VERSION-FILE .wrongdoc.yml
|
51
53
|
$(WRONGDOC) prepare
|
54
|
+
NEWS LATEST: ChangeLog
|
52
55
|
|
53
56
|
manifest:
|
54
57
|
$(RM) .manifest
|
55
58
|
$(MAKE) .manifest
|
56
59
|
|
57
|
-
.manifest:
|
60
|
+
.manifest: $(pkg_extra)
|
58
61
|
(git ls-files && for i in $@ $(pkg_extra); do echo $$i; done) | \
|
59
62
|
LC_ALL=C sort > $@+
|
60
63
|
cmp $@+ $@ || mv $@+ $@
|
61
64
|
$(RM) $@+
|
62
65
|
|
63
|
-
doc:: .document .wrongdoc.yml
|
64
|
-
find lib -type f -name '*.rbc' -exec rm -f '{}' ';'
|
66
|
+
doc:: .document .wrongdoc.yml $(pkg_extra)
|
67
|
+
-find lib -type f -name '*.rbc' -exec rm -f '{}' ';'
|
65
68
|
-find ext -type f -name '*.rbc' -exec rm -f '{}' ';'
|
66
69
|
$(RM) -r doc
|
67
70
|
$(WRONGDOC) all
|
68
71
|
install -m644 COPYING doc/COPYING
|
69
|
-
install -m644 $(shell grep '^[A-Z]' .document) doc/
|
72
|
+
install -m644 $(shell LC_ALL=C grep '^[A-Z]' .document) doc/
|
70
73
|
|
71
74
|
ifneq ($(VERSION),)
|
72
75
|
pkggem := pkg/$(rfpackage)-$(VERSION).gem
|
@@ -144,7 +147,7 @@ test_units := $(wildcard test/test_*.rb)
|
|
144
147
|
test: test-unit
|
145
148
|
test-unit: $(test_units)
|
146
149
|
$(test_units): build
|
147
|
-
$(RUBY) -I $(lib) $@
|
150
|
+
$(RUBY) -I $(lib) $@ $(RUBY_TEST_OPTS)
|
148
151
|
|
149
152
|
# this requires GNU coreutils variants
|
150
153
|
ifneq ($(RSYNC_DEST),)
|
@@ -164,5 +167,9 @@ doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.\(gif\|jpg\|png\|gz\)$$')
|
|
164
167
|
doc_gz:
|
165
168
|
for i in $(docs); do \
|
166
169
|
gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
|
170
|
+
check-warnings:
|
171
|
+
@(for i in $$(git ls-files '*.rb'| grep -v '^setup\.rb$$'); \
|
172
|
+
do $(RUBY) -d -W2 -c $$i; done) | grep -v '^Syntax OK$$' || :
|
167
173
|
|
168
174
|
.PHONY: all .FORCE-GIT-VERSION-FILE doc test $(test_units) manifest
|
175
|
+
.PHONY: check-warnings
|
data/wrongdoc.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.rdoc_options = rdoc_options
|
22
22
|
s.require_paths = %w(lib)
|
23
23
|
s.rubyforge_project = %q{rainbows}
|
24
|
-
s.add_dependency(%q<nokogiri>, ['~> 1.
|
24
|
+
s.add_dependency(%q<nokogiri>, ['~> 1.5'])
|
25
25
|
s.add_dependency(%q<tidy_ffi>, ['~> 0.1.3'])
|
26
|
-
s.add_dependency(%q<rdoc>, ['~> 3.
|
26
|
+
s.add_dependency(%q<rdoc>, ['~> 3.9'])
|
27
27
|
end
|
data/wrongdoc.sh
ADDED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wrongdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 6
|
9
9
|
- 0
|
10
|
-
version: 1.
|
10
|
+
version: 1.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- wrongdoc hackers
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-08-19 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: nokogiri
|
@@ -26,11 +25,11 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ~>
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
28
|
+
hash: 5
|
30
29
|
segments:
|
31
30
|
- 1
|
32
|
-
-
|
33
|
-
version: "1.
|
31
|
+
- 5
|
32
|
+
version: "1.5"
|
34
33
|
type: :runtime
|
35
34
|
version_requirements: *id001
|
36
35
|
- !ruby/object:Gem::Dependency
|
@@ -57,11 +56,11 @@ dependencies:
|
|
57
56
|
requirements:
|
58
57
|
- - ~>
|
59
58
|
- !ruby/object:Gem::Version
|
60
|
-
hash:
|
59
|
+
hash: 21
|
61
60
|
segments:
|
62
61
|
- 3
|
63
|
-
-
|
64
|
-
version: "3.
|
62
|
+
- 9
|
63
|
+
version: "3.9"
|
65
64
|
type: :runtime
|
66
65
|
version_requirements: *id003
|
67
66
|
description: |-
|
@@ -136,8 +135,8 @@ files:
|
|
136
135
|
- pkg.mk
|
137
136
|
- setup.rb
|
138
137
|
- wrongdoc.gemspec
|
138
|
+
- wrongdoc.sh
|
139
139
|
- wrongdoc_1
|
140
|
-
has_rdoc: true
|
141
140
|
homepage: http://bogomips.org/wrongdoc/
|
142
141
|
licenses: []
|
143
142
|
|
@@ -170,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
169
|
requirements: []
|
171
170
|
|
172
171
|
rubyforge_project: rainbows
|
173
|
-
rubygems_version: 1.
|
172
|
+
rubygems_version: 1.8.5
|
174
173
|
signing_key:
|
175
174
|
specification_version: 3
|
176
175
|
summary: RDoc done right (IMNSHO)
|