2012-01-11 04:05:04 +00:00
|
|
|
class Autojump < Formula
|
2014-10-24 18:04:58 +00:00
|
|
|
homepage "https://github.com/joelthelion/autojump"
|
2014-12-18 10:19:54 +00:00
|
|
|
url "https://github.com/joelthelion/autojump/archive/release-v22.2.2.tar.gz"
|
|
|
|
sha1 "d23d482077049fb07dcdc1e7764694f95937db24"
|
2012-01-11 04:05:04 +00:00
|
|
|
|
2014-10-24 18:04:58 +00:00
|
|
|
head "https://github.com/joelthelion/autojump.git"
|
2012-01-11 04:05:04 +00:00
|
|
|
|
|
|
|
def install
|
2014-12-18 10:19:54 +00:00
|
|
|
inreplace "bin/autojump.sh", " /usr/local/share/autojump/", " #{prefix}/etc/"
|
2014-01-08 07:58:34 +00:00
|
|
|
|
2014-10-24 18:04:58 +00:00
|
|
|
libexec.install "bin/autojump"
|
2014-12-18 10:19:54 +00:00
|
|
|
libexec.install "bin/autojump_argparse.py", "bin/autojump_data.py", "bin/autojump_utils.py"
|
2014-10-24 18:04:58 +00:00
|
|
|
man1.install "docs/autojump.1"
|
2014-12-22 14:08:15 +00:00
|
|
|
(prefix/"etc").install "bin/autojump.sh", "bin/autojump.bash", "bin/autojump.zsh",
|
|
|
|
"bin/autojump.fish", "bin/autojump.tcsh"
|
2014-10-24 18:04:58 +00:00
|
|
|
zsh_completion.install "bin/_j"
|
|
|
|
|
|
|
|
bin.write_exec_script libexec+"autojump"
|
2012-01-11 04:05:04 +00:00
|
|
|
end
|
|
|
|
|
2014-12-18 10:19:54 +00:00
|
|
|
def caveats; <<-EOS.undent
|
2012-11-01 09:41:44 +00:00
|
|
|
Add the following line to your ~/.bash_profile or ~/.zshrc file (and remember
|
|
|
|
to source the file to update your current session):
|
2014-12-20 17:32:14 +00:00
|
|
|
[[ -s $(brew --prefix)/etc/autojump.sh ]] && . $(brew --prefix)/etc/autojump.sh
|
2013-07-31 15:12:27 +00:00
|
|
|
|
2014-12-18 10:19:54 +00:00
|
|
|
Add the following line to your ~/.config/fish/config.fish:
|
2014-12-20 17:32:14 +00:00
|
|
|
. #{etc}/autojump.fish
|
2014-12-18 10:19:54 +00:00
|
|
|
EOS
|
|
|
|
end
|
2013-07-31 15:12:27 +00:00
|
|
|
|
2014-12-18 10:19:54 +00:00
|
|
|
test do
|
|
|
|
path = testpath/"foo"
|
|
|
|
path.mkdir
|
|
|
|
output = %x{
|
|
|
|
source #{HOMEBREW_PREFIX}/etc/autojump.sh
|
|
|
|
j -a foo
|
|
|
|
j foo >/dev/null
|
|
|
|
pwd
|
|
|
|
}.strip
|
|
|
|
assert_equal path.to_s, output
|
2012-01-11 04:05:04 +00:00
|
|
|
end
|
|
|
|
end
|