Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 93 lines (76 sloc) 2.52 kB
079d0d8 Awesome new features, supersmart tests, great coverage!
mislav authored
1 require 'rake'
2 require 'rake/testtask'
3 require 'rake/rdoctask'
4
5 desc 'Default: run unit tests.'
6 task :default => :test
7
0128efd Point users to the Lightouse URL
mislav authored
8 desc 'Test the will_paginate plugin.'
079d0d8 Awesome new features, supersmart tests, great coverage!
mislav authored
9 Rake::TestTask.new(:test) do |t|
10 t.pattern = 'test/**/*_test.rb'
11 t.verbose = true
1d8a065 @mislav Reduce File.dirname cruft: invoke individual tests with -Ilib:test pa…
authored
12 t.libs << 'test'
079d0d8 Awesome new features, supersmart tests, great coverage!
mislav authored
13 end
14
843bf7c Use DB and RAILS_VERSION environment variables in tests. Provide test…
mislav authored
15 # I want to specify environment variables at call time
16 class EnvTestTask < Rake::TestTask
17 attr_accessor :env
18
19 def ruby(*args)
20 env.each { |key, value| ENV[key] = value } if env
21 super
22 env.keys.each { |key| ENV.delete key } if env
23 end
24 end
25
e321a36 Set up tests for MySQL and PostgreSQL besides SQLite3. Change their c…
mislav authored
26 for configuration in %w( sqlite3 mysql postgres )
843bf7c Use DB and RAILS_VERSION environment variables in tests. Provide test…
mislav authored
27 EnvTestTask.new("test_#{configuration}") do |t|
e321a36 Set up tests for MySQL and PostgreSQL besides SQLite3. Change their c…
mislav authored
28 t.pattern = 'test/finder_test.rb'
29 t.verbose = true
843bf7c Use DB and RAILS_VERSION environment variables in tests. Provide test…
mislav authored
30 t.env = { 'DB' => configuration }
1d8a065 @mislav Reduce File.dirname cruft: invoke individual tests with -Ilib:test pa…
authored
31 t.libs << 'test'
e321a36 Set up tests for MySQL and PostgreSQL besides SQLite3. Change their c…
mislav authored
32 end
33 end
34
35 task :test_databases => %w(test_mysql test_sqlite3 test_postgres)
843bf7c Use DB and RAILS_VERSION environment variables in tests. Provide test…
mislav authored
36
37 desc %{Test everything on SQLite3, MySQL and PostgreSQL}
38 task :test_full => %w(test test_mysql test_postgres)
39
40 desc %{Test everything with Rails 1.2.x and 2.0.x gems}
41 task :test_all do
42 all = Rake::Task['test_full']
43 ENV['RAILS_VERSION'] = '~>1.2.6'
44 all.invoke
45 # reset the invoked flag
46 %w( test_full test test_mysql test_postgres ).each do |name|
47 Rake::Task[name].instance_variable_set '@already_invoked', false
48 end
49 # do it again
50 ENV['RAILS_VERSION'] = '~>2.0.2'
51 all.invoke
52 end
e321a36 Set up tests for MySQL and PostgreSQL besides SQLite3. Change their c…
mislav authored
53
0128efd Point users to the Lightouse URL
mislav authored
54 desc 'Generate RDoc documentation for the will_paginate plugin.'
079d0d8 Awesome new features, supersmart tests, great coverage!
mislav authored
55 Rake::RDocTask.new(:rdoc) do |rdoc|
4d7de72 @mislav add examples of pagination links styling
authored
56 files = ['README.rdoc', 'LICENSE']
9afc5e8 @mislav added WillPaginate::VERSION
authored
57 files << FileList.new('lib/**/*.rb').
58 exclude('lib/will_paginate/named_scope*').
59 exclude('lib/will_paginate/array.rb').
60 exclude('lib/will_paginate/version.rb')
61
9ba306e rdoc changes
chris authored
62 rdoc.rdoc_files.add(files)
4d7de72 @mislav add examples of pagination links styling
authored
63 rdoc.main = "README.rdoc" # page to start on
64 rdoc.title = "will_paginate documentation"
c7ec4a5 Will Paginate docs and contributors
mislav authored
65
66 templates = %w[/Users/chris/ruby/projects/err/rock/template.rb /var/www/rock/template.rb]
67 rdoc.template = templates.find { |t| File.exists? t }
68
9ba306e rdoc changes
chris authored
69 rdoc.rdoc_dir = 'doc' # rdoc output folder
70 rdoc.options << '--inline-source'
138f004 Will Paginate Christmas doc love
mislav authored
71 rdoc.options << '--charset=UTF-8'
1cc5730 @mislav clean up README; point people to examples/index.html
authored
72 rdoc.options << '--webcvs=http://github.com/mislav/will_paginate/tree/master/'
079d0d8 Awesome new features, supersmart tests, great coverage!
mislav authored
73 end
1464c8b @mislav gemify
authored
74
75 task :manifest do
76 list = Dir['**/*']
77
78 File.read('.gitignore').each_line do |glob|
79 glob = glob.chomp.sub(/^\//, '')
80 list -= Dir[glob]
81 puts "excluding #{glob}"
82 end
83
84 File.open('.manifest', 'w') do |file|
85 file.write list.sort.join("\n")
86 end
87 end
3bda0ba @mislav added prev_page/next_page CSS classes on prev/next "buttons" in views
authored
88
89 task :examples do
90 %x(haml examples/index.haml examples/index.html)
91 %x(sass examples/pagination.sass examples/pagination.css)
92 end
Something went wrong with that request. Please try again.