def asset_output_filename(path, processed_extensions)
      path = Pathname.new(path) if path.is_a?(String)

      return path if path.basename.to_s.split('.').length == 2

      extension = path.extname
      processed_extensions.map! { |ext| (ext[0] != '.' ? '.' : '') + ext }

      if processed_extensions.include?(extension)
        asset_output_filename(path.to_s.sub(/#{extension}\Z/, ''), processed_extensions)
      else
        path
      end
    end
def asset_output_filename(path, processed_extensions)
      path = Pathname.new(path) if path.is_a?(String)

      return path if path.basename.to_s.split('.').length == 2

      extension = path.extname
      processed_extensions.map! { |ext| (ext[0] != '.' ? '.' : '') + ext }

      if processed_extensions.include?(extension)
        asset_output_filename(path.to_s.sub(/#{extension}\Z/, ''), processed_extensions)
      else
        path
      end
    end
Helper function to convert the filenames of assets requiring pre-
 processing to their compiled extension. However, if the file only
 has one extension, it will be left alone regardless. Examples:

 * "foobar.module.js.coffee" => "foobar.module.js"
 * "index.html.haml" => "index.html"
 * "style.scss" => "style.scss"