Skip to content

Commit ecea817

Browse files
committed
Fixed rdoc generation and publishing with rake doc:pages:publish.
1 parent cb71668 commit ecea817

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ group :development, :test do
1515
gem 'github-markup'
1616
gem 'cookiejar'
1717
gem 'rack-contrib'
18+
gem 'redcarpet'
1819
end

Rakefile

+19-3
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,32 @@ begin
2828
namespace :doc do
2929
YARD::Rake::YardocTask.new(:pages) do |t|
3030
t.files = DOC_FILES
31-
t.options = ['-o', '../grape.doc']
31+
t.options = ['-o', '../grape.doc/docs']
3232
end
3333

3434
namespace :pages do
35+
36+
desc "Check out gh-pages."
37+
task :checkout do
38+
dir = File.dirname(__FILE__) + '/../grape.doc'
39+
unless Dir.exist?(dir)
40+
Dir.mkdir(dir)
41+
Dir.chdir(dir) do
42+
system("git init")
43+
system("git remote add origin git@github.com:intridea/grape.git")
44+
system("git pull")
45+
system("git checkout gh-pages")
46+
end
47+
end
48+
end
49+
3550
desc 'Generate and publish YARD docs to GitHub pages.'
36-
task :publish => ['doc:pages'] do
51+
task :publish => ['doc:pages:checkout', 'doc:pages'] do
3752
Dir.chdir(File.dirname(__FILE__) + '/../grape.doc') do
53+
system("git checkout gh-pages")
3854
system("git add .")
3955
system("git add -u")
40-
system("git commit -m 'Generating docs for version #{version}.'")
56+
system("git commit -m 'Generating docs for version #{Grape::VERSION}.'")
4157
system("git push origin gh-pages")
4258
end
4359
end

0 commit comments

Comments
 (0)