Skip to content
Newer
Older
100644 83 lines (66 sloc) 1.8 KB
af60372 @jnewland proper test harness
jnewland authored
1 require 'rake'
2 require 'rake/testtask'
6a30a98 @jnewland housekeeping
jnewland authored
3 begin
4 require 'rubygems'
5 require 'hanna/rdoctask'
6 rescue LoadError
7 require 'rake/rdoctask'
8 end
af60372 @jnewland proper test harness
jnewland authored
9
51da2cf @jnewland rcov
jnewland authored
10 task :rcov do
11 system "rcov --exclude /Library/Ruby/ --exclude ~/ -Itest `find test/ | grep _test`"
12 end
13
91fa76e @technicalpickles Migrated test suite from test/unit to rspec
technicalpickles authored
14 desc 'Default: specs'
15 task :default => :spec
af60372 @jnewland proper test harness
jnewland authored
16
91fa76e @technicalpickles Migrated test suite from test/unit to rspec
technicalpickles authored
17 require 'spec/rake/spectask'
18 desc "Run all specs in spec directory (excluding plugin specs)"
19 Spec::Rake::SpecTask.new do |t|
20 t.spec_files = FileList['spec/**/*_spec.rb']
af60372 @jnewland proper test harness
jnewland authored
21 end
22
4c9f6b6 @jnewland moonshine_rails -> moonshine, closes #106
jnewland authored
23 desc 'Generate documentation for the moonshine plugin.'
af60372 @jnewland proper test harness
jnewland authored
24 Rake::RDocTask.new(:rdoc) do |rdoc|
1515976 @jnewland fixup rakefile/rdocs for github pages
jnewland authored
25 rdoc.rdoc_dir = 'doc'
4c9f6b6 @jnewland moonshine_rails -> moonshine, closes #106
jnewland authored
26 rdoc.title = 'Moonshine'
af60372 @jnewland proper test harness
jnewland authored
27 rdoc.options << '--line-numbers' << '--inline-source'
28 rdoc.rdoc_files.include('README.rdoc')
29 rdoc.rdoc_files.include('lib/**/*.rb')
6a30a98 @jnewland housekeeping
jnewland authored
30 rdoc.main = "README.rdoc"
1515976 @jnewland fixup rakefile/rdocs for github pages
jnewland authored
31 rdoc.options << '--webcvs=http://github.com/railsmachine/moonshine/tree/master/'
32 end
33
34 task :build => :cleanup do
35 system "gem build *.gemspec"
36 end
37
38 task :install => :build do
39 system "sudo gem install *.gem"
40 end
41
42 task :uninstall do
43 system "sudo gem uninstall *.gem"
44 end
45
46 task :cleanup do
47 system "rm *.gem"
48 end
49
50 task :pull do
51 system "git pull origin master"
52 system "git pull github master"
53 end
54
55 task :_push do
56 system "git push origin master"
57 system "git push github master"
58 end
59
312bf60 @jnewland test, not spec
jnewland authored
60 task :push => [:redoc, :pull, :test, :_push]
1515976 @jnewland fixup rakefile/rdocs for github pages
jnewland authored
61
62 task :redoc do
63 #clean
64 system "git checkout gh-pages && git pull origin gh-pages && git pull github gh-pages"
65 system "rm -rf doc"
66 system "git checkout master"
67 system "rm -rf doc"
68
69 #doc
70 Rake::Task['rdoc'].invoke
71
72 #switch branch
73 system "git checkout gh-pages"
74
75 #move it all to the root
76 system "cp -r doc/* . && rm -rf doc"
77
281e3b3 @jnewland fix redoc task
jnewland authored
78 #add, commit and push
79 system "git add ."
1515976 @jnewland fixup rakefile/rdocs for github pages
jnewland authored
80 system "git commit -am 'regenerate rdocs' && git push origin gh-pages && git push github gh-pages"
81 system "git checkout master"
82 end
Something went wrong with that request. Please try again.