From 5cdbba38f83c54607ffba983f2d46547eb25dbbd Mon Sep 17 00:00:00 2001 From: Myron Marston Date: Sun, 16 Jan 2011 10:29:10 -0800 Subject: [PATCH] Improve full build output. --- Rakefile | 5 ++++- script/FullBuildRakeFile | 42 +++++++++++++++++++++++++++++++++------- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/Rakefile b/Rakefile index b7addc8c..b6d728ff 100644 --- a/Rakefile +++ b/Rakefile @@ -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| diff --git a/script/FullBuildRakeFile b/script/FullBuildRakeFile index 38c54c83..d441fb16 100644 --- a/script/FullBuildRakeFile +++ b/script/FullBuildRakeFile @@ -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' @@ -26,3 +53,4 @@ task :ensure_bundler_installed do sh "gem install bundler" end end +