Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 89 lines (68 sloc) 2.189 kB
beb9ea0 @myronmarston Allow specs to run when the code is not checked out through git.
authored
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
e57ae60 @myronmarston Updated Gemfile/gemspec/Rakefile, etc to use latest best practices ba…
authored
8
d2577f7 @myronmarston Initial commit to vcr.
authored
9 require 'rake'
f05cc59 @myronmarston Upgrade to rspec-2.
authored
10 require "rspec/core/rake_task"
d2577f7 @myronmarston Initial commit to vcr.
authored
11
5cdbba3 @myronmarston Improve full build output.
authored
12 RSpec::Core::RakeTask.new(:spec) do |t|
13 t.verbose = false
beb9ea0 @myronmarston Allow specs to run when the code is not checked out through git.
authored
14 t.skip_bundler = true unless using_git
15 t.rspec_opts = %w[--format progress] if (ENV['FULL_BUILD'] || !using_git)
5cdbba3 @myronmarston Improve full build output.
authored
16 end
f05cc59 @myronmarston Upgrade to rspec-2.
authored
17
18 desc "Run all examples using rcov"
19 RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
20 t.rcov = true
d912938 @myronmarston Exclude ping.rb and basic_object.rb from rcov code coverage report.
authored
21 t.rcov_opts = %[-Ilib -Ispec --exclude "spec/*,gems/*,ping,basic_object" --text-report --sort coverage --aggregate coverage.data]
f05cc59 @myronmarston Upgrade to rspec-2.
authored
22 end
23
24 task :cleanup_rcov_files do
25 rm_rf 'coverage.data'
d2577f7 @myronmarston Initial commit to vcr.
authored
26 end
27
53d1f7d @myronmarston Remove unnecessary cucumber LoadError rescue.
authored
28 require 'cucumber/rake/task'
48ea1e7 @myronmarston Run all cukes on CI.
authored
29 Cucumber::Rake::Task.new
7a12870 @myronmarston Remove old cukes. I'm going to rewrite them in a documentation style.
authored
30
4531950 @myronmarston Removed old cucumber rake tasks.
authored
31 task :default => [:spec, :cucumber]
d2577f7 @myronmarston Initial commit to vcr.
authored
32
2e37007 @myronmarston Setup build for travis-ci.org.
authored
33 namespace :ci do
34 desc "Sets things up for a ci build on travis-ci.org"
35 task :setup do
364ea9e @myronmarston Don't run em-http-request tests on travis on 1.8.6.
authored
36 ENV['TRAVIS'] = 'true'
2e37007 @myronmarston Setup build for travis-ci.org.
authored
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"
9e75d28 @myronmarston Remove cukes from travis build.
authored
47 task :build => [:setup, :spec]
2e37007 @myronmarston Setup build for travis-ci.org.
authored
48 end
49
284494f @myronmarston Add readme, changelog and license to relish docs.
authored
50 def ensure_relish_doc_symlinked(filename)
5bd3bff @myronmarston Fixes for relish.
authored
51 from_filename = filename.dup
52 from_filename << '.md' unless filename =~ /\.md$/
53 from = File.expand_path("../features/#{from_filename}", __FILE__)
284494f @myronmarston Add readme, changelog and license to relish docs.
authored
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
a7e9528 @myronmarston Add relish task that runs as part of release.
authored
66 desc "Push cukes to relishapp using the relish-client-gem"
67 task :relish do
284494f @myronmarston Add readme, changelog and license to relish docs.
authored
68 %w[ README.md CHANGELOG.md LICENSE ].each do |file|
69 ensure_relish_doc_symlinked(file)
70 end
71
84992d2 @myronmarston Updated relish task to push a version.
authored
72 require 'vcr/version'
4db3d6e @myronmarston Allow relish docs to be re-pushed when I run "rake relish".
authored
73 sh "relish versions:add myronmarston/vcr:#{VCR.version}" if ENV['NEW_RELISH_RELEASE']
84992d2 @myronmarston Updated relish task to push a version.
authored
74 sh "relish push vcr:#{VCR.version}"
a7e9528 @myronmarston Add relish task that runs as part of release.
authored
75 end
76
4db3d6e @myronmarston Allow relish docs to be re-pushed when I run "rake relish".
authored
77 task :prep_relish_release do
78 ENV['NEW_RELISH_RELEASE'] = 'true'
79 end
80
c0141b0 @myronmarston Prevent releases on 1.9 as that leads to weird psych/syck errors in t…
authored
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]
a7e9528 @myronmarston Add relish task that runs as part of release.
authored
86
1aa5b6d @myronmarston Add support for gem-testers.org.
authored
87 # For gem-test: http://gem-testers.org/
88 task :test => :spec
Something went wrong with that request. Please try again.