-
-
Notifications
You must be signed in to change notification settings - Fork 12.3k
/
cqlkit.rb
32 lines (28 loc) · 1.39 KB
/
cqlkit.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
class Cqlkit < Formula
desc "CLI tool to export Cassandra query as CSV and JSON format"
homepage "https://github.com/tenmax/cqlkit"
url "https://github.com/tenmax/cqlkit/releases/download/v0.3.3/cqlkit-0.3.3.zip"
sha256 "0574b4b6fe893078e993a80f95a183b89955129ab8929f5032b7faacf611952c"
license "Apache-2.0"
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, all: "779b43c2485ff60acb753002f28e2d8f0efa87088ab29da8e1214ffe704d63ef"
end
depends_on "openjdk"
def install
libexec.install %w[bin lib]
rm_f Dir["#{libexec}/bin/*.bat"]
bin.install Dir["#{libexec}/bin/*"]
bin.env_script_all_files libexec/"bin", Language::Java.overridable_java_home_env
end
test do
output = shell_output("#{bin}/cql2cql -c localhost -q 'select peer from system.peers' 2>&1", 1)
assert_match(/.*Error: All host\(s\) tried for query failed.*/, output)
output = shell_output("#{bin}/cql2csv -c localhost -q 'select peer from system.peers' 2>&1", 1)
assert_match(/.*Error: All host\(s\) tried for query failed.*/, output)
output = shell_output("#{bin}/cql2json -c localhost -q 'select peer from system.peers' 2>&1", 1)
assert_match(/.*Error: All host\(s\) tried for query failed.*/, output)
output = shell_output("#{bin}/cqlkit -c localhost -q 'select peer from system.peers' 2>&1", 1)
assert_match(/.*Error: All host\(s\) tried for query failed.*/, output)
end
end