12
12
13
13
import Basics
14
14
15
- public class MockArchiver : Archiver {
16
- public typealias ExtractionHandler = (
15
+ package class MockArchiver : Archiver {
16
+ package typealias ExtractionHandler = (
17
17
MockArchiver ,
18
18
AbsolutePath ,
19
19
AbsolutePath ,
20
20
( Result < Void , Error > ) -> Void
21
21
) throws -> Void
22
- public typealias CompressionHandler = (
22
+ package typealias CompressionHandler = (
23
23
MockArchiver ,
24
24
AbsolutePath ,
25
25
AbsolutePath ,
26
26
( Result < Void , Error > ) -> Void
27
27
) throws -> Void
28
- public typealias ValidationHandler = ( MockArchiver , AbsolutePath , ( Result < Bool , Error > ) -> Void ) throws -> Void
28
+ package typealias ValidationHandler = ( MockArchiver , AbsolutePath , ( Result < Bool , Error > ) -> Void ) throws -> Void
29
29
30
- public struct Extraction : Equatable {
30
+ package struct Extraction : Equatable {
31
31
public let archivePath : AbsolutePath
32
32
public let destinationPath : AbsolutePath
33
33
@@ -37,7 +37,7 @@ public class MockArchiver: Archiver {
37
37
}
38
38
}
39
39
40
- public struct Compression : Equatable {
40
+ package struct Compression : Equatable {
41
41
public let directory : AbsolutePath
42
42
public let destinationPath : AbsolutePath
43
43
@@ -47,18 +47,18 @@ public class MockArchiver: Archiver {
47
47
}
48
48
}
49
49
50
- public let supportedExtensions : Set < String > = [ " zip " ]
51
- public let extractions = ThreadSafeArrayStore < Extraction > ( )
52
- public let compressions = ThreadSafeArrayStore < Compression > ( )
53
- public let extractionHandler : ExtractionHandler ?
54
- public let compressionHandler : CompressionHandler ?
55
- public let validationHandler : ValidationHandler ?
50
+ package let supportedExtensions : Set < String > = [ " zip " ]
51
+ package let extractions = ThreadSafeArrayStore < Extraction > ( )
52
+ package let compressions = ThreadSafeArrayStore < Compression > ( )
53
+ package let extractionHandler : ExtractionHandler ?
54
+ package let compressionHandler : CompressionHandler ?
55
+ package let validationHandler : ValidationHandler ?
56
56
57
- public convenience init ( handler: ExtractionHandler ? = . none) {
57
+ package convenience init ( handler: ExtractionHandler ? = . none) {
58
58
self . init ( extractionHandler: handler, compressionHandler: . none, validationHandler: . none)
59
59
}
60
60
61
- public init (
61
+ package init (
62
62
extractionHandler: ExtractionHandler ? = . none,
63
63
compressionHandler: CompressionHandler ? = . none,
64
64
validationHandler: ValidationHandler ? = . none
@@ -68,7 +68,7 @@ public class MockArchiver: Archiver {
68
68
self . validationHandler = validationHandler
69
69
}
70
70
71
- public func extract(
71
+ package func extract(
72
72
from archivePath: AbsolutePath ,
73
73
to destinationPath: AbsolutePath ,
74
74
completion: @escaping ( Result < Void , Error > ) -> Void
@@ -85,7 +85,7 @@ public class MockArchiver: Archiver {
85
85
}
86
86
}
87
87
88
- public func compress(
88
+ package func compress(
89
89
directory: AbsolutePath ,
90
90
to destinationPath: AbsolutePath ,
91
91
completion: @escaping ( Result < Void , Error > ) -> Void
@@ -102,7 +102,7 @@ public class MockArchiver: Archiver {
102
102
}
103
103
}
104
104
105
- public func validate( path: AbsolutePath , completion: @escaping ( Result < Bool , Error > ) -> Void ) {
105
+ package func validate( path: AbsolutePath , completion: @escaping ( Result < Bool , Error > ) -> Void ) {
106
106
do {
107
107
if let handler = self . validationHandler {
108
108
try handler ( self , path, completion)
0 commit comments