public
Description: A rip-off of will_paginate to get pagination going on merb
Homepage: http://github.com/myobie/merb_paginate
Clone URL: git://github.com/vanpelt/merb_paginate.git
merb_paginate / Rakefile
100644 72 lines (58 sloc) 1.867 kb
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
require 'rubygems'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'spec/rake/spectask'
 
PLUGIN = "merb_paginate"
NAME = "merb_paginate"
GEM_VERSION = "0.0.2"
AUTHOR = "Nathan Herald"
EMAIL = "nathan@myobie.com"
HOMEPAGE = "http://github.com/myobie/merb_paginate"
SUMMARY = "A blatant rip-off of will_paginate to bring pagination to merb"
 
windows = (PLATFORM =~ /win32|cygwin/)
 
SUDO = windows ? "" : "sudo"
 
spec = Gem::Specification.new do |s|
  s.name = NAME
  s.version = GEM_VERSION
  s.platform = Gem::Platform::RUBY
  s.has_rdoc = true
  s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
  s.summary = SUMMARY
  s.description = s.summary
  s.author = AUTHOR
  s.email = EMAIL
  s.homepage = HOMEPAGE
  s.add_dependency("merb-core", ">=0.9")
  s.require_path = 'lib'
  s.autorequire = PLUGIN
  s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs}/**/*")
end
 
 
Rake::GemPackageTask.new(spec) do |pkg|
  pkg.gem_spec = spec
end
 
desc "Run :package and install resulting .gem"
task :install => [:package] do
  sh %{#{SUDO} gem install pkg/#{NAME}-#{GEM_VERSION} --no-rdoc --no-ri}
end
 
Rake::RDocTask.new do |rdoc|
      files = ['README', 'LICENSE',
               'lib/**/*.rb']
      rdoc.rdoc_files.add(files)
      rdoc.main = 'README'
      rdoc.title = 'Merb Helper Docs'
      rdoc.rdoc_dir = 'doc/rdoc'
      rdoc.options << '--line-numbers' << '--inline-source'
end
 
 
Spec::Rake::SpecTask.new do |t|
   t.warning = true
   t.spec_opts = ["--format", "specdoc", "--colour"]
   t.spec_files = Dir['spec/**/*_spec.rb'].sort
end
 
desc "Run all specs and generate an rcov report"
Spec::Rake::SpecTask.new('rcov') do |t|
  t.spec_files = FileList['spec/**/*_spec.rb']
  t.spec_opts = ["--format", "specdoc", "--colour"]
  t.rcov = true
  t.rcov_dir = 'coverage'
  t.rcov_opts = ['--exclude', 'gems', '--exclude', 'spec']
end