-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from steamclock/jc/38-rename-and-consolidate-t…
- Loading branch information
Showing
151 changed files
with
1,439 additions
and
8,303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,3 +66,5 @@ fastlane/report.xml | |
fastlane/Preview.html | ||
fastlane/screenshots/**/*.png | ||
fastlane/test_output | ||
|
||
*.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'Netable' | ||
s.version = '0.8.0' | ||
s.summary = 'A simple and swifty networking library.' | ||
s.description = 'Netable is a simple Swift framework for working with both simple and non-REST-compliant HTTP endpoints.' | ||
s.homepage = 'https://github.com/steamclock/networkAPI/' | ||
s.license = { :type => 'MIT', :file => 'LICENSE' } | ||
s.author = { 'Brendan Lensink' => '[email protected]' } | ||
s.source = { :git => 'https://github.com/steamclock/networkAPI.git', :tag => 'v0.8.0' } | ||
s.ios.deployment_target = '12.0' | ||
s.osx.deployment_target = '10.14' | ||
s.source_files = 'Netable/Netable/*.{swift,h,m}' | ||
end |
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ject.xcworkspace/contents.xcworkspacedata → ...ject.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
Netable/Netable.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "OHHTTPStubs", | ||
"repositoryURL": "https://github.com/AliSoftware/OHHTTPStubs.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "e92b5a5746ef16add2a1424f1fc19529d9a75cde", | ||
"version": "9.0.0" | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// | ||
// Error.swift | ||
// Netable | ||
// | ||
// Created by Jeremy Chiang on 2019-04-08. | ||
// Copyright © 2018 steamclock. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public enum NetableError: Error { | ||
case codingError(String) | ||
case decodingError(Error, Data?) | ||
case httpError(Int, Data?) | ||
case malformedURL | ||
case requestFailed(Error) | ||
case wrongServer | ||
case noData | ||
case resourceExtractionError(String) | ||
case unknownError(Error) | ||
} | ||
|
||
extension NetableError: LocalizedError { | ||
public var errorDescription: String? { | ||
switch self { | ||
case .codingError(let message): | ||
return "Coding error: \(message)" | ||
case .decodingError(let error, _): | ||
return "Decoding error: \(error.localizedDescription)" | ||
case .httpError(let statusCode, _): | ||
return "HTTP status code: \(statusCode)" | ||
case .malformedURL: | ||
return "Malformed URL" | ||
case .requestFailed(let error): | ||
return "Request failed: \(error.localizedDescription)" | ||
case .wrongServer: | ||
return "Wrong server" | ||
case .noData: | ||
return "No data" | ||
case .resourceExtractionError(let message): | ||
return "Resource Extraction Error: The raw result could not be turned into the final resource: \(message)" | ||
case .unknownError(let error): | ||
return "Unknown error: \(error.localizedDescription)" | ||
} | ||
} | ||
} | ||
|
||
extension NetableError: Equatable { | ||
public static func == (lhs: NetableError, rhs: NetableError) -> Bool { | ||
switch (lhs, rhs) { | ||
case (.codingError(let lhsMessage), .codingError(let rhsMessage)): | ||
return lhsMessage == rhsMessage | ||
case (.decodingError(let lhsError, let lhsData), .decodingError(let rhsError, let rhsData)): | ||
return lhsError.localizedDescription == rhsError.localizedDescription && lhsData == rhsData | ||
case (.httpError(let lhsCode, let lhsData), .httpError(let rhsCode, let rhsData)): | ||
return lhsCode == rhsCode && lhsData == rhsData | ||
case (.malformedURL, .malformedURL): | ||
return true | ||
case (.requestFailed(let lhsError), .requestFailed(let rhsError)): | ||
return lhsError.localizedDescription == rhsError.localizedDescription | ||
case (.wrongServer, .wrongServer): | ||
return true | ||
case (.noData, .noData): | ||
return true | ||
case (.resourceExtractionError(let lhsMessage), .resourceExtractionError(let rhsMessage)): | ||
return lhsMessage == rhsMessage | ||
case (.unknownError(let lhsError), .unknownError(let rhsError)): | ||
return lhsError.localizedDescription == rhsError.localizedDescription | ||
default: | ||
return false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// HTTPMethod.swift | ||
// Netable | ||
// | ||
// Created by Jeremy Chiang on 2020-02-04. | ||
// Copyright © 2020 Steamclock Software. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public enum HTTPMethod: String { | ||
case get = "GET" | ||
case post = "POST" | ||
case put = "PUT" | ||
case patch = "PATCH" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// Netable.h | ||
// Netable | ||
// | ||
// Created by Jeremy Chiang on 2020-02-04. | ||
// Copyright © 2020 Steamclock Software. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
//! Project version number for Netable. | ||
FOUNDATION_EXPORT double NetableVersionNumber; | ||
|
||
//! Project version string for Netable. | ||
FOUNDATION_EXPORT const unsigned char NetableVersionString[]; | ||
|
||
// In this header, you should import all the public headers of your framework using statements like #import <Netable/PublicHeader.h> | ||
|
||
|
Oops, something went wrong.