wrongdoc 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,3 +5,5 @@ rdoc_url: http://bogomips.org/wrongdoc/
5
5
  merge_html:
6
6
  wrongdoc_1: Documentation/wrongdoc.1.html_fragment
7
7
  dotwrongdoc_5: Documentation/dotwrongdoc.5.html_fragment
8
+ public_email: wrongdoc@librelist.org
9
+ private_email: wrongdoc@bogomips.org
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  GVF=GIT-VERSION-FILE
4
- DEF_VER=v1.5.0.GIT
4
+ DEF_VER=v1.6.0.GIT
5
5
 
6
6
  LF='
7
7
  '
data/README CHANGED
@@ -15,7 +15,7 @@ on git history and tags.
15
15
  First, prepare a .wrongdoc.yml in the top-level directory of your project,
16
16
  then run the following command to generate your RDoc:
17
17
 
18
- $ wrongdoc
18
+ $ wrongdoc all
19
19
 
20
20
  == Future Plans
21
21
 
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
- usage = "Usage: #{File.basename($0)} [prepare]"
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
- abort "#{$0.inspect} #{ARGV.inspect} not understood"
20
+ warn "#{$0.inspect} #{ARGV.inspect} not understood"
21
+ abort usage
20
22
  end
@@ -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 /\AG/, "Originally g"
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
@@ -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, _ = x = readme_metadata
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"
@@ -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
- pid, status = Process.waitpid2(fork do
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 *cmd
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 Config::CONFIG["DLEXT"]')
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 := GIT-VERSION-FILE NEWS ChangeLog LATEST
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: ChangeLog
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
@@ -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.4'])
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.5'])
26
+ s.add_dependency(%q<rdoc>, ['~> 3.9'])
27
27
  end
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ # self-hosting version used for development
3
+ set -e
4
+ prefix="$(git rev-parse --show-toplevel)"
5
+ exec ruby -I $prefix/lib $prefix/bin/wrongdoc "$@"
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: 3
5
- prerelease: false
4
+ hash: 15
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
- - 5
8
+ - 6
9
9
  - 0
10
- version: 1.5.0
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-01-30 00:00:00 +00:00
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: 7
28
+ hash: 5
30
29
  segments:
31
30
  - 1
32
- - 4
33
- version: "1.4"
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: 13
59
+ hash: 21
61
60
  segments:
62
61
  - 3
63
- - 5
64
- version: "3.5"
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.3.7
172
+ rubygems_version: 1.8.5
174
173
  signing_key:
175
174
  specification_version: 3
176
175
  summary: RDoc done right (IMNSHO)