lib/xcres/analyzer/resources_analyzer/base_resources_analyzer.rb
# Filter out device scale and idiom specific images (retina, ipad),
# but ensure the base exist once
#
# @param  [Array<Pathname>] file_paths
#         the file paths to filter
#
# @return [Array<String>]
#         the filtered file paths
#
Filter out device scale and idiom specific images (retina, ipad),
but ensure the base exist once
Filter out device scale and idiom specific images ( retina ipad ) but ensure the base exist once
def filter_device_specific_image_paths file_paths
        file_paths.map do |path|
          path.to_s.gsub /(@2x)?(~(iphone|ipad))?(?=\.\w+$)/, ''
        end.to_set.to_a
      end
def filter_device_specific_image_paths file_paths file_paths . map do | path | path . to_s . gsub / (@2x)?(~(iphone|ipad))?(?= \. \w +$) / , '' end . to_set . to_a end
Filter out device scale and idiom specific images (retina, ipad),
but ensure the base exist once
Filter out device scale and idiom specific images ( retina ipad ) but ensure the base exist once
the filtered file paths
the filtered file paths
Array<String>
file_paths
file_paths the file paths to filter
file_paths the file paths to filter