-
Notifications
You must be signed in to change notification settings - Fork 86
/
Rakefile
37 lines (32 loc) · 983 Bytes
/
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
require 'bundler/gem_tasks'
require 'yard'
desc 'Generate API documentation'
YARD::Rake::YardocTask.new
desc 'Download the latest schema and build a new client'
task :build do
sh 'curl -o schema.json -H "Accept: application/vnd.heroku+json; version=3" https://api.heroku.com/schema'
sh 'bundle exec heroics-generate ./config/client-config.rb > lib/platform-api/client.rb'
end
desc 'Publish API documentation'
task :publish_docs => [:build] do
sh 'rake yard'
sh 'cp -R doc /tmp/platform-api-doc'
sh 'git checkout gh-pages'
sh 'rm -rf *'
sh 'cp -R /tmp/platform-api-doc/* .'
sh 'rm -rf /tmp/platform-api-doc'
sh 'git add -A .'
sh 'git commit -am "Rebuild documentation"'
sh 'git push origin gh-pages'
sh 'git checkout master'
end
# After releasing publish the docs
Rake::Task["release"].enhance do
Rake::Task[:publish_docs].invoke
end
begin
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task default: [:spec]
rescue LoadError
end