public
Description: Rails deployment and configuration management done right. ShadowPuppet + Capistrano == crazy delicious
Homepage: http://railsmachine.github.com/moonshine/
Clone URL: git://github.com/railsmachine/moonshine.git
andrewroth (author)
Wed Nov 04 08:27:01 -0800 2009
jnewland (committer)
Wed Nov 04 08:42:19 -0800 2009
moonshine / Rakefile
100644 85 lines (68 sloc) 1.841 kb
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
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: run unit tests.'
task :default => :test
 
desc 'Test the moonshine plugin.'
Rake::TestTask.new(:test) do |t|
  t.libs << 'lib'
  t.libs << 'test'
  t.pattern = 'test/**/*_test.rb'
  t.verbose = true
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