2014-03-08 00:59:40 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class Fzf < Formula
|
|
|
|
homepage "https://github.com/junegunn/fzf"
|
2014-06-17 15:58:10 +00:00
|
|
|
url "https://github.com/junegunn/fzf/archive/0.8.5.tar.gz"
|
|
|
|
sha1 "e834daa796de76e7726855b34052181effb1a4fc"
|
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-22 18:19:22 +00:00
|
|
|
assert_equal "world", `cat #{testpath}/list | #{bin}/fzf -f wld`.chomp
|
2014-03-08 00:59:40 +00:00
|
|
|
end
|
|
|
|
end
|