Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update will-paginate to work with Rails 2.3.4. Fix Journal entries
- Loading branch information
Showing
24 changed files
with
760 additions
and
943 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,53 @@ | ||
require 'rake' | ||
require 'rake/testtask' | ||
require 'rake/rdoctask' | ||
require 'rubygems' | ||
begin | ||
hanna_dir = '/Users/mislav/Projects/Hanna/lib' | ||
$:.unshift hanna_dir if File.exists? hanna_dir | ||
require 'hanna/rdoctask' | ||
rescue LoadError | ||
require 'rake' | ||
require 'rake/rdoctask' | ||
end | ||
load 'test/tasks.rake' | ||
|
||
desc 'Default: run unit tests.' | ||
task :default => :test | ||
|
||
desc 'Test the will_paginate plugin.' | ||
Rake::TestTask.new(:test) do |t| | ||
t.pattern = 'test/**/*_test.rb' | ||
t.verbose = true | ||
end | ||
|
||
# I want to specify environment variables at call time | ||
class EnvTestTask < Rake::TestTask | ||
attr_accessor :env | ||
|
||
def ruby(*args) | ||
env.each { |key, value| ENV[key] = value } if env | ||
super | ||
env.keys.each { |key| ENV.delete key } if env | ||
end | ||
end | ||
|
||
for configuration in %w( sqlite3 mysql postgres ) | ||
EnvTestTask.new("test_#{configuration}") do |t| | ||
t.pattern = 'test/finder_test.rb' | ||
t.verbose = true | ||
t.env = { 'DB' => configuration } | ||
end | ||
end | ||
|
||
task :test_databases => %w(test_mysql test_sqlite3 test_postgres) | ||
|
||
desc %{Test everything on SQLite3, MySQL and PostgreSQL} | ||
task :test_full => %w(test test_mysql test_postgres) | ||
|
||
desc %{Test everything with Rails 1.2.x and 2.0.x gems} | ||
task :test_all do | ||
all = Rake::Task['test_full'] | ||
ENV['RAILS_VERSION'] = '~>1.2.6' | ||
all.invoke | ||
# reset the invoked flag | ||
%w( test_full test test_mysql test_postgres ).each do |name| | ||
Rake::Task[name].instance_variable_set '@already_invoked', false | ||
end | ||
# do it again | ||
ENV['RAILS_VERSION'] = '~>2.0.2' | ||
all.invoke | ||
end | ||
|
||
desc 'Generate RDoc documentation for the will_paginate plugin.' | ||
Rake::RDocTask.new(:rdoc) do |rdoc| | ||
files = ['README', 'LICENSE', 'lib/**/*.rb'] | ||
rdoc.rdoc_files.add(files) | ||
rdoc.main = "README" # page to start on | ||
rdoc.title = "will_paginate" | ||
rdoc.rdoc_files.include('README.rdoc', 'LICENSE', 'CHANGELOG.rdoc'). | ||
include('lib/**/*.rb'). | ||
exclude('lib/will_paginate/named_scope*'). | ||
exclude('lib/will_paginate/array.rb'). | ||
exclude('lib/will_paginate/version.rb') | ||
|
||
templates = %w[/Users/chris/ruby/projects/err/rock/template.rb /var/www/rock/template.rb] | ||
rdoc.template = templates.find { |t| File.exists? t } | ||
rdoc.main = "README.rdoc" # page to start on | ||
rdoc.title = "will_paginate documentation" | ||
|
||
rdoc.rdoc_dir = 'doc' # rdoc output folder | ||
rdoc.options << '--inline-source' | ||
rdoc.options << '--charset=UTF-8' | ||
rdoc.options << '--inline-source' << '--charset=UTF-8' | ||
rdoc.options << '--webcvs=http://github.com/mislav/will_paginate/tree/master/' | ||
end | ||
|
||
desc %{Update ".manifest" with the latest list of project filenames. Respect\ | ||
.gitignore by excluding everything that git ignores. Update `files` and\ | ||
`test_files` arrays in "*.gemspec" file if it's present.} | ||
task :manifest do | ||
list = `git ls-files --full-name --exclude=*.gemspec --exclude=.*`.chomp.split("\n") | ||
|
||
if spec_file = Dir['*.gemspec'].first | ||
spec = File.read spec_file | ||
spec.gsub! /^(\s* s.(test_)?files \s* = \s* )( \[ [^\]]* \] | %w\( [^)]* \) )/mx do | ||
assignment = $1 | ||
bunch = $2 ? list.grep(/^test\//) : list | ||
'%s%%w(%s)' % [assignment, bunch.join(' ')] | ||
end | ||
|
||
File.open(spec_file, 'w') { |f| f << spec } | ||
end | ||
File.open('.manifest', 'w') { |f| f << list.join("\n") } | ||
end | ||
|
||
task :examples do | ||
%x(haml examples/index.haml examples/index.html) | ||
%x(sass examples/pagination.sass examples/pagination.css) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
require 'will_paginate' | ||
WillPaginate.enable |
Oops, something went wrong.