class TestProf::RSpecStamp::Configuration

RSpecStamp configuration

Attributes

dry_run[RW]
ignore_files[RW]
tags[R]

Public Class Methods

new() click to toggle source
# File lib/test_prof/rspec_stamp.rb, line 16
def initialize
  @ignore_files = [%r{spec/support}]
  @dry_run = ENV["RSTAMP_DRY_RUN"] == "1"
  self.tags = ENV["RSTAMP"]
end

Public Instance Methods

dry_run?() click to toggle source
# File lib/test_prof/rspec_stamp.rb, line 22
def dry_run?
  @dry_run == true
end
tags=(val) click to toggle source
# File lib/test_prof/rspec_stamp.rb, line 26
def tags=(val)
  @tags = if val.is_a?(String)
    parse_tags(val)
  else
    val
  end
end

Private Instance Methods

parse_tags(str) click to toggle source
# File lib/test_prof/rspec_stamp.rb, line 36
def parse_tags(str)
  str.split(/\s*,\s*/).each_with_object([]) do |tag, acc|
    k, v = tag.split(":")
    acc << if v.nil?
      k.to_sym
    else
      {k.to_sym => v.to_sym}
    end
  end
end