-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRakefile
53 lines (44 loc) · 1.23 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
require 'bundler'
Bundler.setup
Bundler::GemHelper.install_tasks
desc "Load a console"
task :console do
ENV['EARTH_ENV'] ||= 'test'
require 'earth'
DataMiner.logger = ActiveRecord::Base.logger = Logger.new('log/test.log')
DataMiner.unit_converter = :conversions
Earth.init :all, :connect => true
require 'irb'
ARGV.clear
IRB.start
end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:examples) do |c|
if ENV['RSPEC_FORMAT']
c.rspec_opts = "-Ispec --format #{ENV['RSPEC_FORMAT']}"
else
c.rspec_opts = '-Ispec'
end
end
if RUBY_VERSION =~ /^1\.8/
desc "Run specs with RCov"
RSpec::Core::RakeTask.new(:examples_with_coverage) do |t|
t.rcov = true
t.rcov_opts = ['--exclude', 'spec']
t.rspec_opts = '-Ispec'
end
end
desc "Run tests with RSpec - see spec/spec_helper for configuration options e.g. data sanity-checking"
task :test => :examples
task :default => :test
require 'earth/version'
require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "earth #{Earth::VERSION}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
ENV['DATABASE_URL'] ||= 'mysql2://root:password@localhost/test_earth'
require 'earth/tasks'
Earth::Tasks.new