Permalink
Newer
Older
100644 89 lines (68 sloc) 2.14 KB
1
using_git = File.exist?(File.expand_path('../.git/', __FILE__))
2
3
if using_git
4
require 'bundler'
5
require 'bundler/setup'
6
Bundler::GemHelper.install_tasks
7
end
9
require 'rake'
Jul 23, 2010
10
require "rspec/core/rake_task"
11
12
RSpec::Core::RakeTask.new(:spec) do |t|
13
t.verbose = false
14
t.skip_bundler = true unless using_git
15
t.rspec_opts = %w[--format progress] if (ENV['FULL_BUILD'] || !using_git)
16
end
Jul 23, 2010
17
18
desc "Run all examples using rcov"
19
RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
20
t.rcov = true
21
t.rcov_opts = %[-Ilib -Ispec --exclude "spec/*,gems/*,ping,basic_object" --text-report --sort coverage --aggregate coverage.data]
Jul 23, 2010
22
end
23
24
task :cleanup_rcov_files do
25
rm_rf 'coverage.data'
26
end
27
28
require 'cucumber/rake/task'
May 16, 2011
29
Cucumber::Rake::Task.new
31
task :default => [:spec, :cucumber]
32
33
namespace :ci do
34
desc "Sets things up for a ci build on travis-ci.org"
35
task :setup do
36
ENV['TRAVIS'] = 'true'
37
sh "git submodule init"
38
sh "git submodule update"
39
end
40
41
RSpec::Core::RakeTask.new(:spec) do |t|
42
t.verbose = true
43
t.rspec_opts = %w[--format progress --backtrace]
44
end
45
46
desc "Run a ci build"
47
task :build => [:setup, :spec]
48
end
49
50
def ensure_relish_doc_symlinked(filename)
Mar 2, 2011
51
from_filename = filename.dup
52
from_filename << '.md' unless filename =~ /\.md$/
53
from = File.expand_path("../features/#{from_filename}", __FILE__)
54
to = File.expand_path("../#{filename}", __FILE__)
55
56
if File.symlink?(from)
57
return if File.readlink(from) == to
58
59
# delete the old symlink
60
File.unlink(from)
61
end
62
63
FileUtils.ln_s to, from
64
end
65
66
desc "Push cukes to relishapp using the relish-client-gem"
67
task :relish do
68
%w[ README.md CHANGELOG.md LICENSE ].each do |file|
69
ensure_relish_doc_symlinked(file)
70
end
71
72
require 'vcr/version'
73
sh "relish versions:add myronmarston/vcr:#{VCR.version}" if ENV['NEW_RELISH_RELEASE']
74
sh "relish push vcr:#{VCR.version}"
77
task :prep_relish_release do
78
ENV['NEW_RELISH_RELEASE'] = 'true'
79
end
80
81
task :require_ruby_18 do
82
raise "This must be run on Ruby 1.8" unless RUBY_VERSION =~ /^1\.8/
83
end
84
85
task :release => [:require_ruby_18, :prep_relish_release, :relish]
87
# For gem-test: http://gem-testers.org/
88
task :test => :spec