forked from goncalossilva/acts_as_paranoid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
executable file
·57 lines (46 loc) · 1.29 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
begin
require "bundler"
Bundler.setup
rescue LoadError
$stderr.puts "You need to have Bundler installed to be able build this gem."
end
require "rake/testtask"
require "rake/rdoctask"
gemspec = eval(File.read(Dir["*.gemspec"].first))
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the acts_as_paranoid plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
test_files = FileList['test/**/test_*.rb']
test_files.exclude('test/test_helper.rb')
t.test_files = test_files
t.verbose = true
end
desc 'Generate documentation for the acts_as_paranoid plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'ActsAsParanoid'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end
desc "Validate the gemspec"
task :gemspec do
gemspec.validate
end
desc "Build gem locally"
task :build => :gemspec do
system "gem build #{gemspec.name}.gemspec"
FileUtils.mkdir_p "pkg"
FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "pkg"
end
desc "Install gem locally"
task :install => :build do
system "gem install pkg/#{gemspec.name}-#{gemspec.version}"
end
desc "Clean automatically generated files"
task :clean do
FileUtils.rm_rf "pkg"
end