https://github.com/rockfordwei/pa-prerequisites
Runtime library for MacOS / Xcode / Swift / Github / Docker availability checker.
https://github.com/rockfordwei/pa-prerequisites
perfect
Last synced: 3 days ago
JSON representation
Runtime library for MacOS / Xcode / Swift / Github / Docker availability checker.
- Host: GitHub
- URL: https://github.com/rockfordwei/pa-prerequisites
- Owner: RockfordWei
- Created: 2017-08-08T17:26:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-22T16:38:38.000Z (almost 8 years ago)
- Last Synced: 2025-03-02T07:34:40.478Z (4 months ago)
- Topics: perfect
- Language: Swift
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MacOS Info Checker
This library provides runtime info of Xcode / Swift / Homebrew installations.
``` swift
import PaPreif let brew = MacOSInfo.Homebrew {
print(brew)
// will be 1.3.0
}let sw = MacOSInfo.Swift
print(sw["Swift"] ?? "Swift Version Fault")
// will print 3.1
print(sw["swiftlang"] ?? "swiftlang Version Fault")
// will print 802.0.53
print(sw["clang"] ?? "clang Version Fault")
// will print 802.0.42
print(sw["Target"] ?? "Target Version Fault")
// will print x86_64-apple-macosx10.9let xcode = MacOSInfo.Xcode
if let v = xcode["CFBundleShortVersionString"] as? String {
print(v)
// will print 8.3.3
}MacOSInfo.Ping(ip: "github.com", timeout: 3) { metrics in
// ideally min/avg/max should be less than 20.0 ms
// stddev should be less than 3 ms
print(metrics["min"] ?? -1.0)
print(metrics["avg"] ?? -1.0)
print(metrics["max"] ?? -1.0)
print(metrics["stddev"] ?? -1.0)
}let docker = DockerCloud()
docker.speedTest { latency in
// normally latency is around 300 ms
print("docker cloud latency", latency)
}if let v = MacOSInfo.DockerVersion {
print(v)
// v looks like '17.07.0-ce-rc2, build 36ce605'
}if MacOSInfo.DockerApp {
print("Docker is running")
}
```