forked from email-spec/email-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
70 lines (60 loc) · 2.18 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
require 'rubygems'
require 'bundler/setup'
require 'rspec/core/rake_task'
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = "email_spec"
s.platform = Gem::Platform::RUBY
s.authors = ['Ben Mabey', 'Aaron Gibralter', 'Mischa Fierer']
s.email = "[email protected]"
s.homepage = "http://github.com/bmabey/email-spec/"
s.summary = "Easily test email in rspec and cucumber"
s.bindir = "bin"
s.description = s.summary
s.require_path = "lib"
s.files = %w(History.txt install.rb MIT-LICENSE.txt README.rdoc Rakefile) + Dir["lib/**/*"] + Dir["rails_generators/**/*"]
s.test_files = Dir["spec/**/*"] + Dir["examples/**/*"]
# rdoc
s.has_rdoc = true
s.extra_rdoc_files = %w(README.rdoc MIT-LICENSE.txt)
s.rubyforge_project = 'email-spec'
s.add_runtime_dependency "rspec", "~> 2.0"
end
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
begin
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)
rescue LoadError
task :features do
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
end
end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new
namespace :example_app do
RSpec::Core::RakeTask.new do |spec|
desc "Specs for Example app"
spec.pattern = './examples/rails3_root/spec/**/*_spec.rb'
end
end
task :default => [:features, :spec, 'example_app:spec']
desc "Cleans the project of any tmp file that should not be included in the gemspec."
task :clean do
#remove stuff from example rails apps
FileUtils.rm_rf("examples/rails_root")
FileUtils.rm_rf("examples/sinatra")
%w[ rails3 sinatra ].each do |ver|
FileUtils.rm_f("examples/#{ver}_root/features/step_definitions/email_steps.rb")
FileUtils.rm_f("examples/#{ver}_root/rerun.txt")
FileUtils.rm_rf("examples/#{ver}_root/log")
FileUtils.rm_rf("examples/#{ver}_root/vendor")
end
%w[*.sqlite3 *.log].each do |pattern|
`find . -name "#{pattern}" -delete`
end
end
desc "Cleans the dir and builds the gem"
task :prep => [:clean, :gemspec, :build]