Class: TestDiff::Config
- Inherits:
-
Object
- Object
- TestDiff::Config
- Includes:
- Singleton
- Defined in:
- lib/test_diff/config.rb
Overview
Holds all the configuration details
Instance Attribute Summary collapse
-
#current_tracking_filename ⇒ Object
Returns the value of attribute current_tracking_filename.
-
#map_subfolder ⇒ Object
Returns the value of attribute map_subfolder.
- #storage ⇒ Object
-
#test_pattern ⇒ Object
Returns the value of attribute test_pattern.
- #test_runner ⇒ Object
- #version_control ⇒ Object
-
#working_directory ⇒ Object
Returns the value of attribute working_directory.
Class Method Summary collapse
Instance Method Summary collapse
- #current_tracking_file ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #map_folder ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
12 13 14 15 16 17 |
# File 'lib/test_diff/config.rb', line 12 def initialize self.working_directory = '.' self.map_subfolder = 'test_diff_coverage' self.current_tracking_filename = 'sha' self.test_pattern = /spec.rb\z/ end |
Instance Attribute Details
#current_tracking_filename ⇒ Object
Returns the value of attribute current_tracking_filename.
7 8 9 |
# File 'lib/test_diff/config.rb', line 7 def current_tracking_filename @current_tracking_filename end |
#map_subfolder ⇒ Object
Returns the value of attribute map_subfolder.
7 8 9 |
# File 'lib/test_diff/config.rb', line 7 def map_subfolder @map_subfolder end |
#storage ⇒ Object
24 25 26 |
# File 'lib/test_diff/config.rb', line 24 def storage @storage ||= Storage.new(map_folder) end |
#test_pattern ⇒ Object
Returns the value of attribute test_pattern.
7 8 9 |
# File 'lib/test_diff/config.rb', line 7 def test_pattern @test_pattern end |
#test_runner ⇒ Object
28 29 30 |
# File 'lib/test_diff/config.rb', line 28 def test_runner @test_runner ||= TestRunner::Rspec.new end |
#version_control ⇒ Object
19 20 21 22 |
# File 'lib/test_diff/config.rb', line 19 def version_control @version_control ||= VersionControl::Git.new(working_directory, File.read(current_tracking_file)) end |
#working_directory ⇒ Object
Returns the value of attribute working_directory.
7 8 9 |
# File 'lib/test_diff/config.rb', line 7 def working_directory @working_directory end |
Class Method Details
.method_missing(method, *args) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/test_diff/config.rb', line 40 def self.method_missing(method, *args) if instance.respond_to?(method) instance.send(method, *args) else super end end |
Instance Method Details
#current_tracking_file ⇒ Object
36 37 38 |
# File 'lib/test_diff/config.rb', line 36 def current_tracking_file "#{map_folder}/#{current_tracking_filename}" end |
#map_folder ⇒ Object
32 33 34 |
# File 'lib/test_diff/config.rb', line 32 def map_folder "#{working_directory}/#{map_subfolder}" end |