2019-01-20 07:02:11 +00:00
|
|
|
class Anyenv < Formula
|
|
|
|
desc "All in one for **env"
|
|
|
|
homepage "https://anyenv.github.io/"
|
2019-04-07 08:35:16 +00:00
|
|
|
url "https://github.com/anyenv/anyenv/archive/v1.1.0.tar.gz"
|
|
|
|
sha256 "43d51b31b4efccc52cd48290d565d33ee8ef9fc9dbcf635909481744e9898617"
|
2019-01-20 07:02:11 +00:00
|
|
|
|
2019-01-25 15:01:01 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2019-04-07 08:41:14 +00:00
|
|
|
sha256 "f36c96fb9dce2d36e6d67aaf1aa8fc846983333b101816ff6a78ae5b68135a08" => :mojave
|
|
|
|
sha256 "f36c96fb9dce2d36e6d67aaf1aa8fc846983333b101816ff6a78ae5b68135a08" => :high_sierra
|
|
|
|
sha256 "021fa6c226fdd920311d5fb871dd8befe70690b14bd2e03365059f0a011973f8" => :sierra
|
2019-01-25 15:01:01 +00:00
|
|
|
end
|
|
|
|
|
2019-01-20 07:02:11 +00:00
|
|
|
def install
|
|
|
|
prefix.install %w[bin completions libexec]
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
Dir.mktmpdir do |dir|
|
|
|
|
profile = "#{dir}/.profile"
|
|
|
|
File.open(profile, "w") do |f|
|
|
|
|
content = <<~EOS
|
|
|
|
export ANYENV_ROOT=#{dir}/anyenv
|
|
|
|
export ANYENV_DEFINITION_ROOT=#{dir}/anyenv-install
|
|
|
|
eval "$(anyenv init -)"
|
|
|
|
EOS
|
|
|
|
f.write(content)
|
|
|
|
end
|
|
|
|
|
|
|
|
cmds = <<~EOS
|
|
|
|
anyenv install --force-init
|
|
|
|
anyenv install --list
|
|
|
|
anyenv install rbenv
|
|
|
|
rbenv install --list
|
|
|
|
EOS
|
|
|
|
cmds.split("\n").each do |cmd|
|
|
|
|
shell_output("source #{profile} && #{cmd}")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|