From ab5517dcba0889ca7f0cc477ffd7b9caaa16acef Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Thu, 4 Apr 2019 19:26:08 +0200 Subject: [PATCH] Rename ParsingResult to Result From ConfigurationParser in TunnelKit. --- Passepartout-iOS/AppDelegate.swift | 6 +++--- ...ts.swift => ConfigurationParserResult+Alerts.swift} | 8 ++++---- .../Scenes/ConfigurationViewController.swift | 2 +- .../Scenes/Organizer/ImportedHostsViewController.swift | 6 +++--- .../Scenes/Organizer/WizardHostViewController.swift | 2 +- Passepartout.xcodeproj/project.pbxproj | 8 ++++---- Podfile | 4 ++-- Podfile.lock | 10 +++++----- 8 files changed, 23 insertions(+), 23 deletions(-) rename Passepartout-iOS/Global/{ParsingResult+Alerts.swift => ConfigurationParserResult+Alerts.swift} (96%) diff --git a/Passepartout-iOS/AppDelegate.swift b/Passepartout-iOS/AppDelegate.swift index 339ce7fb..daf453fb 100644 --- a/Passepartout-iOS/AppDelegate.swift +++ b/Passepartout-iOS/AppDelegate.swift @@ -104,11 +104,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele let passphraseCancelBlock = { _ = try? FileManager.default.removeItem(at: url) } - guard let parsingResult = ConfigurationParser.ParsingResult.from(url, withErrorAlertIn: target, passphrase: passphrase, passphraseBlock: passphraseBlock, passphraseCancelBlock: passphraseCancelBlock) else { + guard let parsingResult = ConfigurationParser.Result.from(url, withErrorAlertIn: target, passphrase: passphrase, passphraseBlock: passphraseBlock, passphraseCancelBlock: passphraseCancelBlock) else { return true } if let warning = parsingResult.warning { - ConfigurationParser.ParsingResult.alertImportWarning(url: url, in: target, withWarning: warning) { + ConfigurationParser.Result.alertImportWarning(url: url, in: target, withWarning: warning) { if $0 { self.handleParsingResult(parsingResult, in: target) } else { @@ -121,7 +121,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele return true } - private func handleParsingResult(_ parsingResult: ConfigurationParser.ParsingResult, in target: UIViewController) { + private func handleParsingResult(_ parsingResult: ConfigurationParser.Result, in target: UIViewController) { // already presented: update parsed configuration if let nav = target as? UINavigationController, let wizard = nav.topViewController as? WizardHostViewController { diff --git a/Passepartout-iOS/Global/ParsingResult+Alerts.swift b/Passepartout-iOS/Global/ConfigurationParserResult+Alerts.swift similarity index 96% rename from Passepartout-iOS/Global/ParsingResult+Alerts.swift rename to Passepartout-iOS/Global/ConfigurationParserResult+Alerts.swift index a7b2f357..19ea7509 100644 --- a/Passepartout-iOS/Global/ParsingResult+Alerts.swift +++ b/Passepartout-iOS/Global/ConfigurationParserResult+Alerts.swift @@ -1,5 +1,5 @@ // -// ParsingResult+Alerts.swift +// ConfigurationParserResult+Alerts.swift // Passepartout-iOS // // Created by Davide De Rosa on 10/27/18. @@ -31,11 +31,11 @@ import Passepartout_Core private let log = SwiftyBeaver.self -extension ConfigurationParser.ParsingResult { +extension ConfigurationParser.Result { static func from(_ url: URL, withErrorAlertIn viewController: UIViewController, passphrase: String?, - passphraseBlock: @escaping (String) -> Void, passphraseCancelBlock: (() -> Void)?) -> ConfigurationParser.ParsingResult? { + passphraseBlock: @escaping (String) -> Void, passphraseCancelBlock: (() -> Void)?) -> ConfigurationParser.Result? { - let result: ConfigurationParser.ParsingResult + let result: ConfigurationParser.Result let fm = FileManager.default log.debug("Parsing configuration URL: \(url)") diff --git a/Passepartout-iOS/Scenes/ConfigurationViewController.swift b/Passepartout-iOS/Scenes/ConfigurationViewController.swift index db9b3841..6c585cef 100644 --- a/Passepartout-iOS/Scenes/ConfigurationViewController.swift +++ b/Passepartout-iOS/Scenes/ConfigurationViewController.swift @@ -135,7 +135,7 @@ class ConfigurationViewController: UIViewController, TableModelHost { log.warning("Resetting with no original configuration set? Bad table model?") return } - let parsingResult: ConfigurationParser.ParsingResult + let parsingResult: ConfigurationParser.Result do { parsingResult = try ConfigurationParser.parsed(fromURL: originalURL) } catch let e { diff --git a/Passepartout-iOS/Scenes/Organizer/ImportedHostsViewController.swift b/Passepartout-iOS/Scenes/Organizer/ImportedHostsViewController.swift index 66de108b..e06f607a 100644 --- a/Passepartout-iOS/Scenes/Organizer/ImportedHostsViewController.swift +++ b/Passepartout-iOS/Scenes/Organizer/ImportedHostsViewController.swift @@ -33,7 +33,7 @@ private let log = SwiftyBeaver.self class ImportedHostsViewController: UITableViewController { private lazy var pendingConfigurationURLs = TransientStore.shared.service.pendingConfigurationURLs().sortedCaseInsensitive() - private var parsingResult: ConfigurationParser.ParsingResult? + private var parsingResult: ConfigurationParser.Result? override func viewDidLoad() { super.viewDidLoad() @@ -88,7 +88,7 @@ class ImportedHostsViewController: UITableViewController { } self.perform(segue: StoryboardSegue.Organizer.importHostSegueIdentifier, sender: cell) } - guard let parsingResult = ConfigurationParser.ParsingResult.from(url, withErrorAlertIn: self, passphrase: passphrase, passphraseBlock: passphraseBlock, passphraseCancelBlock: nil) else { + guard let parsingResult = ConfigurationParser.Result.from(url, withErrorAlertIn: self, passphrase: passphrase, passphraseBlock: passphraseBlock, passphraseCancelBlock: nil) else { deselectSelectedRow() return false } @@ -96,7 +96,7 @@ class ImportedHostsViewController: UITableViewController { // postpone segue until alert dismissal if let warning = parsingResult.warning { - ConfigurationParser.ParsingResult.alertImportWarning(url: url, in: self, withWarning: warning) { + ConfigurationParser.Result.alertImportWarning(url: url, in: self, withWarning: warning) { self.deselectSelectedRow() if $0 { self.perform(segue: StoryboardSegue.Organizer.importHostSegueIdentifier) diff --git a/Passepartout-iOS/Scenes/Organizer/WizardHostViewController.swift b/Passepartout-iOS/Scenes/Organizer/WizardHostViewController.swift index 08330cf1..13a38000 100644 --- a/Passepartout-iOS/Scenes/Organizer/WizardHostViewController.swift +++ b/Passepartout-iOS/Scenes/Organizer/WizardHostViewController.swift @@ -37,7 +37,7 @@ class WizardHostViewController: UITableViewController, TableModelHost { return TransientStore.shared.service.ids(forContext: .host).sortedCaseInsensitive() }() - var parsingResult: ConfigurationParser.ParsingResult? { + var parsingResult: ConfigurationParser.Result? { didSet { useSuggestedTitle() } diff --git a/Passepartout.xcodeproj/project.pbxproj b/Passepartout.xcodeproj/project.pbxproj index 527aee9f..e5003f79 100644 --- a/Passepartout.xcodeproj/project.pbxproj +++ b/Passepartout.xcodeproj/project.pbxproj @@ -77,7 +77,7 @@ 0E6BE13F20CFBAB300A6DD36 /* DebugLogViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E6BE13E20CFBAB300A6DD36 /* DebugLogViewController.swift */; }; 0E773BF8224BF37600CDDC8E /* ShortcutsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E773BF7224BF37600CDDC8E /* ShortcutsViewController.swift */; }; 0E89DFCE213EEDFA00741BA1 /* WizardProviderViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E89DFCD213EEDFA00741BA1 /* WizardProviderViewController.swift */; }; - 0EA068F4218475F800C320AD /* ParsingResult+Alerts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EA068F3218475F800C320AD /* ParsingResult+Alerts.swift */; }; + 0EA068F4218475F800C320AD /* ConfigurationParserResult+Alerts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EA068F3218475F800C320AD /* ConfigurationParserResult+Alerts.swift */; }; 0EAAD71920E6669A0088754A /* GroupConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EDE8DED20C93E4C004C739C /* GroupConstants.swift */; }; 0EB60FDA2111136E00AD27F3 /* UITextView+Search.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB60FD92111136E00AD27F3 /* UITextView+Search.swift */; }; 0EB67D6B2184581E00BA6200 /* ImportedHostsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB67D6A2184581E00BA6200 /* ImportedHostsViewController.swift */; }; @@ -209,7 +209,7 @@ 0E89DFC7213E8FC500741BA1 /* SessionProxy+Communication.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SessionProxy+Communication.swift"; sourceTree = ""; }; 0E89DFCD213EEDFA00741BA1 /* WizardProviderViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WizardProviderViewController.swift; sourceTree = ""; }; 0E8D97E121388B52006FB4A0 /* InfrastructurePreset.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfrastructurePreset.swift; sourceTree = ""; }; - 0EA068F3218475F800C320AD /* ParsingResult+Alerts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ParsingResult+Alerts.swift"; sourceTree = ""; }; + 0EA068F3218475F800C320AD /* ConfigurationParserResult+Alerts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ConfigurationParserResult+Alerts.swift"; sourceTree = ""; }; 0EB60FD92111136E00AD27F3 /* UITextView+Search.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextView+Search.swift"; sourceTree = ""; }; 0EB67D6A2184581E00BA6200 /* ImportedHostsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImportedHostsViewController.swift; sourceTree = ""; }; 0EBBE8F021822B4D00106008 /* ConnectionServiceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionServiceTests.swift; sourceTree = ""; }; @@ -512,7 +512,7 @@ 0EFD943D215BE10800529B64 /* IssueReporter.swift */, 0E4FD7F020D58618002221FF /* Macros.swift */, 0ED38AE9214054A50004D387 /* OptionViewController.swift */, - 0EA068F3218475F800C320AD /* ParsingResult+Alerts.swift */, + 0EA068F3218475F800C320AD /* ConfigurationParserResult+Alerts.swift */, 0EDE8DE320C89028004C739C /* SwiftGen+Scenes.swift */, 0EF56BBA2185AC8500B0C8AB /* SwiftGen+Segues.swift */, 0E05C61C20D27C82006EE732 /* Theme.swift */, @@ -1033,7 +1033,7 @@ 0EB67D6B2184581E00BA6200 /* ImportedHostsViewController.swift in Sources */, 0E57F63E20C83FC5008323CF /* ServiceViewController.swift in Sources */, 0E36D24D2240234B006AF062 /* ShortcutsAddViewController.swift in Sources */, - 0EA068F4218475F800C320AD /* ParsingResult+Alerts.swift in Sources */, + 0EA068F4218475F800C320AD /* ConfigurationParserResult+Alerts.swift in Sources */, 0E57F63C20C83FC5008323CF /* AppDelegate.swift in Sources */, 0ED31C2920CF2A340027975F /* AccountViewController.swift in Sources */, 0E158ADA20E11B0B00C85A82 /* EndpointViewController.swift in Sources */, diff --git a/Podfile b/Podfile index a85882b9..2093506e 100644 --- a/Podfile +++ b/Podfile @@ -5,8 +5,8 @@ use_frameworks! def shared_pods #pod 'TunnelKit', '~> 1.6.0' #pod 'TunnelKit/LZO', '~> 1.6.0' - pod 'TunnelKit', :git => 'https://github.com/keeshux/tunnelkit', :commit => '7333ea2' - pod 'TunnelKit/LZO', :git => 'https://github.com/keeshux/tunnelkit', :commit => '7333ea2' + pod 'TunnelKit', :git => 'https://github.com/keeshux/tunnelkit', :commit => '5e2f9b5' + pod 'TunnelKit/LZO', :git => 'https://github.com/keeshux/tunnelkit', :commit => '5e2f9b5' #pod 'TunnelKit', :path => '../../personal/tunnelkit' #pod 'TunnelKit/LZO', :path => '../../personal/tunnelkit' end diff --git a/Podfile.lock b/Podfile.lock index 6e681249..159d04fc 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -15,8 +15,8 @@ PODS: DEPENDENCIES: - MBProgressHUD - - TunnelKit (from `https://github.com/keeshux/tunnelkit`, commit `7333ea2`) - - TunnelKit/LZO (from `https://github.com/keeshux/tunnelkit`, commit `7333ea2`) + - TunnelKit (from `https://github.com/keeshux/tunnelkit`, commit `5e2f9b5`) + - TunnelKit/LZO (from `https://github.com/keeshux/tunnelkit`, commit `5e2f9b5`) SPEC REPOS: https://github.com/cocoapods/specs.git: @@ -26,12 +26,12 @@ SPEC REPOS: EXTERNAL SOURCES: TunnelKit: - :commit: 7333ea2 + :commit: 5e2f9b5 :git: https://github.com/keeshux/tunnelkit CHECKOUT OPTIONS: TunnelKit: - :commit: 7333ea2 + :commit: 5e2f9b5 :git: https://github.com/keeshux/tunnelkit SPEC CHECKSUMS: @@ -40,6 +40,6 @@ SPEC CHECKSUMS: SwiftyBeaver: 4cc0080d2e23f980652e28978db11a5c9da39165 TunnelKit: cd10ff6f4368e82414a72e6a111dae369252964e -PODFILE CHECKSUM: ab7fe69f86411d5848909b12bfeb846d738d004d +PODFILE CHECKSUM: 63e02ccbcec92e2575a4fcc0e3e48aecef3fc973 COCOAPODS: 1.6.1