Skip to content

Commit 8c8c619

Browse files
committed
[DOC] Add document task
1 parent 959416b commit 8c8c619

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/Gemfile.lock
44
/_yardoc/
55
/coverage/
6-
/doc/
6+
/html/
77
/logs/
88
/pkg/
99
/spec/reports/

Rakefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require "bundler/gem_tasks"
22
require "rake/testtask"
3+
require "rdoc/task"
34

45
name = "etc"
56

@@ -21,6 +22,12 @@ Rake::TestTask.new(:test) do |t|
2122
t.test_files = FileList["test/**/test_*.rb"]
2223
end
2324

25+
task "rdoc" => "changelogs"
26+
RDoc::Task.new do |rdoc|
27+
rdoc.main = "README.md"
28+
rdoc.rdoc_files.include("LICENSE.txt", "ChangeLog", "*.md", "lib/**/*.rb", "ext/**/*.c")
29+
end
30+
2431
task :test => :compile
2532

2633
task :default => :test

etc.gemspec

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,20 @@ Gem::Specification.new do |spec|
2525
spec.files = %w[
2626
LICENSE.txt
2727
README.md
28+
ChangeLog
2829
ext/etc/constdefs.h
2930
ext/etc/etc.c
3031
ext/etc/extconf.rb
3132
ext/etc/mkconstants.rb
3233
test/etc/test_etc.rb
3334
]
35+
spec.rdoc_options = ["--main", "README.md"]
36+
spec.extra_rdoc_files = [
37+
"LICENSE.txt",
38+
"README.md",
39+
"ChangeLog",
40+
*Dir.glob("logs/ChangeLog-*[^~]", base: __dir__),
41+
]
3442
spec.bindir = "exe"
3543
spec.require_paths = ["lib"]
3644
spec.extensions = %w{ext/etc/extconf.rb}

0 commit comments

Comments
 (0)