Skip to content

Commit

Permalink
Merge pull request #53 from yutailang0119/cleanup
Browse files Browse the repository at this point in the history
Fix interface to rename
  • Loading branch information
yutailang0119 authored Nov 24, 2024
2 parents b053f93 + be498f0 commit 6562e6e
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 62 deletions.
112 changes: 56 additions & 56 deletions Sources/Demo/Demo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ struct Demo {
let duration = useconds_t(Double(2.0) * pow(1000, 2))

do {
let defaultSpinner = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let defaultSpinner = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " default:"
)
defaultSpinner.start()
Expand All @@ -18,8 +18,8 @@ struct Demo {
}

do {
let box1 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let box1 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " box1:",
spinner: Spinner(kind: .box1)
)
Expand All @@ -29,8 +29,8 @@ struct Demo {
}

do {
let box2 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let box2 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " box2:",
spinner: Spinner(kind: .box2)
)
Expand All @@ -40,8 +40,8 @@ struct Demo {
}

do {
let box3 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let box3 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " box3:",
spinner: Spinner(kind: .box3)
)
Expand All @@ -51,8 +51,8 @@ struct Demo {
}

do {
let box4 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let box4 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " box4:",
spinner: Spinner(kind: .box4)
)
Expand All @@ -62,8 +62,8 @@ struct Demo {
}

do {
let box5 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let box5 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " box5:",
spinner: Spinner(kind: .box5)
)
Expand All @@ -73,8 +73,8 @@ struct Demo {
}

do {
let box6 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let box6 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " box6:",
spinner: Spinner(kind: .box6)
)
Expand All @@ -84,8 +84,8 @@ struct Demo {
}

do {
let box7 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let box7 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " box7:",
spinner: Spinner(kind: .box7)
)
Expand All @@ -95,8 +95,8 @@ struct Demo {
}

do {
let bar1 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let bar1 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " bar1:",
spinner: Spinner(kind: .bar1)
)
Expand All @@ -106,8 +106,8 @@ struct Demo {
}

do {
let bar2 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let bar2 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " bar2:",
spinner: Spinner(kind: .bar2)
)
Expand All @@ -117,8 +117,8 @@ struct Demo {
}

do {
let bar3 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let bar3 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " bar3:",
spinner: Spinner(kind: .bar3)
)
Expand All @@ -128,8 +128,8 @@ struct Demo {
}

do {
let bar4 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let bar4 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " bar4:",
spinner: Spinner(kind: .bar4)
)
Expand All @@ -139,8 +139,8 @@ struct Demo {
}

do {
let bar5 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let bar5 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " bar5:",
spinner: Spinner(kind: .bar5)
)
Expand All @@ -150,8 +150,8 @@ struct Demo {
}

do {
let bar6 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let bar6 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " bar6:",
spinner: Spinner(kind: .bar6)
)
Expand All @@ -161,8 +161,8 @@ struct Demo {
}

do {
let spin1 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin1 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin1:",
spinner: Spinner(kind: .spin1)
)
Expand All @@ -172,8 +172,8 @@ struct Demo {
}

do {
let spin2 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin2 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin2:",
spinner: Spinner(kind: .spin2)
)
Expand All @@ -183,8 +183,8 @@ struct Demo {
}

do {
let spin3 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin3 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin3:",
spinner: Spinner(kind: .spin3)
)
Expand All @@ -194,8 +194,8 @@ struct Demo {
}

do {
let spin4 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin4 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin4:",
spinner: Spinner(kind: .spin4)
)
Expand All @@ -205,8 +205,8 @@ struct Demo {
}

do {
let spin5 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin5 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin5:",
spinner: Spinner(kind: .spin5)
)
Expand All @@ -216,8 +216,8 @@ struct Demo {
}

do {
let spin6 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin6 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin6:",
spinner: Spinner(kind: .spin6)
)
Expand All @@ -227,8 +227,8 @@ struct Demo {
}

do {
let spin7 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin7 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin7:",
spinner: Spinner(kind: .spin7)
)
Expand All @@ -238,8 +238,8 @@ struct Demo {
}

do {
let spin8 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin8 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin8:",
spinner: Spinner(kind: .spin8)
)
Expand All @@ -249,8 +249,8 @@ struct Demo {
}

do {
let spin9 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin9 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin9:",
spinner: Spinner(kind: .spin9)
)
Expand All @@ -260,8 +260,8 @@ struct Demo {
}

do {
let spin10 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin10 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin10:",
spinner: Spinner(kind: .spin10)
)
Expand All @@ -271,8 +271,8 @@ struct Demo {
}

do {
let spin11 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin11 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin11:",
spinner: Spinner(kind: .spin11)
)
Expand All @@ -282,8 +282,8 @@ struct Demo {
}

do {
let spin12 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin12 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin12:",
spinner: Spinner(kind: .spin12)
)
Expand All @@ -293,8 +293,8 @@ struct Demo {
}

do {
let spin13 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin13 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin13:",
spinner: Spinner(kind: .spin13)
)
Expand All @@ -304,8 +304,8 @@ struct Demo {
}

do {
let spin14 = ProgressSpinnerKit.createProgressSpinner(
forStream: TSCBasic.stderrStream,
let spin14 = ProgressSpinnerKit.progressSpinner(
for: TSCBasic.stderrStream,
header: " spin14:",
spinner: Spinner(kind: .spin14)
)
Expand Down
4 changes: 2 additions & 2 deletions Sources/ProgressSpinnerKit/ProgressSpinner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ final class ProgressSpinner: ProgressSpinnable {
}

/// Creates colored or simple progress spinner based on the provided output stream.
public func createProgressSpinner(
forStream stderrStream: ThreadSafeOutputByteStream,
public func progressSpinner(
for stderrStream: ThreadSafeOutputByteStream,
header: String,
isShowStopped: Bool = true,
spinner: Spinner = Spinner(kind: .box1)
Expand Down
8 changes: 4 additions & 4 deletions Tests/ProgressSpinnerKitTests/ProgressSpinnerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ final class ProgressSpinnerTests: XCTestCase {
let spinner = Spinner(kind: Spinner.Kind.allCases.randomElement()!)
let isShowStopped = Bool.random()
let headerText = "test"
let progressSpinner = ProgressSpinnerKit.createProgressSpinner(
forStream: outStream,
let progressSpinner = ProgressSpinnerKit.progressSpinner(
for: outStream,
header: headerText,
isShowStopped: isShowStopped,
spinner: spinner
Expand Down Expand Up @@ -60,8 +60,8 @@ final class ProgressSpinnerTests: XCTestCase {
let spinner = Spinner(kind: Spinner.Kind.allCases.randomElement()!)
let isShowStopped = Bool.random()
let headerText = "TestHeader"
let progressSpinner = ProgressSpinnerKit.createProgressSpinner(
forStream: outStream,
let progressSpinner = ProgressSpinnerKit.progressSpinner(
for: outStream,
header: headerText,
isShowStopped: isShowStopped,
spinner: spinner
Expand Down

0 comments on commit 6562e6e

Please sign in to comment.