This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
forked from peburrows/mongo_db_logger
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Rakefile
76 lines (66 loc) · 2.13 KB
/
Rakefile
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
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rubygems'
require 'bundler'
require 'jeweler'
desc 'Default: run unit tests.'
task :default => "test:units"
task :test => "test:functionals"
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
Jeweler::Tasks.new do |gem|
gem.name = "central_logger"
gem.summary = %Q{Central Logger for Rails}
gem.description = %Q{Centralized logging for rails apps using MongoDB. The idea and the core code is from http://github.com/peburrows/central_logger}
gem.email = "[email protected]"
gem.homepage = "http://github.com/customink/central_logger"
gem.authors = ["Phil Burrows", "Alex Stupka"]
gem.files.exclude 'test/rails/**/*'
gem.test_files.exclude 'test/rails/**/*'
end
# dependencies defined in Gemfile
def rake_functionals(opts=nil)
if ENV['RUBYOPT']
# remove bundler/setup require that prematurely checks for gems and crashes
ENV['RUBYOPT'] = ENV['RUBYOPT'].gsub(%r{-r\s*bundler/setup}, '')
end
# runs all the tests for each ruby version in each rails dir
system("bash test/test.sh #{opts}")
end
namespace :test do
desc "Run all tests against all permutations of ruby and rails"
task :functionals do
rake_functionals
end
namespace :functionals do
desc "Clean out gemsets before running functional tests."
task :clean do
rake_functionals('--clean')
end
end
desc "Run unit tests"
Rake::TestTask.new(:units) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/unit/central_logger_test.rb'
test.verbose = true
end
desc "Run replica set tests"
Rake::TestTask.new(:replica_set) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/unit/central_logger_replica_test.rb'
test.verbose = true
end
end
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "central_logger #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end