forked from travisjeffery/timecop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
55 lines (49 loc) · 1.86 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
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
gem 'jeweler', '~> 1.3.0'
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = "timecop"
s.rubyforge_project = 'johntrupiano' # if different than lowercase project name
s.description = %q(A gem providing "time travel" and "time freezing" capabilities, making it dead simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.)
s.summary = s.description # More details later??
s.email = "[email protected]"
s.homepage = "http://github.com/jtrupiano/timecop"
s.authors = ["John Trupiano"]
s.files = FileList["[A-Z]*", "{bin,lib,test}/**/*"]
end
Jeweler::GemcutterTasks.new
Jeweler::RubyforgeTasks.new do |rubyforge|
rubyforge.doc_task = "rdoc"
rubyforge.remote_doc_path = "timecop"
end
rescue LoadError
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
# Override the test task and instruct them how to actually run the tests.
Rake.application.send(:eval, "@tasks.delete('test')")
desc "Does not execute tests. Manually run shell script ./run_tests.sh to execute tests."
task :test do
puts <<-MSG
In order to run the test suite, run: cd test && ./run_tests.sh
The tests need to be run with different libraries loaded, which rules out using Rake
to automate them.
MSG
end
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
if File.exist?('VERSION')
version = File.read('VERSION')
else
version = ""
end
rdoc.rdoc_dir = 'rdoc'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.title = "timecop #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('History.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end
task :default => :test