2014-03-08 00:59:40 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class Fzf < Formula
|
|
|
|
homepage "https://github.com/junegunn/fzf"
|
2014-08-16 17:31:12 +00:00
|
|
|
url "https://github.com/junegunn/fzf/archive/0.8.7.tar.gz"
|
|
|
|
sha1 "1b40452c5d9707de269b31ec83bb0ae7e1f00504"
|
2014-03-08 00:59:40 +00:00
|
|
|
|
|
|
|
def install
|
2014-06-17 15:58:10 +00:00
|
|
|
prefix.install "install", "uninstall", "fzf", "fzf-completion.bash", "fzf-completion.zsh"
|
2014-03-08 00:59:40 +00:00
|
|
|
bin.install_symlink prefix/"fzf"
|
2014-03-30 16:07:39 +00:00
|
|
|
(prefix/"plugin").install "plugin/fzf.vim"
|
2014-03-08 00:59:40 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
To install useful keybindings and fuzzy completion:
|
|
|
|
#{prefix}/install
|
2014-03-30 16:07:39 +00:00
|
|
|
|
|
|
|
To use fzf in Vim, add the following line to your .vimrc:
|
|
|
|
set rtp+=#{prefix}
|
2014-03-08 00:59:40 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"list").write %w[hello world].join($/)
|
2014-05-04 19:12:41 +00:00
|
|
|
assert_equal "world", shell_output("cat #{testpath}/list | #{bin}/fzf -f wld").chomp
|
2014-03-08 00:59:40 +00:00
|
|
|
end
|
|
|
|
end
|