forked from activewarehouse/rails_sql_views
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Rakefile
74 lines (64 loc) · 2.21 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
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require File.join(File.dirname(__FILE__), 'lib/rails_sql_views', 'version')
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
PKG_NAME = 'rails_sql_views'
PKG_VERSION = RailsSqlViews::VERSION::STRING + PKG_BUILD
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
PKG_DESTINATION = ENV["PKG_DESTINATION"] || "../#{PKG_NAME}"
RELEASE_NAME = "REL #{PKG_VERSION}"
RUBY_FORGE_PROJECT = "activewarehouse"
RUBY_FORGE_USER = "aeden"
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the library.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
namespace :rcov do
desc 'Measures test coverage'
task :test do
rm_f 'coverage.data'
mkdir 'coverage' unless File.exist?('coverage')
rcov = "rcov --aggregate coverage.data --text-summary -Ilib"
system("#{rcov} test/*_test.rb test/**/*_test.rb")
system("open coverage/index.html") if PLATFORM['darwin']
end
end
desc 'Generate documentation library.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'Rails SQL Views'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = "rails_sql_views"
s.summary = "Library which adds SQL Views to ActiveRecord."
s.email = "[email protected]"
s.homepage = "http://activewarehouse.rubyforge.org/rails_sql_views"
s.description = "Adds support for using SQL views within ActiveRecord"
s.authors = ["Anthony Eden"]
s.files = FileList[
"CHANGELOG",
"README",
"Rakefile",
"{bin,lib}/**/*"
]
s.add_dependency 'activerecord'
end
rescue LoadError
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
desc "Publish the API documentation"
task :pdoc => [:rdoc] do
Rake::SshDirPublisher.new("[email protected]", "/var/www/gforge-projects/activewarehouse/rails_sql_views/rdoc", "rdoc").upload
end