Sha256: 846fab35b1b07a1633de17309da69d3f926826674de4b7cf33e7defce6fe84ee

Contents?: true

Size: 1010 Bytes

Versions: 6

Compression:

Stored size: 1010 Bytes

Contents

require 'rake'
require 'bundler/gem_tasks'

desc 'Default: Run all specs.'
task :default => 'all:spec'

namespace :travis_ci do

  desc 'Things to do before Travis CI begins'
  task :prepare => :slimgems

  desc 'Install slimgems'
  task :slimgems do
    system('gem install slimgems')
  end

end

namespace :all do

  desc "Run specs on all spec apps"
  task :spec do
    success = true
    for_each_directory_of('spec/**/Rakefile') do |directory|
      env = "SPEC=../../#{ENV['SPEC']} " if ENV['SPEC']
      success &= system("cd #{directory} && #{env} bundle exec rake spec")
    end
    fail "Tests failed" unless success
  end

  desc "Bundle all spec apps"
  task :bundle do
    for_each_directory_of('spec/**/Gemfile') do |directory|
      system("cd #{directory} && bundle install")
    end
  end

end

def for_each_directory_of(path, &block)
  Dir[path].sort.each do |rakefile|
    directory = File.dirname(rakefile)
    puts '', "\033[44m#{directory}\033[0m", ''
    block.call(directory)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
consul-0.11.0 Rakefile
consul-0.10.2 Rakefile
consul-0.10.1 Rakefile
consul-0.10.0 Rakefile
consul-0.9.1 Rakefile
consul-0.9.0 Rakefile