stffn / declarative_authorization

An authorization Rails plugin using a declarative DSL for specifying authorization rules in one place

This URL has Read+Write access

0ba24788 » stffn 2008-08-14 initial commit 1 require 'rake'
2 require 'rake/testtask'
3 require 'rake/rdoctask'
4
5 desc 'Default: run unit tests.'
6 task :default => :test
7
8 desc 'Test the authorization plugin.'
9 Rake::TestTask.new(:test) do |t|
10 t.libs << 'lib'
11 t.pattern = 'test/**/*_test.rb'
12 t.verbose = true
13 end
14
15 desc 'Generate documentation for the authorization plugin.'
16 Rake::RDocTask.new(:rdoc) do |rdoc|
17 rdoc.rdoc_dir = 'rdoc'
18 rdoc.title = 'Authorization'
19 rdoc.options << '--line-numbers' << '--inline-source'
20 rdoc.options << '--charset' << 'utf-8'
5f3b32d3 » stffn 2008-09-18 renamed README to README.rd... 21 rdoc.rdoc_files.include('README.rdoc')
035c94fa » stffn 2009-02-02 Added CHANGELOG 22 rdoc.rdoc_files.include('CHANGELOG')
0ba24788 » stffn 2008-08-14 initial commit 23 rdoc.rdoc_files.include('lib/**/*.rb')
24 end
7498bbfb » stffn 2008-10-28 Garlic for tests with multi... 25
26 # load up garlic if it's here
27 if File.directory?(File.join(File.dirname(__FILE__), 'garlic'))
28 require File.join(File.dirname(__FILE__), 'garlic/lib/garlic_tasks')
29 require File.join(File.dirname(__FILE__), 'garlic')
30 end
31
32 desc "clone the garlic repo (for running ci tasks)"
33 task :get_garlic do
34 sh "git clone git://github.com/ianwhite/garlic.git garlic"
35 end
1b29e5c4 » stffn 2009-02-25 Safer gemspec version and g... 36
37 desc "Expand filelist in src gemspec"
38 task :build_gemspec do
39 gemspec_data = File.read("declarative_authorization.gemspec.src")
40 gemspec_data.gsub!(/\.files = (.*)/) {|m| ".files = #{eval($1).inspect}"}
41 File.open("declarative_authorization.gemspec", "w") {|f| f.write(gemspec_data)}
42 end
43