Class: Calcifer::Finders::SpecFilesRelatedFinder
- Inherits:
-
Object
- Object
- Calcifer::Finders::SpecFilesRelatedFinder
- Defined in:
- lib/calcifer/finders/spec_files_related_finder.rb
Instance Attribute Summary collapse
-
#related_spec_files ⇒ Object
readonly
Returns the value of attribute related_spec_files.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(related_files_path) ⇒ SpecFilesRelatedFinder
constructor
A new instance of SpecFilesRelatedFinder.
- #specs_to_related_files ⇒ Object
Constructor Details
#initialize(related_files_path) ⇒ SpecFilesRelatedFinder
Returns a new instance of SpecFilesRelatedFinder.
8 9 10 |
# File 'lib/calcifer/finders/spec_files_related_finder.rb', line 8 def initialize() @related_files_path = end |
Instance Attribute Details
#related_spec_files ⇒ Object (readonly)
Returns the value of attribute related_spec_files.
6 7 8 |
# File 'lib/calcifer/finders/spec_files_related_finder.rb', line 6 def @related_spec_files end |
Instance Method Details
#execute ⇒ Object
12 13 14 |
# File 'lib/calcifer/finders/spec_files_related_finder.rb', line 12 def execute @related_spec_files = .join(' ').strip end |
#specs_to_related_files ⇒ Object
16 17 18 19 20 21 |
# File 'lib/calcifer/finders/spec_files_related_finder.rb', line 16 def @related_files_path.map(&lambda { |file_path| spec_file_path = file_path.gsub('./app', './spec').gsub('.rb', '_spec.rb') File.file?(spec_file_path) ? spec_file_path : nil }).compact end |