diff options
| author | hukl <contact@smyck.org> | 2009-02-17 12:47:49 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-02-17 12:47:49 +0100 |
| commit | 3cdcb5ca02a94b2b342c30903a27d47d35d46e55 (patch) | |
| tree | ef3e1154fe262561b3955c07edcaee3824a21f47 /vendor/plugins/will_paginate/Rakefile | |
| parent | 7a282f2605f6fb3689940e5c7072b4801653deb2 (diff) | |
added will_paginate plugin
Diffstat (limited to 'vendor/plugins/will_paginate/Rakefile')
| -rw-r--r-- | vendor/plugins/will_paginate/Rakefile | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/vendor/plugins/will_paginate/Rakefile b/vendor/plugins/will_paginate/Rakefile new file mode 100644 index 0000000..253efd0 --- /dev/null +++ b/vendor/plugins/will_paginate/Rakefile | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | require 'rubygems' | ||
| 2 | begin | ||
| 3 | hanna_dir = '/Users/mislav/Projects/Hanna/lib' | ||
| 4 | $:.unshift hanna_dir if File.exists? hanna_dir | ||
| 5 | require 'hanna/rdoctask' | ||
| 6 | rescue LoadError | ||
| 7 | require 'rake' | ||
| 8 | require 'rake/rdoctask' | ||
| 9 | end | ||
| 10 | load 'test/tasks.rake' | ||
| 11 | |||
| 12 | desc 'Default: run unit tests.' | ||
| 13 | task :default => :test | ||
| 14 | |||
| 15 | desc 'Generate RDoc documentation for the will_paginate plugin.' | ||
| 16 | Rake::RDocTask.new(:rdoc) do |rdoc| | ||
| 17 | rdoc.rdoc_files.include('README.rdoc', 'LICENSE', 'CHANGELOG.rdoc'). | ||
| 18 | include('lib/**/*.rb'). | ||
| 19 | exclude('lib/will_paginate/named_scope*'). | ||
| 20 | exclude('lib/will_paginate/array.rb'). | ||
| 21 | exclude('lib/will_paginate/version.rb') | ||
| 22 | |||
| 23 | rdoc.main = "README.rdoc" # page to start on | ||
| 24 | rdoc.title = "will_paginate documentation" | ||
| 25 | |||
| 26 | rdoc.rdoc_dir = 'doc' # rdoc output folder | ||
| 27 | rdoc.options << '--inline-source' << '--charset=UTF-8' | ||
| 28 | rdoc.options << '--webcvs=http://github.com/mislav/will_paginate/tree/master/' | ||
| 29 | end | ||
| 30 | |||
| 31 | desc %{Update ".manifest" with the latest list of project filenames. Respect\ | ||
| 32 | .gitignore by excluding everything that git ignores. Update `files` and\ | ||
| 33 | `test_files` arrays in "*.gemspec" file if it's present.} | ||
| 34 | task :manifest do | ||
| 35 | list = Dir['**/*'].sort | ||
| 36 | spec_file = Dir['*.gemspec'].first | ||
| 37 | list -= [spec_file] if spec_file | ||
| 38 | |||
| 39 | File.read('.gitignore').each_line do |glob| | ||
| 40 | glob = glob.chomp.sub(/^\//, '') | ||
| 41 | list -= Dir[glob] | ||
| 42 | list -= Dir["#{glob}/**/*"] if File.directory?(glob) and !File.symlink?(glob) | ||
| 43 | puts "excluding #{glob}" | ||
| 44 | end | ||
| 45 | |||
| 46 | if spec_file | ||
| 47 | spec = File.read spec_file | ||
| 48 | spec.gsub! /^(\s* s.(test_)?files \s* = \s* )( \[ [^\]]* \] | %w\( [^)]* \) )/mx do | ||
| 49 | assignment = $1 | ||
| 50 | bunch = $2 ? list.grep(/^test\//) : list | ||
| 51 | '%s%%w(%s)' % [assignment, bunch.join(' ')] | ||
| 52 | end | ||
| 53 | |||
| 54 | File.open(spec_file, 'w') {|f| f << spec } | ||
| 55 | end | ||
| 56 | File.open('.manifest', 'w') {|f| f << list.join("\n") } | ||
| 57 | end | ||
| 58 | |||
| 59 | task :examples do | ||
| 60 | %x(haml examples/index.haml examples/index.html) | ||
| 61 | %x(sass examples/pagination.sass examples/pagination.css) | ||
| 62 | end | ||
