Skip to content

Commit

Permalink
Merge release 2.1.1 back to trunk (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
pinarol authored Sep 12, 2024
1 parent 70b4fc0 commit d2feade
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Sources/Gravatar/Network/Services/ImageDownloadService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ public struct ImageDownloadService: ImageDownloader, Sendable {
/// - cache: A type which will perform image caching operations.
public init(client: HTTPClient? = nil, cache: ImageCaching? = nil) {
self.client = client ?? URLSessionHTTPClient()
self.imageCache = cache ?? ImageCache()
self.imageCache = cache ?? ImageCache.shared
}

public init(urlSession: URLSession, cache: ImageCaching? = nil) {
self.client = URLSessionHTTPClient(urlSession: urlSession)
self.imageCache = cache ?? ImageCache()
self.imageCache = cache ?? ImageCache.shared
}

public func fetchImage(with url: URL, forceRefresh: Bool = false, processingMethod: ImageProcessingMethod = .common()) async throws -> ImageDownloadResult {
Expand Down
2 changes: 1 addition & 1 deletion Tests/GravatarTests/AvatarServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class AvatarServiceTests: XCTestCase {
func testFetchImage() async throws {
let response = HTTPURLResponse.successResponse(with: TestData.urlFromEmail)
let sessionMock = URLSessionMock(returnData: ImageHelper.testImageData, response: response)
let service = avatarService(with: sessionMock)
let service = avatarService(with: sessionMock, cache: TestImageCache())
let options = ImageDownloadOptions()

let imageResponse = try await service.fetch(with: .email(TestData.email), options: options)
Expand Down
2 changes: 1 addition & 1 deletion Tests/GravatarTests/ImageDownloadServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ final class ImageDownloadServiceTests: XCTestCase {
let imageURL = "https://gravatar.com/avatar/HASH"
let response = HTTPURLResponse.successResponse(with: URL(string: imageURL)!)
let sessionMock = URLSessionMock(returnData: ImageHelper.testImageData, response: response)
let service = imageDownloadService(with: sessionMock)
let service = imageDownloadService(with: sessionMock, cache: TestImageCache())

let imageResponse = try await service.fetchImage(with: URL(string: imageURL)!)
let request = await sessionMock.request
Expand Down
2 changes: 1 addition & 1 deletion version.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Gravatar
VERSION = '2.1.0'
VERSION = '2.1.1'
SWIFT_VERSIONS = [
'5.10'
].freeze
Expand Down

0 comments on commit d2feade

Please sign in to comment.