Skip to content

Commit

Permalink
cascadia: add 1.2.7 bottle.
Browse files Browse the repository at this point in the history
  • Loading branch information
gromgit committed Jan 31, 2023
1 parent 5b8d6d5 commit b9a6e1c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Formula/cascadia.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class Cascadia < Formula
desc "Go cascadia package command-line CSS selector"
homepage "https://github.com/suntong/cascadia"
url "https://github.com/suntong/cascadia/archive/refs/tags/v1.2.7.tar.gz"
sha256 "ff314144fdab70a7347b0c1a27b5e6628abe72827947e3cb571cebd385fd61df"
license "MIT"
head "https://github.com/suntong/cascadia.git", branch: "master"

bottle do
root_url "https://github.com/gromgit/homebrew-core-mojave/releases/download/cascadia"
sha256 cellar: :any_skip_relocation, mojave: "39f39f9d63779b7815d38fa8b2a1988dac97034a84bd4ab2f19fd3b0340ce2d7"
end

depends_on "go" => :build

def install
system "go", "build", *std_go_args(ldflags: "-s -w")
end

test do
assert_match "Version #{version}", shell_output("#{bin}/cascadia --help")

test_html = "<foo><bar>aaa</bar><baz>bbb</baz></foo>"
test_css_selector = "foo > bar"
expected_html_output = "<bar>aaa</bar>"
assert_equal expected_html_output,
pipe_output("#{bin}/cascadia --in --out --css '#{test_css_selector}'", test_html).strip
end
end

0 comments on commit b9a6e1c

Please sign in to comment.