Skip to content

Commit

Permalink
Merge pull request #6 from lemo-nade-room/refactor/rename-cli
Browse files Browse the repository at this point in the history
refactor: 🚚 CLIKitServiceの名前がダサいのでCLIに名前変更
  • Loading branch information
lemo-nade-room authored Sep 9, 2024
2 parents b41adc2 + 3aa9a4e commit d2c6382
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies: [
let sqliteURL = FileManager()
.homeDirectoryForCurrentUser
.appending(path: "file.sqlite")
var cli = CLIKitService(help: "サンプルCLI")
var cli = CLI(help: "サンプルCLI")
cli.use(AddCommand(), as: "add")
cli.use(CommitCommand(), as: "commit")
cli.migrations.add(CommitMigration())
Expand Down
4 changes: 2 additions & 2 deletions Sources/CLIKit/CLIKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import Logging
/// let sqliteURL = FileManager()
/// .homeDirectoryForCurrentUser
/// .appending(path: "file.sqlite")
/// var cli = CLIKitService(help: "サンプルCLI")
/// var cli = CLI(help: "サンプルCLI")
/// cli.use(AddCommand(), as: "add")
/// cli.use(CommitCommand(), as: "commit")
/// cli.migrations.add(CommitMigration())
/// await cli.run()
/// ```
public struct CLIKitService: Sendable {
public struct CLI: Sendable {
public var help: String
public var console: any Console
public var input: CommandInput
Expand Down
2 changes: 1 addition & 1 deletion Sources/CLIKit/CommandContext+initDatabase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extension CommandContext {
let databases = await storage.get(Databases.self),
let db = await databases.database(logger: logger, on: eventLoopGroup.any())
else {
fatalError("データベースが初期化されていません。CLIKitService(sqlitePath: \"...\")で初期化してください")
fatalError("データベースが初期化されていません。CLI(sqlitePath: \"...\")で初期化してください")
}
return db
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/CLIKitTests/CLIKitDatabaseTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Testing
}
removeSQLiteFile()
defer { removeSQLiteFile() }
var sut = CLIKitService(
var sut = CLI(
console: console,
input: CommandInput(arguments: ["cli", "save"]),
sqliteURL: sqliteURL
Expand Down
4 changes: 2 additions & 2 deletions Tests/CLIKitTests/CLIKitServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import CLIKit
import ConsoleKit
import Testing

@Suite struct CLIKitServiceTests {
@Suite struct CLITests {
@Test func サンプル() async throws {
// Arrange
struct TestCommand: AsyncCommand {
Expand All @@ -17,7 +17,7 @@ import Testing
}

let console = TestConsole()
var sut = CLIKitService(
var sut = CLI(
console: console,
input: CommandInput(arguments: ["git", "commit", "-m", "hello"])
)
Expand Down

0 comments on commit d2c6382

Please sign in to comment.