Skip to content

Commit 8a03150

Browse files
committed
Zipping → Zipper
1 parent 8e1be8b commit 8a03150

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Sources/DocUploadBundle/DocUploadBundle.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ public struct DocUploadBundle {
110110
let metadataURL = URL(fileURLWithPath: "\(workDir)/metadata.json")
111111
try JSONEncoder().encode(metadata).write(to: metadataURL)
112112

113-
try Zipping.zip(paths: [metadataURL, URL(fileURLWithPath: sourcePath)], to: archiveURL)
113+
try Zipper.zip(paths: [metadataURL, URL(fileURLWithPath: sourcePath)], to: archiveURL)
114114

115115
return archiveURL.path
116116
}
117117

118118
public static func unzip(bundle: String, outputPath: String, fileOutputHandler: ((_ unzippedFile: URL) -> Void)? = nil) throws -> Metadata {
119-
try Zipping.unzip(from: bundle, to: outputPath, fileOutputHandler: fileOutputHandler)
119+
try Zipper.unzip(from: bundle, to: outputPath, fileOutputHandler: fileOutputHandler)
120120
let metadataURL = URL(fileURLWithPath: "\(outputPath)/metadata.json")
121121
let data = try Data(contentsOf: metadataURL)
122122
return try JSONDecoder().decode(Metadata.self, from: data)

Sources/DocUploadBundle/Zipping.swift renamed to Sources/DocUploadBundle/Zipper.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Foundation
1717
import Zip
1818

1919

20-
enum Zipping {
20+
enum Zipper {
2121
static func zip(paths inputPaths: [URL], to outputPath: URL) throws {
2222
try Zip.zipFiles(paths: inputPaths, zipFilePath: outputPath, password: nil, progress: nil)
2323
}
@@ -28,7 +28,7 @@ enum Zipping {
2828
}
2929

3030

31-
extension Zipping {
31+
extension Zipper {
3232
static func unzip(from inputPath: String, to outputPath: String, fileOutputHandler: ((_ unzippedFile: URL) -> Void)? = nil) throws {
3333
try unzip(from: URL(fileURLWithPath: inputPath), to: URL(fileURLWithPath: outputPath), fileOutputHandler: fileOutputHandler)
3434
}

Tests/DocUploadBundleTests/ZipTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class ZipTests: XCTestCase {
2828
try "a".write(to: fileA, atomically: true, encoding: .utf8)
2929
try "b".write(to: fileB, atomically: true, encoding: .utf8)
3030
let zipFile = tempURL.appendingPathComponent("out.zip")
31-
try Zipping.zip(paths: [fileA, fileB], to: zipFile)
31+
try Zipper.zip(paths: [fileA, fileB], to: zipFile)
3232
XCTAssert(FileManager.default.fileExists(atPath: zipFile.path))
3333
}
3434
}
@@ -39,7 +39,7 @@ final class ZipTests: XCTestCase {
3939
let tempURL = URL(fileURLWithPath: tempDir)
4040
let zipFile = fixtureUrl(for: "out.zip")
4141
let outDir = tempURL.appendingPathComponent("out")
42-
try Zipping.unzip(from: zipFile, to: outDir)
42+
try Zipper.unzip(from: zipFile, to: outDir)
4343
XCTAssert(FileManager.default.fileExists(atPath: outDir.path))
4444
let fileA = outDir.appendingPathComponent("a.txt")
4545
let fileB = outDir.appendingPathComponent("b.txt")

0 commit comments

Comments
 (0)