Permalink
Browse files

ruby: make keg-only (as provided by macOS).

This makes it consistent with the other Ruby formulae and avoids weird
PATH issues (exactly what keg-only is designed for).
  • Loading branch information...
MikeMcQuaid committed Oct 30, 2018
1 parent 2837418 commit b4bf45228a60a9a64a0f17d0374b27ffe84c862c
Showing with 11 additions and 1 deletion.
  1. +11 −1 Formula/ruby.rb
@@ -15,6 +15,8 @@ class Ruby < Formula
depends_on "autoconf" => :build
end

keg_only :provided_by_macos

depends_on "pkg-config" => :build
depends_on "libyaml"
depends_on "openssl"
@@ -33,7 +35,7 @@ def api_version
end

def rubygems_bindir
HOMEBREW_PREFIX/"bin"
HOMEBREW_PREFIX/"lib/ruby/gems/#{api_version}/bin"
end

def install
@@ -184,6 +186,14 @@ def self.ruby
EOS
end

def caveats; <<~EOS
By default, binaries installed by gem will be placed into:
#{rubygems_bindir}
You may want to add this to your PATH.
EOS
end

test do
hello_text = shell_output("#{bin}/ruby -e 'puts :hello'")
assert_equal "hello\n", hello_text

0 comments on commit b4bf452

Please sign in to comment.