def convert_asset(klass, asset)
      # Convert asset content
      converter = klass.new(asset)

      # Replace asset content and filename
      asset.content = converter.converted
      asset.filename = File.basename(asset.filename, '.*')

      # Add back the output extension if no extension left
      if File.extname(asset.filename) == ''
        asset.filename = "#{asset.filename}#{@type}"
      end
    rescue StandardError => e
      puts "Asset Pipeline: Failed to convert '#{asset.filename}' " \
           "with '#{klass}': #{e.message}"
      raise e
    end
def convert_asset(klass, asset)
      # Convert asset content
      converter = klass.new(asset)

      # Replace asset content and filename
      asset.content = converter.converted
      asset.filename = File.basename(asset.filename, '.*')

      # Add back the output extension if no extension left
      if File.extname(asset.filename) == ''
        asset.filename = "#{asset.filename}#{@type}"
      end
    rescue StandardError => e
      puts "Asset Pipeline: Failed to convert '#{asset.filename}' " \
           "with '#{klass}': #{e.message}"
      raise e
    end
Convert an asset with a given converter class