class S3AssetDeploy::AssetHelper

Constants

FINGERPRINTED_ASSET_REGEX

Public Class Methods

mime_type_for_path(path) click to toggle source
# File lib/s3_asset_deploy/asset_helper.rb, line 14
def self.mime_type_for_path(path)
  extension = File.extname(path)[1..-1]
  return "application/json" if extension == "map"
  MIME::Types.type_for(extension).first
end
remove_fingerprint(path) click to toggle source
# File lib/s3_asset_deploy/asset_helper.rb, line 8
def self.remove_fingerprint(path)
  match_data = path.match(FINGERPRINTED_ASSET_REGEX)
  return path unless match_data
  "#{match_data[1]}#{match_data[3]}"
end