2018-11-27 05:24:56 +00:00
|
|
|
class Bluetoothconnector < Formula
|
|
|
|
desc "Connect and disconnect Bluetooth devices"
|
|
|
|
homepage "https://github.com/lapfelix/BluetoothConnector"
|
2019-01-27 22:20:44 +00:00
|
|
|
url "https://github.com/lapfelix/BluetoothConnector/archive/1.2.0.tar.gz"
|
|
|
|
sha256 "63cf474670041127effbeec8b84f9b84421f7cae74fb2908d6c10c2b331cb4be"
|
2018-11-27 05:24:56 +00:00
|
|
|
|
2019-01-23 04:30:35 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2019-02-05 20:23:23 +00:00
|
|
|
sha256 "5fac038a2fda3fdb144fb764166eeda3b31799caf1ce8e44a8f77bd5881daf1e" => :mojave
|
|
|
|
sha256 "5fac038a2fda3fdb144fb764166eeda3b31799caf1ce8e44a8f77bd5881daf1e" => :high_sierra
|
2019-01-23 04:30:35 +00:00
|
|
|
end
|
|
|
|
|
2018-11-27 05:24:56 +00:00
|
|
|
depends_on :xcode => ["10.0", :build]
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "swift", "build", "--disable-sandbox", "-c", "release", "-Xswiftc", "-static-stdlib"
|
|
|
|
bin.install ".build/release/BluetoothConnector"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
output = shell_output("#{bin}/BluetoothConnector")
|
|
|
|
assert_match "Usage: BluetoothConnector", output
|
|
|
|
assert_match "Get the MAC address from the list below", output
|
|
|
|
|
|
|
|
output_fail = shell_output("#{bin}/BluetoothConnector --connect 00-00-00-00-00-00", 252)
|
|
|
|
assert_equal "Not paired to device\n", output_fail
|
|
|
|
end
|
|
|
|
end
|