forked from movitto/polisher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
94 lines (76 loc) · 2.84 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
83
84
85
86
87
88
89
90
91
92
93
94
# polisher project Rakefile
require 'lib/common'
require 'db/connection'
require 'rake/rdoctask'
require 'spec/rake/spectask'
require 'rake/gempackagetask'
#task :default => :test
env = ENV['RACK_ENV']
env ||= 'development'
logger = Logger.new(STDOUT)
GEM_NAME='polisher'
PKG_VERSION='0.4'
namespace :db do
desc "Migrate the database"
task :migrate do
Polisher::DB.connect Polisher::DB.load_config('./config/database.yml', env), logger
Polisher::DB.migrate './db/migrations'
end
desc "Rollback the database"
task :rollback do
Polisher::DB.connect Polisher::DB.load_config('./config/database.yml', env), logger
Polisher::DB.rollback './db/migrations'
end
desc "Drop all tables in the database"
task :drop_tables do
Polisher::DB.connect Polisher::DB.load_config('./config/database.yml', env), logger
Polisher::DB.drop_tables './db/migrations'
end
end
task 'test_env' do
env = 'test'
create_missing_polisher_dirs(:artifacts_dir => 'spec/artifacts', :db_data_dir => 'db/data', :log_dir => 'log')
end
desc "Run all specs"
Spec::Rake::SpecTask.new('spec' => ['test_env', 'db:drop_tables', 'db:migrate']) do |t|
t.spec_files = FileList['spec/*_spec.rb']
end
Rake::RDocTask.new do |rd|
rd.main = "README.rdoc"
rd.rdoc_dir = "doc/site/api"
rd.rdoc_files.include("README.rdoc", "polisher.rb", "db/models/*.rb", "lib/**/*.rb")
end
PKG_FILES = FileList['bin/*', 'config/*.yml', 'config.ru', 'COPYING',
'db/**/*.rb', 'lib/**/*.rb', 'LICENSE', 'polisher.rb', 'public/**/*', 'Rakefile',
'README.rdoc', 'spec/**/*.rb', 'TODO', 'views/**/*.haml']
DIST_FILES = FileList[
"pkg/*.tgz", "pkg/*.gem"
]
SPEC = Gem::Specification.new do |s|
s.name = GEM_NAME
s.version = PKG_VERSION
s.files = PKG_FILES
s.required_ruby_version = '>= 1.8.1'
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.3")
s.add_dependency('sinatra', '>= 0.9.4')
s.add_dependency('thin', '>= 1.2.7')
s.add_dependency('activerecord', '>= 2.3.5')
s.add_dependency('haml', '>= 2.2.20')
s.add_dependency('curb', '>= 0.6.7') # eg curl
s.add_dependency('libxml-ruby', '>= 1.1.3')
s.add_dependency('rest-client', '>= 1.4.2')
s.add_dependency('json_pure', '>= 1.2.0')
s.add_dependency('gem2rpm', '>= 0.6.0')
s.add_dependency('rspec', '>= 1.3.0')
s.add_dependency('rack-test', '>= 0.5.3')
s.author = "Mohammed Morsi"
s.email = "[email protected]"
s.date = %q{2010-04-22}
s.summary = "A project release management tool"
s.description = "Polisher provides simple REST and DSL interfaces allowing you to configure event workflows to be invoked on specific versions of project/source releases"
s.homepage = "http://github.com/movitto/polisher"
end
Rake::GemPackageTask.new(SPEC) do |pkg|
pkg.need_tar = true
pkg.need_zip = true
end