#!/usr/bin/env ruby require File.expand_path(File.dirname(__FILE__) + '/../lib/starting_blocks.rb') options = {} def display value end require 'starting_blocks-blinky' if ARGV.include? '--blinky' require 'starting_blocks-growl' if ARGV.include? '--growl' require 'starting_blocks-stopplicht' if ARGV.include? '--stopplicht' options[:verbose] = ARGV.include? '--verbose' options[:no_vendor] = ARGV.include?('--vendor') == false options[:use_bundler] = Dir['Gemfile'].count > 0 def run_all_specs options files = ['**/*_spec.rb*', '**/*_test.rb*', '**/test_*.rb*'].map do |d| Dir[d]. select { |f| File.file?(f) }. map { |x| File.expand_path(x) } end.flatten StartingBlocks::Runner.new(options).run_files files end if ARGV.include? '--watch' StartingBlocks::Watcher.start_watching Dir, options sleep elsif ARGV.include? '--off' StartingBlocks::Extensions::BlinkyLighting.turn_off! else results = run_all_specs options parsed_results = StartingBlocks::Publisher.result_parser.parse(results) success = parsed_results[:color] == :green exit success end