| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Ruport-util
Revision: 43
Author: sandal
Date: 08 Feb 2008 18:19:19
Changes:0.13.0 release
Files:| ... | ...@@ -0,0 +1,25 @@ | |
| 1 | module Ruport | |
| 2 | module Util | |
| 3 | VERSION = "0.32.0" | |
| 4 | ||
| 5 | file = __FILE__ | |
| 6 | file = File.readlink(file) if File.symlink?(file) | |
| 7 | dir = File.dirname(file) | |
| 8 | BASEDIR = File.expand_path(File.join(dir, '..', '..')) | |
| 9 | LIBDIR = File.expand_path(File.join(dir, '..')) | |
| 10 | end | |
| 11 | end | |
| 12 | ||
| 13 | require "ruport/util/report" | |
| 14 | require "ruport/util/graph" | |
| 15 | require "ruport/util/invoice" | |
| 16 | require "ruport/util/report_manager" | |
| 17 | require "ruport/util/mailer" | |
| 18 | require "ruport/util/bench" | |
| 19 | require "ruport/util/generator" | |
| 20 | require "ruport/util/pdf/form" | |
| 21 | require "ruport/util/ods" | |
| 22 | require "ruport/util/query" | |
| 23 | require "ruport/util/xls" | |
| 24 | require "ruport/util/ods_table" | |
| 25 | require "ruport/util/xls_table" |
| ... | ...@@ -0,0 +1,124 @@ | |
| 1 | begin | |
| 2 | require "rubygems" | |
| 3 | rescue LoadError | |
| 4 | nil | |
| 5 | end | |
| 6 | ||
| 7 | require 'rake' | |
| 8 | require "rake/rdoctask" | |
| 9 | require "rake/gempackagetask" | |
| 10 | ||
| 11 | require 'spec/rake/spectask' | |
| 12 | ||
| 13 | task :default => [:test] | |
| 14 | ||
| 15 | desc "Run all tests" | |
| 16 | Spec::Rake::SpecTask.new('test') do |t| | |
| 17 | t.spec_files = FileList['test/test_*.rb'] | |
| 18 | end | |
| 19 | ||
| 20 | desc "Generate specdocs for examples for inclusion in RDoc" | |
| 21 | Spec::Rake::SpecTask.new('specdoc') do |t| | |
| 22 | t.spec_files = FileList['test/test_*.rb'] | |
| 23 | t.spec_opts = ["--format", "rdoc"] | |
| 24 | t.out = 'EXAMPLES.rd' | |
| 25 | end | |
| 26 | ||
| 27 | desc "Generate HTML report for failing examples" | |
| 28 | Spec::Rake::SpecTask.new('failing_examples_with_html') do |t| | |
| 29 | t.spec_files = FileList['test/test_*.rb'] | |
| 30 | t.spec_opts = ["--format", "html:failing_examples.html", "--diff"] | |
| 31 | t.fail_on_error = false | |
| 32 | end | |
| 33 | ||
| 34 | spec = Gem::Specification.new do |spec| | |
| 35 | spec.name = "ruport-util" | |
| 36 | spec.version = "0.13.0" | |
| 37 | spec.platform = Gem::Platform::RUBY | |
| 38 | spec.summary = "A set of tools and helper libs for Ruby Reports" | |
| 39 | spec.files = Dir.glob("{example,lib,test,bin}/**/**/*") + | |
| 40 | ["Rakefile"] | |
| 41 | ||
| 42 | spec.require_path = "lib" | |
| 43 | ||
| 44 | spec.test_files = Dir[ "test/test_*.rb" ] | |
| 45 | spec.bindir = "bin" | |
| 46 | spec.executables = FileList["rope", "csv2ods"] | |
| 47 | spec.has_rdoc = true | |
| 48 | spec.extra_rdoc_files = %w{INSTALL} | |
| 49 | spec.rdoc_options << '--title' << 'ruport-util Documentation' << | |
| 50 | '--main' << 'INSTALL' << '-q' | |
| 51 | spec.add_dependency('ruport', ">=1.2.3") | |
| 52 | spec.add_dependency('mailfactory',">=1.2.3") | |
| 53 | spec.add_dependency('rubyzip','>=0.9.1') | |
| 54 | spec.author = "Gregory Brown" | |
| 55 | spec.email = " gregory.t.brown@gmail.com" | |
| 56 | spec.rubyforge_project = "ruport" | |
| 57 | spec.homepage = "http://code.rubyreports.org" | |
| 58 | spec.description = <<END_DESC | |
| 59 | ruport-util provides a number of utilities and helper libs | |
| 60 | for Ruby Reports | |
| 61 | END_DESC | |
| 62 | end | |
| 63 | ||
| 64 | Rake::RDocTask.new do |rdoc| | |
| 65 | rdoc.rdoc_files.include( "COPYING", "INSTALL", | |
| 66 | "LICENSE", "lib/" ) | |
| 67 | rdoc.main = "INSTALL" | |
| 68 | rdoc.rdoc_dir = "doc/html" | |
| 69 | rdoc.title = "Ruport Documentation" | |
| 70 | end | |
| 71 | ||
| 72 | Rake::GemPackageTask.new(spec) do |pkg| | |
| 73 | pkg.need_zip = true | |
| 74 | pkg.need_tar = true | |
| 75 | end | |
| 76 | ||
| 77 | begin | |
| 78 | require 'rcov/rcovtask' | |
| 79 | Rcov::RcovTask.new do |t| | |
| 80 | t.test_files = Dir[ "test/test_*.rb" ] | |
| 81 | end | |
| 82 | rescue LoadError | |
| 83 | nil | |
| 84 | end | |
| 85 | ||
| 86 | ## RSpec Wrapper | |
| 87 | ||
| 88 | require 'test/helper/layout' | |
| 89 | ||
| 90 | class String | |
| 91 | def /(obj) | |
| 92 | File.join(self, obj.to_s) | |
| 93 | end | |
| 94 | end | |
| 95 | ||
| 96 | SPEC_BASE = File.expand_path('test') | |
| 97 | ||
| 98 | # ignore files with these paths | |
| 99 | ignores = [ './helper/*', './helper.rb' ] | |
| 100 | ||
| 101 | files = Dir[SPEC_BASE/'**'/'*.rb'] | |
| 102 | ignores.each do |ignore| | |
| 103 | ignore_files = Dir[SPEC_BASE/ignore] | |
| 104 | ignore_files.each do |ignore_file| | |
| 105 | files.delete File.expand_path(ignore_file) | |
| 106 | end | |
| 107 | end | |
| 108 | ||
| 109 | files.sort! | |
| 110 | ||
| 111 | spec_layout = Hash.new{|h,k| h[k] = []} | |
| 112 | ||
| 113 | files.each do |file| | |
| 114 | name = file.gsub(/^#{SPEC_BASE}/, '.') | |
| 115 | dir_name = File.dirname(name)[2..-1] || './' | |
| 116 | task_name = 'wrap' + ([:test] + dir_name.split('/')).join(':') | |
| 117 | spec_layout[task_name] << file | |
| 118 | end | |
| 119 | ||
| 120 | desc "Test all" | |
| 121 | task "wraptest" => [] do | |
| 122 | wrap = SpecWrap.new(*spec_layout.values.flatten) | |
| 123 | wrap.run | |
| 124 | end |