-
Notifications
You must be signed in to change notification settings - Fork 96
/
xray-daemon.rb
35 lines (29 loc) · 1.01 KB
/
xray-daemon.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf-8 -*-
require_relative '../ConfigProvider/config_provider'
class XrayDaemon < Formula
$config_provider = ConfigProvider.new('xray-daemon')
desc "The AWS X-Ray daemon listens for traffic on UDP port 2000, gathers raw segment data, and relays it to the AWS X-Ray API."
homepage "https://github.com/aws/aws-xray-daemon/"
version $config_provider.version
if OS.mac?
url "#{$config_provider.root_url}/aws-xray-daemon-macos-#{$config_provider.version}.zip"
sha256 $config_provider.sierra_hash
elsif OS.linux?
if Hardware::CPU.intel?
url "#{$config_provider.root_url}/aws-xray-daemon-linux-#{$config_provider.version}.zip"
sha256 $config_provider.linux_hash
end
end
def install
if OS.mac?
bin.install "xray_mac"
mv bin/"xray_mac", bin/"#{$config_provider.bin}"
else
bin.install "xray"
mv bin/"xray", bin/"#{$config_provider.bin}"
end
end
test do
assert_match "Usage", shell_output("#{bin}/#{$config_provider.bin} --help")
end
end