forked from moro/piki_doc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
97 lines (81 loc) · 2.51 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
$: << "./lib"
require 'piki_doc'
require 'rake/clean'
require 'rake/testtask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'spec/rake/spectask'
require 'cucumber/rake/task'
NAME = ENV["GEMNAME"] || "piki_doc"
HOMEPAGE = "http://github.com/moro/#{NAME}/"
AUTHOR = "MOROHASHI Kyosuke"
EMAIL = "[email protected]"
DESCRIPTION = "extended HikiDoc to able to plug plugins."
VERS = PikiDoc::Version
CLEAN.include ['**/.*.sw?', '*.gem', '.config']
RDOC_OPTS = [
'--title', "#{NAME} documentation",
"--charset", "utf-8",
"--opname", "index.html",
"--line-numbers",
"--main", "README.ja.hiki",
"--inline-source",
]
Spec::Rake::SpecTask.new do |t|
t.warning = true
t.spec_opts = %w[--format progress --color]
end
Cucumber::Rake::Task.new do |t|
t.cucumber_opts = "--format progress"
end
gemspec = Gem::Specification.new do |s|
s.name = NAME
s.version = VERS
s.platform = Gem::Platform::RUBY
s.has_rdoc = false
s.extra_rdoc_files = ["README.ja.hiki", "Changelog"]
s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)/']
s.summary = DESCRIPTION
s.description = DESCRIPTION
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPAGE
s.executables = []
s.require_path = "lib"
s.test_files = Dir["spec/**/*_spec.rb"] + Dir["features/**/*.rb"] + Dir["features/*.feature"]
s.files = %w(README.ja.hiki Changelog Rakefile) +
Dir.glob("{bin,doc,lib,templates,generators,extras,website,script}/**/*") +
Dir.glob("ext/**/*.{h,c,rb}") +
Dir.glob("examples/**/*.rb") +
Dir.glob("tools/*.rb") +
Dir.glob("rails/*.rb")
s.extensions = FileList["ext/**/extconf.rb"].to_a
end
Rake::GemPackageTask.new(gemspec) do |p|
p.need_tar = true
p.gem_spec = gemspec
end
task :install do
name = "#{NAME}-#{VERS}.gem"
sh %{rake package}
sh %{gem install pkg/#{name}}
end
task :uninstall => [:clean] do
sh %{gem uninstall #{NAME}}
end
desc 'Show information about the gem.'
task :debug_gem do
puts gemspec.to_ruby
end
desc 'Update gem spec'
task :gemspec do
open("#{NAME}.gemspec", 'w').write gemspec.to_ruby
end
desc "output example from README.ja.hiki"
task "readme_example" do
require 'piki_doc'
require 'piki_doc/bundles/gist'
require 'piki_doc/bundles/asin'
PikiDoc.register(PikiDoc::Bundles::Gist.new, PikiDoc::Bundles::Asin.new)
puts PikiDoc.to_xhtml(File.read("README.ja.hiki"))
end