From f6cc5498a996a465d4671fba0e37a441734b2fa6 Mon Sep 17 00:00:00 2001 From: slightair Date: Sun, 27 Sep 2015 13:24:11 +0900 Subject: [PATCH] Auto convert new Swift syntax --- Example/Puree.xcodeproj/project.pbxproj | 2 ++ Example/Tests/PURTestAppendParamFilter.swift | 2 +- Example/Tests/PURTestBufferedOutput.swift | 2 +- Example/Tests/PURTestChangeTagFilter.swift | 2 +- Example/Tests/PURTestFailureOutput.swift | 2 +- Example/Tests/PURTestOutput.swift | 2 +- Example/Tests/TestLogStorage.swift | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Example/Puree.xcodeproj/project.pbxproj b/Example/Puree.xcodeproj/project.pbxproj index e04ff27..9206edf 100644 --- a/Example/Puree.xcodeproj/project.pbxproj +++ b/Example/Puree.xcodeproj/project.pbxproj @@ -260,6 +260,8 @@ isa = PBXProject; attributes = { CLASSPREFIX = PUR; + LastSwiftMigration = 0700; + LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 0510; ORGANIZATIONNAME = "Tomohiro Moro"; TargetAttributes = { diff --git a/Example/Tests/PURTestAppendParamFilter.swift b/Example/Tests/PURTestAppendParamFilter.swift index c14539b..7bc2552 100644 --- a/Example/Tests/PURTestAppendParamFilter.swift +++ b/Example/Tests/PURTestAppendParamFilter.swift @@ -10,7 +10,7 @@ import Foundation class PURTestAppendParamFilter : PURFilter { override func logsWithObject(object: AnyObject!, tag: String!, captured: String!) -> [AnyObject]! { - var userInfo = (object as NSDictionary).mutableCopy() as NSMutableDictionary + var userInfo = (object as! NSDictionary).mutableCopy() as! NSMutableDictionary userInfo["ext"] = captured; return [PURLog(tag: tag, date: NSDate(), userInfo: userInfo)] diff --git a/Example/Tests/PURTestBufferedOutput.swift b/Example/Tests/PURTestBufferedOutput.swift index c312c57..fae497b 100644 --- a/Example/Tests/PURTestBufferedOutput.swift +++ b/Example/Tests/PURTestBufferedOutput.swift @@ -19,7 +19,7 @@ class PURTestBufferedOutput : PURBufferedOutput { override func writeChunk(chunk: PURBufferedOutputChunk!, completion: ((Bool) -> Void)!) { let logs = chunk.logs as [PURLog] - let logString = reduce(logs as [PURLog], "") { (result, log) -> String in + let logString = (logs as [PURLog]).reduce("") { (result, log) -> String in let record = join("_", map(log.userInfo) { (key, value) in "\(key)=\(value)" }) return result + "\(log.tag)-\(record)/" } diff --git a/Example/Tests/PURTestChangeTagFilter.swift b/Example/Tests/PURTestChangeTagFilter.swift index b956c69..3fc3b69 100644 --- a/Example/Tests/PURTestChangeTagFilter.swift +++ b/Example/Tests/PURTestChangeTagFilter.swift @@ -11,7 +11,7 @@ import Foundation class PURTestChangeTagFilter : PURFilter { var tagSuffix: String! override func configure(settings: [NSObject : AnyObject]!) { - tagSuffix = settings["tagSuffix"] as String! + tagSuffix = settings["tagSuffix"] as! String! } override func logsWithObject(object: AnyObject!, tag: String!, captured: String!) -> [AnyObject]! { diff --git a/Example/Tests/PURTestFailureOutput.swift b/Example/Tests/PURTestFailureOutput.swift index 18298f3..91c3c02 100644 --- a/Example/Tests/PURTestFailureOutput.swift +++ b/Example/Tests/PURTestFailureOutput.swift @@ -19,7 +19,7 @@ class PURTestFailureOutput : PURBufferedOutput { override func writeChunk(chunk: PURBufferedOutputChunk!, completion: ((Bool) -> Void)!) { self.logStorage?.addLog("error"); - println("\(NSDate()): error!(retry debug)") + print("\(NSDate()): error!(retry debug)") completion(false) } } diff --git a/Example/Tests/PURTestOutput.swift b/Example/Tests/PURTestOutput.swift index 3e6a80f..afc20ba 100644 --- a/Example/Tests/PURTestOutput.swift +++ b/Example/Tests/PURTestOutput.swift @@ -18,7 +18,7 @@ class PURTestOutput : PUROutput { } override func emitLog(log: PURLog!) { - let record = join("_", map(log.userInfo) { (key, value) in "\(key)=\(value)" }) + let record = map(log.userInfo) { (key, value) in "\(key)=\(value)" }.joinWithSeparator("_") self.logStorage?.addLog("\(log.tag)-\(record)") } } diff --git a/Example/Tests/TestLogStorage.swift b/Example/Tests/TestLogStorage.swift index ef2149d..2106c20 100644 --- a/Example/Tests/TestLogStorage.swift +++ b/Example/Tests/TestLogStorage.swift @@ -16,6 +16,6 @@ class TestLogStorage { } func toString() -> String { - return join(", ", storage) + return storage.joinWithSeparator(", ") } }