Skip to content

Instantly share code, notes, and snippets.

@nicolas-brousse
Last active August 22, 2018 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicolas-brousse/9f054d5b865a07f61024cfb6c36b54f4 to your computer and use it in GitHub Desktop.
Save nicolas-brousse/9f054d5b865a07f61024cfb6c36b54f4 to your computer and use it in GitHub Desktop.
class Mailcatcher < Formula
desc "Catches mail and serves it through a dream."
homepage "https://github.com/sj26/mailcatcher"
url "https://github.com/sj26/mailcatcher/archive/v0.6.5.zip"
sha256 "393303738ec6c7e0254b22b3f6b8f7988363791890516f820e90372afef4d65c"
version "0.6.5"
def install
ENV["GEM_HOME"] = libexec
system "gem", "build", "mailcatcher.gemspec"
system "gem", "install", "mailcatcher-#{version}.gem"
# Other executables don't work currently.
bin.install libexec/"bin/mailcatcher"
bin.env_script_all_files(libexec/"bin", :GEM_HOME => ENV["GEM_HOME"])
end
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/mailcatcher</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
test do
system "#{bin}/mailcatcher", "--version"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment