Class: AffectedTests::Configuration
- Inherits:
-
Object
- Object
- AffectedTests::Configuration
- Defined in:
- lib/affected_tests.rb
Instance Attribute Summary collapse
-
#bundler_path ⇒ Object
readonly
Returns the value of attribute bundler_path.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
-
#project_path ⇒ Object
readonly
Returns the value of attribute project_path.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
-
#test_dir_path ⇒ Object
readonly
Returns the value of attribute test_dir_path.
Instance Method Summary collapse
- #format_path(path) ⇒ Object
-
#initialize(project_path:, test_dir_path:, output_path:, revision:) ⇒ Configuration
constructor
A new instance of Configuration.
- #target_path?(path) ⇒ Boolean
Constructor Details
#initialize(project_path:, test_dir_path:, output_path:, revision:) ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 18 |
# File 'lib/affected_tests.rb', line 12 def initialize(project_path:, test_dir_path:, output_path:, revision:) @project_path = project_path @test_dir_path = test_dir_path @bundler_path = Bundler.bundle_path.to_s @output_path = output_path @revision = revision end |
Instance Attribute Details
#bundler_path ⇒ Object (readonly)
Returns the value of attribute bundler_path.
10 11 12 |
# File 'lib/affected_tests.rb', line 10 def bundler_path @bundler_path end |
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
10 11 12 |
# File 'lib/affected_tests.rb', line 10 def output_path @output_path end |
#project_path ⇒ Object (readonly)
Returns the value of attribute project_path.
10 11 12 |
# File 'lib/affected_tests.rb', line 10 def project_path @project_path end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
10 11 12 |
# File 'lib/affected_tests.rb', line 10 def revision @revision end |
#test_dir_path ⇒ Object (readonly)
Returns the value of attribute test_dir_path.
10 11 12 |
# File 'lib/affected_tests.rb', line 10 def test_dir_path @test_dir_path end |
Instance Method Details
#format_path(path) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/affected_tests.rb', line 20 def format_path(path) if path&.start_with?(@project_path) path.sub(@project_path + "/", "") else path end end |
#target_path?(path) ⇒ Boolean
28 29 30 31 32 |
# File 'lib/affected_tests.rb', line 28 def target_path?(path) return false if path.nil? path.start_with?(@project_path) && !path.start_with?(@bundler_path) end |