class Coverfield::Config
A simple config store
Attributes
app_root[RW]
debug[RW]
include_paths[RW]
skip_summary[RW]
spec_dir[RW]
uncovered_only[RW]
Public Class Methods
new()
click to toggle source
Constructor
# File lib/coverfield/config.rb, line 11 def initialize @uncovered_only = false @skip_summary = false @debug = false @include_paths = [] @spec_dir = 'spec/' # Bundler already contains a good logic to determine the apps root require 'bundler' @app_root = Bundler.root.to_s end
Public Instance Methods
dump_config()
click to toggle source
Prints all options
# File lib/coverfield/config.rb, line 31 def dump_config puts 'Options:'.blue puts " Uncovered only: #{@uncovered_only}" puts " Skip summary: #{@skip_summary}" puts " Debug mode: #{@debug}" puts " Include paths: #{@include_paths}" puts " App root: #{@app_root}" puts " Spec directory: #{@spec_dir} (= #{spec_path})" puts puts end
spec_path()
click to toggle source
Returns the full absolute path to the spec dir
# File lib/coverfield/config.rb, line 25 def spec_path @app_root + '/' + @spec_dir end