module Spectator

Constants

Config
VERSION

Public Instance Methods

config(overrides_hash = {}) click to toggle source
# File lib/spectator.rb, line 15
def config(overrides_hash = {})
  Config.new(default_config_hash.merge(env_config_hash).merge(overrides_hash))
end
default_config_hash() click to toggle source
# File lib/spectator.rb, line 28
def default_config_hash
  {
    rspec_command:   (File.exist?('.rspec') ? 'rspec' : 'spec'),
    spec_dir_regexp: 'spec',
    base_dir_regexp: 'app|lib|script',
    debug:           false,
  }
end
env_config_hash() click to toggle source
# File lib/spectator.rb, line 19
def env_config_hash
  config = {}
  config[:rspec_command]   = ENV['RSPEC_COMMAND']   if ENV['RSPEC_COMMAND']
  config[:spec_dir_regexp] = ENV['SPEC_DIR_REGEXP'] if ENV['SPEC_DIR_REGEXP']
  config[:base_dir_regexp] = ENV['BASE_DIR_REGEXP'] if ENV['BASE_DIR_REGEXP']
  config[:debug]           = ENV['SPECTATOR_DEBUG'] if ENV['SPECTATOR_DEBUG']
  config
end
run(*args, &block) click to toggle source
# File lib/spectator.rb, line 97
def run(*args, &block)
  Runner.new(*args, &block).run
end