Class: TestMap::Mapping
- Inherits:
-
Data
- Object
- Data
- TestMap::Mapping
- Defined in:
- lib/test_map/mapping.rb
Overview
Mapping looksup test files for changed files.
Instance Attribute Summary collapse
-
#map_file ⇒ Object
readonly
Returns the value of attribute map_file.
Instance Method Summary collapse
Instance Attribute Details
#map_file ⇒ Object (readonly)
Returns the value of attribute map_file
7 8 9 |
# File 'lib/test_map/mapping.rb', line 7 def map_file @map_file end |
Instance Method Details
#apply_natural_mapping(files) ⇒ Object
15 16 17 |
# File 'lib/test_map/mapping.rb', line 15 def apply_natural_mapping(files) files.map { |file| NaturalMapping.new(file).test_files } end |
#lookup(*changed_files) ⇒ Object
10 11 12 13 |
# File 'lib/test_map/mapping.rb', line 10 def lookup(*changed_files) new_files = apply_natural_mapping(changed_files - map.keys) map.values_at(*changed_files).concat(new_files).flatten.compact.uniq end |
#map ⇒ Object
8 |
# File 'lib/test_map/mapping.rb', line 8 def map = YAML.safe_load_file(map_file) |