Skip to content

Commit 091b09e

Browse files
committed
Remove PulseProxy
1 parent 5c4a203 commit 091b09e

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

Package.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ let package = Package(
1111
],
1212
products: [
1313
.library(name: "Pulse", targets: ["Pulse"]),
14-
.library(name: "PulseProxy", targets: ["PulseProxy"]),
1514
.library(name: "PulseUI", targets: ["PulseUI"])
1615
],
1716
targets: [
1817
.target(name: "Pulse"),
19-
.target(name: "PulseProxy", dependencies: ["Pulse"]),
2018
.target(name: "PulseUI", dependencies: ["Pulse"]),
2119
],
2220
swiftLanguageVersions: [

Sources/PulseProxy/Sources/URLSessionProxy.swift renamed to Sources/Pulse/NetworkLogger/URLSessionProxy.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// Copyright (c) 2020-2024 Alexander Grebenyuk (github.com/kean).
44

55
import Foundation
6-
import Pulse
76

87
final class NetworkLoggerURLSessionSwizzlerDelegate: URLSessionSwizzlerDelegate {
98
private let logger: NetworkLogger
@@ -181,7 +180,7 @@ public extension Experimental {
181180
public var isEnabled: Bool = false {
182181
didSet {
183182
if isEnabled {
184-
PulseProxy.URLSessionProxy.enable(with: logger)
183+
Pulse.URLSessionProxy.enable(with: logger)
185184
} else {
186185
NSLog("Pulse.URLSessionProxy can't be disabled at runtime")
187186
}

Sources/PulseProxy/Sources/URLSessionProxyDelegate+AutomaticRegistration.swift renamed to Sources/Pulse/NetworkLogger/URLSessionProxyDelegate+AutomaticRegistration.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
// Copyright (c) 2020-2024 Alexander Grebenyuk (github.com/kean).
44

55
import Foundation
6-
import Pulse
76

8-
public extension URLSessionProxyDelegate {
7+
extension URLSessionProxyDelegate {
98
/// Enables automatic registration of `URLSessionProxyDelegate`. After calling this method, every time
109
/// you initialize a `URLSession` using `init(configuration:delegate:delegateQueue:))` method, the
1110
/// delegate will automatically get replaced with a `URLSessionProxyDelegate` that logs all the

Sources/Pulse/RemoteLogger/RemoteLogger.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ public final class RemoteLogger: ObservableObject, RemoteLoggerConnectionDelegat
479479
switch message.path {
480480
case .updateMocks:
481481
let mocks = try JSONDecoder().decode([URLSessionMock].self, from: message.data)
482-
URLSessionMockManager.shared.update(mocks)
482+
RemoteDebugger.shared.update(mocks)
483483
case .getMockedResponse, .openMessageDetails, .openTaskDetails:
484484
break // Server specific (should never happen)
485485
}

Sources/Pulse/RemoteLogger/RemoteLoggerURLProtocol.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Foundation
88
/// as mocking, request rewriting, breakpoints, and more.
99
public final class RemoteLoggerURLProtocol: URLProtocol {
1010
public override func startLoading() {
11-
guard let mock = URLSessionMockManager.shared.getMock(for: request) else {
11+
guard let mock = RemoteDebugger.shared.getMock(for: request) else {
1212
client?.urlProtocol(self, didFailWithError: URLError(.unknown)) // Should never happen
1313
return
1414
}
@@ -51,7 +51,7 @@ public final class RemoteLoggerURLProtocol: URLProtocol {
5151
guard RemoteLogger.shared.connectionState == .connected else {
5252
return false
5353
}
54-
return URLSessionMockManager.shared.shouldMock(request)
54+
return RemoteDebugger.shared.shouldMock(request)
5555
}
5656

5757
static let requestMockedHeaderName = "X-PulseRequestMocked"

0 commit comments

Comments
 (0)