-
Notifications
You must be signed in to change notification settings - Fork 13
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 #37 from macadmins/dev_4.1.0
Outset 4.1.0
- Loading branch information
Showing
20 changed files
with
1,042 additions
and
864 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 |
---|---|---|
@@ -1,2 +1,11 @@ | ||
disabled_rules: # rule identifiers turned on by default to exclude from running | ||
- line_length | ||
- file_length | ||
- function_body_length | ||
- cyclomatic_complexity | ||
- large_tuple | ||
- force_cast | ||
|
||
|
||
excluded: # paths to ignore during linting. Takes precedence over `included`. | ||
- ./build/SourcePackages/checkouts/swift-argument-parser/* |
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,24 @@ | ||
// | ||
// Data+additions.swift | ||
// Outset | ||
// | ||
// Created by Bart E Reardon on 5/9/2023. | ||
// | ||
|
||
import Foundation | ||
import CommonCrypto | ||
|
||
extension Data { | ||
// extension to the Data class that lets us compute sha256 | ||
func sha256() -> Data { | ||
var hash = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH)) | ||
self.withUnsafeBytes { | ||
_ = CC_SHA256($0.baseAddress, CC_LONG(count), &hash) | ||
} | ||
return Data(hash) | ||
} | ||
|
||
func hexEncodedString() -> String { | ||
return map { String(format: "%02hhx", $0) }.joined() | ||
} | ||
} |
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,21 @@ | ||
// | ||
// String+additions.swift | ||
// Outset | ||
// | ||
// Created by Bart E Reardon on 5/9/2023. | ||
// | ||
|
||
import Foundation | ||
|
||
extension String { | ||
func camelCaseToUnderscored() -> String { | ||
let regex = try? NSRegularExpression(pattern: "([a-z])([A-Z])", options: []) | ||
let range = NSRange(location: 0, length: utf16.count) | ||
return regex?.stringByReplacingMatches(in: self, options: [], range: range, withTemplate: "$1_$2").lowercased() ?? self | ||
} | ||
} | ||
|
||
func getValueForKey(_ key: String, inArray array: [String: String]) -> String? { | ||
// short function that treats a [String: String] as a key value pair. | ||
return array[key] | ||
} |
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,14 @@ | ||
// | ||
// URL+additions.swift | ||
// Outset | ||
// | ||
// Created by Bart E Reardon on 5/9/2023. | ||
// | ||
|
||
import Foundation | ||
|
||
extension URL { | ||
var isDirectory: Bool { | ||
(try? resourceValues(forKeys: [.isDirectoryKey]))?.isDirectory == true | ||
} | ||
} |
Oops, something went wrong.