lib/xcres/analyzer/resources_analyzer/base_resources_analyzer.rb
def key_from_path path
        key = path.to_s

        # Get rid of the file extension
        key = key.sub /#{File.extname(path)}$/, ''

        # Graphical assets tend to contain words, which you want to strip.
        # Because we want to list the words to ignore only in one variant,
        # we have to ensure that the icon name is prepared for that, without
        # loosing word separation if camel case was used.
        key = key.underscore.downcase

        for filter_word in FILTER_WORDS do
          key.gsub! filter_word, ''
        end

        # Remove unnecessary underscores
        key = key.gsub(/^_*|_*$|(_)_+/, '\1')

        return key
      end
# Derive a key from a resource path
#
# @param  [String] path
#         the path to the resource
#
# @return [String]
#
Derive a key from a resource path
Derive a key from a resource path
def key_from_path path
        key = path.to_s
        key = key.sub /#{File.extname(path)}$/, ''
        key = key.underscore.downcase
        for filter_word in FILTER_WORDS do
          key.gsub! filter_word, ''
        end
        key = key.gsub(/^_*|_*$|(_)_+/, '\1')
        return key
      end
def key_from_path path key = path . to_s key = key . sub / #{ File . extname ( path ) } $ / , '' key = key . underscore . downcase for filter_word in FILTER_WORDS do key . gsub! filter_word , '' end key = key . gsub ( / ^_*|_*$|(_)_+ / , '\1' ) return key end
Derive a key from a resource path
Derive a key from a resource path
# Get rid of the file extension # Graphical assets tend to contain words, which you want to strip. # Because we want to list the words to ignore only in one variant, # we have to ensure that the icon name is prepared for that, without # loosing word separation if camel case was used. # Remove unnecessary underscores
None
String
path
path the path to the resource
path the path to the resource