class Khal < Formula include Language::Python::Virtualenv desc "CLI calendar application." homepage "https://lostpackets.de/khal/" url "https://github.com/pimutils/khal.git", :tag => "v0.9.7", :revision => "c6116f4b88c9b53dafb3f15fea5d6732650438c3" head "https://github.com/pimutils/khal.git" bottle do cellar :any_skip_relocation sha256 "3e3f80decdcde93c0f7ab5062c45d6a6f9045a714019d0d5699837cc3eaa925a" => :high_sierra sha256 "9aa55f1e86b501fc5be3f634354c5365e822a891023d9dc746a23806af9efeda" => :sierra sha256 "357c3a04da612224e54f79cd4a8679c4116731b42858dc700c7cee72581f3e19" => :el_capitan end depends_on :python3 def install venv = virtualenv_create(libexec, "python3") system libexec/"bin/pip", "install", "-v", "--no-binary", ":all:", "--ignore-installed", buildpath system libexec/"bin/pip", "uninstall", "-y", name venv.pip_install_and_link buildpath end test do ENV["LC_ALL"] = "en_US.UTF-8" ENV["LANG"] = "en_US.UTF-8" (testpath/".calendar/test/01ef8547.ics").write <<-EOS.undent BEGIN:VCALENDAR VERSION:2.0 BEGIN:VEVENT DTSTART;VALUE=DATE:20130726 SUMMARY:testevent DTEND;VALUE=DATE:20130727 LAST-MODIFIED:20130725T142824Z DTSTAMP:20130725T142824Z CREATED:20130725T142824Z UID:01ef8547 END:VEVENT END:VCALENDAR EOS (testpath/".config/khal/config").write <<-EOS.undent [calendars] [[test]] path = #{testpath}/.calendar/test/ color = light gray [sqlite] path = #{testpath}/.calendar/khal.db [locale] firstweekday = 0 [default] default_calendar = test EOS system "#{bin}/khal", "--no-color", "search", "testevent" end end