Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 Nov 4, 2018
1 parent 2837418 commit b4bf452
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Formula/ruby.rb
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b4bf452

Please sign in to comment.