forked from pschrammel/active_acl_plus_deprecated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
98 lines (81 loc) · 3.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'rake/contrib/sshpublisher'
# RCOV command, run as though from the commandline.
RCOV = "rcov"
RUBY_FORGE_PROJECT = "activeaclplus"
RUBY_FORGE_USER = "popel"
PKG_NAME="active_acl_plus"
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = 'active_acl_plus'
s.authors = ["Peter Schrammel","Gregor Melhorn"]
s.description = %q{A flexible, fast and easy to use generic access control system.}
s.email = ["[email protected]"]
s.rubyforge_project = RUBY_FORGE_PROJECT
s.summary = "A new Version of ActiveAclPlus is available."
s.homepage = "http://activeaclplus.rubyforge.org/"
s.extra_rdoc_files = ["README.rdoc","LICENSE","CHANGELOG"]
s.rdoc_options = [ "--title", "Active Acl Plus", "--main", "README.rdoc"]
s.files = FileList["[A-Z]*.*","{lib,app,db}/**/*"]
s.add_dependency("activerecord")
end
rescue LoadError
puts "Jeweler not available."
end
desc 'Default: run specs'
task :default => :spec
desc "Publish the API documentation"
task :pdoc => [:rdoc] do
Rake::SshDirPublisher.new("[email protected]", "/var/www/gforge-projects/activeaclplus/api", "rdoc").upload
#Rake::RubyForgePublisher.new(RUBY_FORGE_PROJECT, RUBY_FORGE_USER).upload
end
desc "Publish the API docs and gem"
task :publish => [:pdoc, :release]
desc "Publish the release files to RubyForge."
task :release => [:gem, :package] do
require 'rubyforge'
options={}
#options["cookie_jar"] = RubyForge::COOKIE_F
#options["password"] = ENV["RUBY_FORGE_PASSWORD"] if ENV["RUBY_FORGE_PASSWORD"]
ruby_forge = RubyForge.new
ruby_forge.configure
ruby_forge.login
%w( gem tgz zip ).each do |ext|
file = "pkg/#{PKG_FILE_NAME}.#{ext}"
puts "Releasing #{File.basename(file)}..."
ruby_forge.add_release(RUBY_FORGE_PROJECT, PKG_NAME, PKG_VERSION, file)
end
end
desc "generate a coverage report"
task :coverage do
sh "#{RCOV} --rails -T -Ilib -x db/**/* --output ../../../coverage/active_acl test/all_tests.rb"
end
desc "generate a coverage report saving current state"
task :coverage_save do
sh "#{RCOV} --rails -T -Ilib -x db/**/* --output ../../../coverage/active_acl --save ../../../coverage/active_acl/coverage.info test/all_tests.rb"
end
desc "generate a diff coverage report on previously saved state"
task :coverage_diff do
sh "#{RCOV} --rails -T -Ilib -x db/**/* --text-coverage-diff ../../../coverage/active_acl/coverage.info --output ../../../coverage/active_acl test/all_tests.rb"
end
begin #no spec or spec-rails? ok no tasks
require 'spec/rake/spectask'
desc 'Test the active_acl_plus plugin.'
Spec::Rake::SpecTask.new(:spec) do |t|
#t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
t.spec_files = FileList['spec/**/*_spec.rb']
end
rescue LoadError => e
puts "No spec tasks! - gem install rspec-rails (#{__FILE__})"
end
desc 'Generate documentation for the active_acl_plus plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'ActiveAclPlus'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('CHANGELOG','LICENSE','README.rdoc','lib/**/*.rb','app/**/*.rb')
end