Class: FeatureMap::Private::GlobCache

Inherits:
Object
  • Object
show all
Defined in:
lib/feature_map/private/glob_cache.rb

Instance Method Summary collapse

Constructor Details

#initialize(raw_cache_contents) ⇒ GlobCache

Returns a new instance of GlobCache.



7
8
9
# File 'lib/feature_map/private/glob_cache.rb', line 7

def initialize(raw_cache_contents)
  @raw_cache_contents = raw_cache_contents
end

Instance Method Details

#mapper_descriptions_that_map_files(files) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/feature_map/private/glob_cache.rb', line 15

def mapper_descriptions_that_map_files(files)
  files_by_mappers = files.to_h { |f| [f, Set.new([])] }

  files_by_mappers_via_expanded_cache.each do |file, mappers|
    mappers.each do |mapper|
      files_by_mappers[file] << mapper if files_by_mappers[file]
    end
  end

  files_by_mappers
end

#raw_cache_contentsObject



11
12
13
# File 'lib/feature_map/private/glob_cache.rb', line 11

def raw_cache_contents
  @raw_cache_contents
end