def write(target, gzip: options[:gzip], hash: options[:hash])
      asset = assets[target]

      return if asset.nil?

      name = hash ? asset.digest_path : asset.logical_path.to_s
      name = File.join(options[:output], name) unless options[:output].nil?

      path = name
      path = File.join(directory, path) unless directory.nil?

      write(target, gzip: gzip, hash: false) if hash == :also_unhashed

      asset.write_to "#{path}.gz", compress: true if gzip
      asset.write_to path
      name
    end
def write(target, gzip: options[:gzip], hash: options[:hash])
      asset = assets[target]

      return if asset.nil?

      name = hash ? asset.digest_path : asset.logical_path.to_s
      name = File.join(options[:output], name) unless options[:output].nil?

      path = name
      path = File.join(directory, path) unless directory.nil?

      write(target, gzip: gzip, hash: false) if hash == :also_unhashed

      asset.write_to "#{path}.gz", compress: true if gzip
      asset.write_to path
      name
    end
Write a target asset to file with a hashed name.
 @param target [String] logical path to asset
 @param gzip [Boolean] if the asset should be gzipped
 @param hash [Boolean] if the asset name should include the hash
 @return [String, nil] the relative path to the written asset or `nil` if no such asset