class Pyenv < Formula desc "Python version management" homepage "https://github.com/yyuu/pyenv" url "https://github.com/yyuu/pyenv/archive/v1.0.8.tar.gz" sha256 "601bdb967289fa1afec9c08f375bf3e456733b08ced32774227113a16d5718d6" version_scheme 1 head "https://github.com/yyuu/pyenv.git" bottle :unneeded depends_on "autoconf" => [:recommended, :run] depends_on "pkg-config" => [:recommended, :run] depends_on "openssl" => :recommended depends_on "readline" => [:recommended, :run] def install inreplace "libexec/pyenv", "/usr/local", HOMEBREW_PREFIX prefix.install Dir["*"] %w[pyenv-install pyenv-uninstall python-build].each do |cmd| bin.install_symlink "#{prefix}/plugins/python-build/bin/#{cmd}" end end test do shell_output("eval \"$(#{bin}/pyenv init -)\" && pyenv versions") end end