Sha256: 6b8fefbd2fed47667770b692411f8fdd878b91af6e96861368af2caa13c5adca

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 KB

Contents

#!/usr/bin/env ruby

require File.expand_path(File.dirname(__FILE__) + '/../lib/starting_blocks.rb')

options = {}

def display value
end

arguments = ARGV
config_file = File.expand_path('~/.sb')

if File.exists?(config_file)
  additional_arguments = File.read(config_file).split(' ')
  arguments += additional_arguments
end

require 'starting_blocks-blinky' if arguments.include? '--blinky'
require 'starting_blocks-growl' if arguments.include? '--growl'
require 'starting_blocks-stopplicht' if arguments.include? '--stopplicht'

StartingBlocks.verbose = arguments.include? '--verbose'
options[:no_vendor]   = arguments.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 arguments.include? '--watch'
  StartingBlocks::Watcher.start_watching Dir, options
  sleep
elsif arguments.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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
starting_blocks-0.5.1 bin/sb