root/plugins/merb_helpers/Rakefile

Revision 1232, 1.8 kB (checked in by wyca..@gmail.com, 11 months ago)

Plugins now require Merb 0.5

Line 
1 require 'rubygems'
2 require 'rake/gempackagetask'
3 require 'rake/rdoctask'
4 require 'spec/rake/spectask'
5
6 PLUGIN = "merb_helpers"
7 NAME = "merb_helpers"
8 GEM_VERSION = "0.5"
9 AUTHOR = "Yehuda Katz"
10 EMAIL = "wycats@gmail.com"
11 HOMEPAGE = "http://merb.rubyforge.org/"
12 SUMMARY = "Helper support for merb (similar to the Rails form helpers)"
13
14 windows = (PLATFORM =~ /win32|cygwin/)
15
16 SUDO = windows ? "" : "sudo"
17
18 spec = Gem::Specification.new do |s|
19   s.name = NAME
20   s.version = GEM_VERSION
21   s.platform = Gem::Platform::RUBY
22   s.has_rdoc = true
23   s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
24   s.summary = SUMMARY
25   s.description = s.summary
26   s.author = AUTHOR
27   s.email = EMAIL
28   s.homepage = HOMEPAGE
29   s.add_dependency("merb", ">=0.5")
30   s.require_path = 'lib'
31   s.autorequire = PLUGIN
32   s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs}/**/*")
33 end
34
35
36 Rake::GemPackageTask.new(spec) do |pkg|
37   pkg.gem_spec = spec
38 end
39
40 desc "Run :package and install resulting .gem"
41 task :install => [:package] do
42   sh %{#{SUDO} gem install pkg/#{NAME}-#{GEM_VERSION} --no-rdoc --no-ri}
43 end
44
45 Rake::RDocTask.new do |rdoc|
46       files = ['README', 'LICENSE',
47                'lib/**/*.rb']
48       rdoc.rdoc_files.add(files)
49       rdoc.main = 'README'
50       rdoc.title = 'Merb Helper Docs'
51       rdoc.rdoc_dir = 'doc/rdoc'
52       rdoc.options << '--line-numbers' << '--inline-source'
53 end
54
55
56 Spec::Rake::SpecTask.new do |t|
57    t.warning = true
58    t.spec_opts = ["--format", "specdoc", "--colour"]
59    t.spec_files = Dir['spec/**/*_spec.rb'].sort   
60 end
61
62 desc "Run all specs and generate an rcov report"
63 Spec::Rake::SpecTask.new('rcov') do |t|
64   t.spec_files = FileList['spec/**/*_spec.rb']
65   t.spec_opts = ["--format", "specdoc", "--colour"]
66   t.rcov = true
67   t.rcov_dir = 'coverage'
68   t.rcov_opts = ['--exclude', 'gems', '--exclude', 'spec']
69 end
70
71
Note: See TracBrowser for help on using the browser.