sam / do fork watch download tarball
public
Rubygem
Description: DataObjects
Homepage: http://rubyforge.org/projects/dorb
Clone URL: git://github.com/sam/do.git
do / do_postgres / Rakefile
100644 84 lines (64 sloc) 2.374 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
73
74
75
76
77
78
79
80
81
82
83
84
require 'rubygems'
require 'spec/rake/spectask'
require 'pathname'
 
ROOT = Pathname(__FILE__).dirname.expand_path
 
require "lib/do_postgres/version"
 
JRUBY = (RUBY_PLATFORM =~ /java/) rescue nil
WINDOWS = (RUBY_PLATFORM =~ /mswin|mingw|cygwin/) rescue nil
          # don't use SUDO with JRuby, for the moment, although this behaviour
          # is not entirely correct.
SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
 
AUTHOR = "Bernerd Schaefer"
EMAIL = "bj.schaefer@gmail.com"
GEM_NAME = "do_postgres"
GEM_VERSION = DataObjects::Postgres::VERSION
GEM_DEPENDENCIES = [["data_objects", GEM_VERSION]]
GEM_CLEAN = ['**/*.{o,so,bundle,log,a,gem,dSYM,obj,pdb,lib,def,exp,DS_Store}', 'ext/Makefile']
GEM_EXTRAS = { :extensions => %w[ ext/extconf.rb ], :has_rdoc => false }
 
PROJECT_NAME = "dorb"
PROJECT_URL = "http://rubyforge.org/projects/dorb"
PROJECT_DESCRIPTION = PROJECT_SUMMARY = "A DataObject.rb driver for MySQL"
 
DRIVER = true
 
require ROOT.parent + 'tasks/hoe'
 
# Installation
 
task :install => [ :package ] do
  sh %{#{SUDO} gem install --local pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources}, :verbose => false
end
 
desc "Uninstall #{GEM_NAME} #{GEM_VERSION} (default ruby)"
task :uninstall => [ :clobber ] do
  sh "#{SUDO} gem uninstall #{GEM_NAME} -v#{GEM_VERSION} -I -x", :verbose => false
end
 
desc 'Run specifications'
Spec::Rake::SpecTask.new(:spec) do |t|
  t.spec_opts << '--format' << 'specdoc' << '--colour'
  t.spec_opts << '--loadby' << 'random'
  t.spec_files = Pathname.glob(ENV['FILES'] || 'spec/**/*_spec.rb')
 
  begin
    t.rcov = ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true
    t.rcov_opts << '--exclude' << 'spec'
    t.rcov_opts << '--text-summary'
    t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
  rescue Exception
    # rcov not installed
  end
end
 
namespace :ci do
 
  task :prepare do
    rm_rf ROOT + "ci"
    mkdir_p ROOT + "ci"
    mkdir_p ROOT + "ci/doc"
    mkdir_p ROOT + "ci/cyclomatic"
    mkdir_p ROOT + "ci/token"
  end
 
  task :publish do
    out = ENV['CC_BUILD_ARTIFACTS'] || "out"
    mkdir_p out unless File.directory? out
 
    mv "ci/rspec_report.html", "#{out}/rspec_report.html"
    mv "ci/coverage", "#{out}/coverage"
  end
 
  task :spec => :prepare do
    Rake::Task[:spec].invoke
    mv ROOT + "coverage", ROOT + "ci/coverage"
  end
 
end
 
task :ci => ["ci:spec"]