forked from defunkt/ambition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
84 lines (71 loc) · 2.33 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
77
78
79
80
81
82
83
84
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
Version = '0.5.4'
module Rake::TaskManager
def delete_task(task_class, *args, &block)
task_name, deps = resolve_args(args)
@tasks.delete(task_class.scope_name(@scope, task_name).to_s)
end
end
class Rake::Task
def self.delete_task(args, &block) Rake.application.delete_task(self, args, &block) end
end
def delete_task(args, &block) Rake::Task.delete_task(args, &block) end
begin
require 'rubygems'
gem 'echoe', '>=2.7'
ENV['RUBY_FLAGS'] = ""
require 'echoe'
Echoe.new('ambition', Version) do |p|
p.project = 'err'
p.summary = "Ambition builds yer API calls from plain jane Ruby."
p.description = "Ambition builds yer API calls from plain jane Ruby."
p.url = "http://errtheblog.com/"
p.author = 'Chris Wanstrath'
p.email = "[email protected]"
p.ruby_version = '>= 1.8.6'
p.ignore_pattern = /^(\.git|site|adapters).+/
p.test_pattern = 'test/*_test.rb'
p.dependencies << 'ParseTree =2.1.1'
p.dependencies << 'ruby2ruby =1.1.8'
p.dependencies << 'rubigen =1.1.1'
end
rescue LoadError
puts "Not doing any of the Echoe gemmy stuff, because you don't have the specified gem versions"
end
delete_task :test
delete_task :install_gem
Rake::TestTask.new('test') do |t|
t.pattern = 'test/*_test.rb'
end
Rake::TestTask.new('test:adapters') do |t|
t.pattern = 'adapters/*/test/*_test.rb'
end
Dir['adapters/*'].each do |adapter|
adapter = adapter.split('/').last
Rake::TestTask.new("test:adapters:#{adapter.sub('ambitious_','')}") do |t|
t.pattern = "adapters/#{adapter}/test/*_test.rb"
end
end
desc 'Default: run unit tests.'
task :default => :test
desc 'Generate RDoc documentation'
Rake::RDocTask.new(:rdoc) do |rdoc|
files = ['README', 'LICENSE', 'lib/**/*.rb']
rdoc.rdoc_files.add(files)
rdoc.main = "README"
rdoc.title = "ambition"
# rdoc.template = File.exists?(t="/Users/chris/ruby/projects/err/rock/template.rb") ? t : "/var/www/rock/template.rb"
rdoc.rdoc_dir = 'doc'
rdoc.options << '--inline-source'
end
desc 'Generate coverage reports'
task :rcov do
`rcov -e gems test/*_test.rb`
puts 'Generated coverage reports.'
end
desc 'Install as a gem'
task :install_gem do
puts `rake manifest package && gem install pkg/ambition-#{Version}.gem`
end