Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 49 lines (42 sloc) 1.448 kB
0bd9ecb @txus Let's keep up with those standards, for god's sake
txus authored
1 require 'bundler'
2 Bundler::GemHelper.install_tasks
6b5d62f @txus Initial commit to date_validator.
txus authored
3
e6adfb6 @oriolgual Drop rspec in favor of minispec
oriolgual authored
4 require 'rake/testtask'
5 Rake::TestTask.new do |t|
6 t.libs << "test"
7 t.test_files = FileList['test/**/*_test.rb']
8 t.verbose = true
9 end
702b704 @txus Compatible with Rubinius 1.2.2
txus authored
10
21f1ea9 @oriolgual make simple_cov and yard optional
oriolgual authored
11 begin
12 require 'yard'
13 YARD::Rake::YardocTask.new(:docs) do |t|
14 t.files = ['lib/**/*.rb']
15 t.options = ['-m', 'markdown', '--no-private', '-r', 'Readme.md', '--title', 'Date Validator documentation']
16 end
6b5d62f @txus Initial commit to date_validator.
txus authored
17
21f1ea9 @oriolgual make simple_cov and yard optional
oriolgual authored
18 site = 'doc'
19 source_branch = 'master'
20 deploy_branch = 'gh-pages'
702b704 @txus Compatible with Rubinius 1.2.2
txus authored
21
21f1ea9 @oriolgual make simple_cov and yard optional
oriolgual authored
22 desc "generate and deploy documentation website to github pages"
23 multitask :pages do
24 puts ">>> Deploying #{deploy_branch} branch to Github Pages <<<"
25 require 'git'
26 repo = Git.open('.')
27 puts "\n>>> Checking out #{deploy_branch} branch <<<\n"
28 repo.branch("#{deploy_branch}").checkout
29 (Dir["*"] - [site]).each { |f| rm_rf(f) }
30 Dir["#{site}/*"].each {|f| mv(f, "./")}
31 rm_rf(site)
32 puts "\n>>> Moving generated site files <<<\n"
33 Dir["**/*"].each {|f| repo.add(f) }
34 repo.status.deleted.each {|f, s| repo.remove(f)}
35 puts "\n>>> Commiting: Site updated at #{Time.now.utc} <<<\n"
36 message = ENV["MESSAGE"] || "Site updated at #{Time.now.utc}"
37 repo.commit(message)
38 puts "\n>>> Pushing generated site to #{deploy_branch} branch <<<\n"
39 repo.push
40 puts "\n>>> Github Pages deploy complete <<<\n"
41 repo.branch("#{source_branch}").checkout
42 end
702b704 @txus Compatible with Rubinius 1.2.2
txus authored
43
b9d8018 @jvperrin Change hashes to 1.9.3+ format and remove trailing whitespace
jvperrin authored
44 task doc: [:docs]
21f1ea9 @oriolgual make simple_cov and yard optional
oriolgual authored
45 rescue LoadError
46 end
702b704 @txus Compatible with Rubinius 1.2.2
txus authored
47
b9d8018 @jvperrin Change hashes to 1.9.3+ format and remove trailing whitespace
jvperrin authored
48 task default: :test
Something went wrong with that request. Please try again.