Class: Coverfield::Config
- Inherits:
-
Object
- Object
- Coverfield::Config
- Defined in:
- lib/coverfield/config.rb
Overview
A simple config store
Instance Attribute Summary collapse
-
#app_root ⇒ Object
Returns the value of attribute app_root.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#include_paths ⇒ Object
Returns the value of attribute include_paths.
-
#skip_summary ⇒ Object
Returns the value of attribute skip_summary.
-
#spec_dir ⇒ Object
Returns the value of attribute spec_dir.
-
#uncovered_only ⇒ Object
Returns the value of attribute uncovered_only.
Instance Method Summary collapse
-
#dump_config ⇒ Object
Prints all options.
-
#initialize ⇒ Config
constructor
Constructor.
-
#spec_path ⇒ Object
Returns the full absolute path to the spec dir.
Constructor Details
#initialize ⇒ Config
Constructor
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/coverfield/config.rb', line 11 public 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 |
Instance Attribute Details
#app_root ⇒ Object
Returns the value of attribute app_root.
3 4 5 |
# File 'lib/coverfield/config.rb', line 3 def app_root @app_root end |
#debug ⇒ Object
Returns the value of attribute debug.
3 4 5 |
# File 'lib/coverfield/config.rb', line 3 def debug @debug end |
#include_paths ⇒ Object
Returns the value of attribute include_paths.
3 4 5 |
# File 'lib/coverfield/config.rb', line 3 def include_paths @include_paths end |
#skip_summary ⇒ Object
Returns the value of attribute skip_summary.
3 4 5 |
# File 'lib/coverfield/config.rb', line 3 def skip_summary @skip_summary end |
#spec_dir ⇒ Object
Returns the value of attribute spec_dir.
3 4 5 |
# File 'lib/coverfield/config.rb', line 3 def spec_dir @spec_dir end |
#uncovered_only ⇒ Object
Returns the value of attribute uncovered_only.
3 4 5 |
# File 'lib/coverfield/config.rb', line 3 def uncovered_only @uncovered_only end |
Instance Method Details
#dump_config ⇒ Object
Prints all options
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/coverfield/config.rb', line 31 public 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 ⇒ Object
Returns the full absolute path to the spec dir
25 26 27 |
# File 'lib/coverfield/config.rb', line 25 public def spec_path @app_root + '/' + @spec_dir end |