forked from pezra/resourceful
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Rakefile
91 lines (76 loc) · 2.63 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
85
86
87
88
89
90
91
require 'rubygems'
require 'rake'
require './lib/resourceful'
begin
require 'echoe'
Echoe.new('resourceful', Resourceful::VERSION) do |p|
p.description = "An HTTP library for Ruby that takes advantage of everything HTTP has to offer."
p.url = "http://github.com/paul/resourceful"
p.author = "Paul Sadauskas"
p.email = "[email protected]"
p.ignore_pattern = ["pkg/*", "tmp/*"]
p.dependencies = [['addressable', '>= 2.1.0'], 'httpauth', ['options', '>= 2.1.1']]
p.development_dependencies = ['thin', 'yard', 'sinatra', 'rspec']
p.retain_gemspec = true
end
rescue LoadError => e
puts "install 'echoe' gem to be able to build the gem"
end
require 'spec/rake/spectask'
desc 'Run all acceptance specs'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.libs << 'lib'
t.spec_files = FileList['spec/**/*_spec.rb']
end
namespace :spec do
desc 'Run all acceptance specs'
Spec::Rake::SpecTask.new(:acceptance) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.libs << 'lib'
t.spec_files = FileList['spec/acceptance/*_spec.rb']
end
desc 'Run all unit specs'
Spec::Rake::SpecTask.new(:unit) do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.libs << 'lib'
t.spec_files = FileList['spec/**/*_spec.rb'] - (FileList['spec/acceptance/*_spec.rb'] + FileList['spec/simple_sinatra_server_spec.rb'] )
end
desc 'Run the specs for the server'
Spec::Rake::SpecTask.new('server') do |t|
t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
t.libs << 'lib'
t.spec_files = FileList['spec/simple_sinatra_server_spec.rb']
end
end
task :server do
begin
require './spec/simple_sinatra_server'
desc "Run the sinatra echo server, with loggin"
task :server do
Sinatra::Default.set(
:run => true,
:logging => true
)
end
rescue LoadError => e
puts "Install 'sinatra' gem to run the server"
end
end
desc 'Default: Run Specs'
task :default => :spec
desc 'Run all tests'
task :test => :spec
begin
require 'yard'
desc "Generate Yardoc"
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb', 'README.markdown']
end
rescue LoadError => e
puts "Install 'yard' gem to generate docs"
end
desc "Update rubyforge documentation"
task :update_docs => :yardoc do
puts %x{rsync -aPz doc/* [email protected]:/var/www/gforge-projects/resourceful/}
end