Skip to content
Newer
Older
100644 80 lines (65 sloc) 2.08 KB
a595b8a @ffmike prawn 0.4.1 bits
authored
1 require 'rubygems'
2 require 'rake'
3 require 'rake/testtask'
4 require "rake/rdoctask"
5 require "rake/gempackagetask"
6
7 PRAWN_VERSION = "0.4.1"
8
9 task :default => [:test]
10
11 desc "Run all tests, test-spec and mocha required"
12 Rake::TestTask.new do |test|
13 test.libs << "spec"
14 test.test_files = Dir[ "spec/*_spec.rb" ]
15 test.verbose = true
16 end
17
18 desc "Show library's code statistics"
19 task :stats do
20 require 'code_statistics'
21 CodeStatistics.new( ["Prawn", "lib"],
22 ["Specs", "spec"] ).to_s
23 end
24
25 desc "genrates documentation"
26 Rake::RDocTask.new do |rdoc|
27 rdoc.rdoc_files.include( "README",
28 "COPYING",
29 "LICENSE",
30 "HACKING", "lib/" )
31 rdoc.main = "README"
32 rdoc.rdoc_dir = "doc/html"
33 rdoc.title = "Prawn Documentation"
34 end
35
36 desc "run all examples, and then diff them against reference PDFs"
37 task :examples do
38 mkdir_p "output"
39 examples = Dir["examples/**/*.rb"]
40 t = Time.now
41 puts "Running Examples"
42 examples.each { |file| `ruby -Ilib #{file}` }
43 puts "Ran in #{Time.now - t} s"
44 `mv *.pdf output`
45 end
46
47 spec = Gem::Specification.new do |spec|
48 spec.name = "prawn"
49 spec.version = PRAWN_VERSION
50 spec.platform = Gem::Platform::RUBY
51 spec.summary = "A fast and nimble PDF generator for Ruby"
52 spec.files = Dir.glob("{examples,lib,spec,vendor,data}/**/**/*") +
53 ["Rakefile"]
54 spec.require_path = "lib"
55
56 spec.add_dependency('prawn-layout')
57
58 spec.test_files = Dir[ "test/*_test.rb" ]
59 spec.has_rdoc = true
60 spec.extra_rdoc_files = %w{README LICENSE COPYING}
61 spec.rdoc_options << '--title' << 'Prawn Documentation' <<
62 '--main' << 'README' << '-q'
63 spec.author = "Gregory Brown"
64 spec.email = " gregory.t.brown@gmail.com"
65 spec.rubyforge_project = "prawn"
66 spec.homepage = "http://prawn.majesticseacreature.com"
67 spec.description = <<END_DESC
68 Prawn is a fast, tiny, and nimble PDF generator for Ruby
69 END_DESC
70 end
71
72 Rake::GemPackageTask.new(spec) do |pkg|
73 pkg.need_zip = true
74 pkg.need_tar = true
75 end
76
77
78
79
Something went wrong with that request. Please try again.