forked from collectiveidea/migration_test_helper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
62 lines (54 loc) · 2.3 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
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'hoe'
desc 'Default: run unit tests.'
task :default => :test
desc 'Generate documentation for the migration_test_helper plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'MigrationTestHelper'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('LICENSE')
rdoc.rdoc_files.include('lib/**/*.rb')
end
GEM_VERSION = '1.3.3'
Hoe.new('migration_test_helper',GEM_VERSION) do |p|
p.author = "Micah Alles"
p.email = "[email protected]"
p.url = "http://migrationtest.rubyforge.org"
p.summary = "A Rails plugin for testing migrations"
p.description = <<-EOS
migration_test_helper makes testing your migrations easier by
adding helper methods to Test::Unit::TestCase for asserting the
current state of the schema and executing migrations against the
test database.
EOS
p.changes = <<-EOS
* fixed bug where test:migration was calling itself, thanks Patrick ;)
EOS
p.rubyforge_name = 'migrationtest'
end
desc "Generate and upload api docs to rubyforge"
task :upload_doc => :rerdoc do
sh "scp -r rdoc/* rubyforge.org:/var/www/gforge-projects/migrationtest/"
end
desc "Release from current trunk"
task :plugin_release do
require 'fileutils'
include FileUtils::Verbose
cd File.expand_path(File.dirname(__FILE__)) do
sh 'svn up'
status = `svn status`
raise "Please clean up before releasing.\n#{status}" unless status == ""
unless `svn ls svn+ssh://[email protected]/var/svn/migrationtest/tags/rel-#{GEM_VERSION} -m`.strip.empty?
sh "svn del svn+ssh://[email protected]/var/svn/migrationtest/tags/rel-#{GEM_VERSION} -m 'Preparing to update stable release tag'"
end
sh "svn cp . svn+ssh://[email protected]/var/svn/migrationtest/tags/rel-#{GEM_VERSION} -m 'Releasing version #{GEM_VERSION}'"
unless `svn ls svn+ssh://[email protected]/var/svn/migrationtest/tags/migration_test_helper`.strip.empty?
sh "svn del svn+ssh://[email protected]/var/svn/migrationtest/tags/migration_test_helper -m 'Preparing to update stable release tag'"
end
sh "svn cp . svn+ssh://[email protected]/var/svn/migrationtest/tags/migration_test_helper -m 'Updating stable tag to version #{GEM_VERSION}'"
end
end