-
Notifications
You must be signed in to change notification settings - Fork 69
/
Rakefile
82 lines (66 loc) · 1.8 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
require 'rake'
require 'rake/testtask'
begin
require 'rubygems'
require 'hanna/rdoctask'
rescue LoadError
require 'rake/rdoctask'
end
task :rcov do
system "rcov --exclude /Library/Ruby/ --exclude ~/ -Itest `find test/ | grep _test`"
end
desc 'Default: specs'
task :default => :spec
require 'spec/rake/spectask'
desc "Run all specs in spec directory (excluding plugin specs)"
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
end
desc 'Generate documentation for the moonshine plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = 'Moonshine'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.main = "README.rdoc"
rdoc.options << '--webcvs=http://github.com/railsmachine/moonshine/tree/master/'
end
task :build => :cleanup do
system "gem build *.gemspec"
end
task :install => :build do
system "sudo gem install *.gem"
end
task :uninstall do
system "sudo gem uninstall *.gem"
end
task :cleanup do
system "rm *.gem"
end
task :pull do
system "git pull origin master"
system "git pull github master"
end
task :_push do
system "git push origin master"
system "git push github master"
end
task :push => [:redoc, :pull, :test, :_push]
task :redoc do
#clean
system "git checkout gh-pages && git pull origin gh-pages && git pull github gh-pages"
system "rm -rf doc"
system "git checkout master"
system "rm -rf doc"
#doc
Rake::Task['rdoc'].invoke
#switch branch
system "git checkout gh-pages"
#move it all to the root
system "cp -r doc/* . && rm -rf doc"
#add, commit and push
system "git add ."
system "git commit -am 'regenerate rdocs' && git push origin gh-pages && git push github gh-pages"
system "git checkout master"
end