forked from spreedly/spreedly-gem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
72 lines (56 loc) · 1.76 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
require 'hoe'
require './lib/spreedly/version.rb'
ENV["COPYFILE_DISABLE"] = "true" # Lose all the fugly ._ files when tar'ing
hoe = Hoe.spec('spreedly') do
developer('Nathaniel Talbott', '[email protected]')
self.rubyforge_name = 'terralien'
self.test_globs = ["test/**/*_test.rb"]
self.extra_deps << ["mechanize"]
self.extra_dev_deps << ["shoulda"]
end
def remove_task(*task_names)
task_names.each do |task_name|
Rake.application.instance_eval{@tasks.delete(task_name.to_s)}
end
end
def replace_task(task_name, *args, &block)
name = (task_name.is_a?(Hash) ? task_name.keys.first : task_name)
remove_task(name)
task(task_name, *args, &block)
end
remove_task :docs, 'doc/index.html'
Rake::RDocTask.new(:docs) do |rd|
rd.main = hoe.readme_file
rd.rdoc_dir = 'doc'
rd.rdoc_files += ['lib/spreedly.rb', 'lib/spreedly/common.rb', hoe.readme_file]
title = "Terralien's Spreedly Gem (#{hoe.version}) Documentation"
rd.options << "-t" << title << "-f" << "darkfish"
end
desc "Publish documentation."
replace_task :publish_docs => [:clean, :docs] do
host = "[email protected]"
remote_dir = "/var/www/terralien/www/shared/static/projects/spreedly-gem"
local_dir = 'doc'
sh %{rsync #{hoe.rsync_args} #{local_dir}/ #{host}:#{remote_dir}}
end
desc "Run tests with and without mocking."
replace_task :test do
ruby hoe.make_test_cmd
ENV["SPREEDLY_TEST"] = "REAL"
ruby hoe.make_test_cmd
end
desc "Run only mock tests."
task :test_mock do
ruby hoe.make_test_cmd
end
desc "Run only real tests."
task :test_real do
ENV["SPREEDLY_TEST"] = "REAL"
ruby hoe.make_test_cmd
end
desc "Run both sets of tests under multiruby"
replace_task :multi do
ruby hoe.make_test_cmd(:multi)
ENV["SPREEDLY_TEST"] = "REAL"
ruby hoe.make_test_cmd(:multi)
end