Skip to content

Commit

Permalink
Improve full build output.
Browse files Browse the repository at this point in the history
  • Loading branch information
myronmarston committed Jan 16, 2011
1 parent 9c4a71c commit 5cdbba3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ Bundler::GemHelper.install_tasks
require 'rake'
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)
RSpec::Core::RakeTask.new(:spec) do |t|
t.verbose = false
t.rspec_opts = %w[--format progress] if ENV['FULL_BUILD']
end

desc "Run all examples using rcov"
RSpec::Core::RakeTask.new :rcov => :cleanup_rcov_files do |t|
Expand Down
42 changes: 35 additions & 7 deletions script/FullBuildRakeFile
Original file line number Diff line number Diff line change
@@ -1,19 +1,46 @@
# this is in a separate rakefile because our main one depends on the bundled gems
# already being installed. This must be able to run w/o bundled gems installed.

def rake(command = "")
sh "rake #{command} FULL_BUILD=true"
end

desc "Run a full build: install necessary gems with bundler, runs specs, run cukes"
task :build => :ensure_bundler_installed do
sh "bundle install"
sh "rake"
task :build => :bundle_install do
rake
end

desc "Install necessary gems with bundler and runs specs"
task :spec => :bundle_install do
rake "spec"
end

desc "Install necessary gems with bundler and runs cukes"
task :cucumber => :bundle_install do
rake "cucumber"
end

desc "Prints description of current ruby interpreter"
task :print_ruby_description do
description = if defined?(RUBY_DESCRIPTION)
RUBY_DESCRIPTION
else
# RUBY_DESCRIPTION is undefined on 1.8.6
"ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE} patchlevel #{RUBY_PATCHLEVEL}) [#{RUBY_PLATFORM}]"
end

puts
puts "=" * 80
puts "Using #{description}"
puts "=" * 80
puts
end

desc "Install necessary gems with bundler, runs specs, run cukes"
task :spec => :ensure_bundler_installed do
task :bundle_install => :ensure_bundler_installed do
sh "bundle install"
sh "rake spec"
end

task :ensure_bundler_installed do
task :ensure_bundler_installed => :print_ruby_description do
installed = begin
require 'rubygems'
require 'bundler'
Expand All @@ -26,3 +53,4 @@ task :ensure_bundler_installed do
sh "gem install bundler"
end
end

0 comments on commit 5cdbba3

Please sign in to comment.