Skip to content

Commit

Permalink
diary 0.15 (new formula)
Browse files Browse the repository at this point in the history
diary: improve tests
diary: update deps and livecheck

Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
in0rdr committed Jan 16, 2025
1 parent d554b84 commit af2e7f7
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Formula/d/diary.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
class Diary < Formula
desc "Text-based journaling program"
homepage "https://diary.p0c.ch"
url "https://code.in0rdr.ch/diary/archive/diary-v0.15.tar.gz"
sha256 "51103df0ddb33a1e86bb85e435ba7b7a5ba464ce49234961ca3e3325cd123d4c"
license "MIT"

livecheck do
url "https://code.in0rdr.ch/diary/archive/"
regex(/href=.*?diary-v?(\d+(?:\.\d+)+)\.t/i)
end

depends_on "pkgconf" => :build

uses_from_macos "curl"
uses_from_macos "libxml2"
uses_from_macos "ncurses"

def install
system "make"
system "make", "CC=#{ENV.cc}", "PREFIX=#{prefix}", "install"
end

test do
# Test version output matches the packaged version
assert_match version.to_s, shell_output("#{bin}/diary -v")

# There is only one configuration setting which is required to start the
# application, the diary directory.
#
# Test DIARY_DIR environment variable
assert_match "", shell_output("DIARY_DIR=na #{bin}/diary", 2)
# Test diary dir option
assert_match "", shell_output("#{bin}/diary -d na", 2)
end
end

0 comments on commit af2e7f7

Please sign in to comment.