forked from envylabs/census
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
70 lines (58 loc) · 2.2 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
require 'rubygems'
require 'rake'
require 'rake/testtask'
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "census"
gem.summary = %Q{Rails user demographics collection and searching}
gem.description = %Q{Census is a Rails plugin that collects searchable demographics data for each of your application's users.}
gem.email = "[email protected]"
gem.homepage = "http://github.com/envylabs/census"
gem.authors = ["Mark Kendall"]
gem.files = FileList["[A-Z]*", "{app,config,generators,lib,shoulda_macros,rails}/**/*"]
gem.add_dependency "acts_as_list", ">= 0.1.2"
gem.add_dependency "inverse_of", ">= 0.0.1"
gem.add_development_dependency "shoulda", ">= 0"
gem.add_development_dependency "factory_girl", ">= 0"
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
namespace :test do
Rake::TestTask.new(:basic => ["check_dependencies",
"generator:cleanup",
"generator:census"]) do |task|
task.libs << "lib"
task.libs << "test"
task.pattern = "test/{controllers,models}/*_test.rb"
task.verbose = false
end
end
task :default => ['test:basic']
generators = %w(census)
namespace :generator do
desc "Cleans up the test app before running the generator"
task :cleanup do
FileList["test/rails_root/db/**/*"].each do |each|
FileUtils.rm_rf(each)
end
FileUtils.rm_rf("test/rails_root/vendor/plugins/census")
FileUtils.mkdir_p("test/rails_root/vendor/plugins")
census_root = File.expand_path(File.dirname(__FILE__))
system("ln -s \"#{census_root}\" test/rails_root/vendor/plugins/census")
end
desc "Run the census generator"
task :census do
system "cd test/rails_root && ./script/generate census -f && rake gems:unpack && rake db:migrate db:test:prepare"
end
end
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "Census #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end