forked from jamesgolick/resource_controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
55 lines (43 loc) · 1.57 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
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the ResourceController plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentation for the ResourceController plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'ResourceController'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end
desc "Do all necessary tagging for a release"
task :release => [:tag_release, :upload_docs]
task :tag_release do
unless ENV.include?('human') && ENV.include?('tag')
raise "Usage: rake release human=0.something tag=rel_2.0"
end
tag_name = ENV['tag']
human_name = ENV['human']
repo_root = "http://svn.jamesgolick.com/resource_controller"
puts "tagging #{human_name}"
`svn copy #{repo_root}/trunk #{repo_root}/tags/#{tag_name} -m"tagging #{human_name}"`
puts "deleting previous stable tags"
`svn rm #{repo_root}/tags/stable -m"deleting previous stable tags"`
puts "tag stable release"
`svn copy #{repo_root}/tags/#{tag_name} #{repo_root}/tags/stable -m"tag stable release"`
end
task :upload_docs => :rdoc do
puts 'Deleting previous rdoc'
`ssh jamesgolick.com 'rm -Rf /home/apps/jamesgolick.com/public/resource_controller/rdoc'`
puts "Uploading current rdoc"
`scp -r rdoc jamesgolick.com:/home/apps/jamesgolick.com/public/resource_controller`
puts "Deleting rdoc"
`rm -Rf rdoc`
end