Class: Guard::RSpecFormatterResultsPath

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/rspec_formatter_results_path.rb

Overview

Just a wrapper class for the results file filename

Constant Summary collapse

WIKI_ENV_WARN_URL =
"https://github.com/guard/guard-rspec/wiki/Warning:-no-environment".
freeze
NO_ENV_WARNING_MSG =
"no environment passed - see #{WIKI_ENV_WARN_URL}".freeze
NO_RESULTS_VALUE_MSG =
":results_file value unknown (using defaults)".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRSpecFormatterResultsPath

Returns a new instance of RSpecFormatterResultsPath.



18
19
20
21
22
23
24
25
26
27
# File 'lib/guard/rspec_formatter_results_path.rb', line 18

def initialize
  path = ENV["GUARD_RSPEC_RESULTS_FILE"]
  if path.nil?
    STDERR.puts("Guard::RSpec: Warning: #{NO_ENV_WARNING_MSG}\n" \
                "Guard::RSpec: Warning: #{NO_RESULTS_VALUE_MSG}")
    path = RSpecDefaults::TEMPORARY_FILE_PATH
  end

  @path = File.expand_path(path)
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



16
17
18
# File 'lib/guard/rspec_formatter_results_path.rb', line 16

def path
  @path
end