Skip to content

Commit

Permalink
Merge pull request #34 from origin/use-homebrew-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksieger committed Oct 11, 2016
2 parents 07549ab + 36aea43 commit 5f26f02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/brew/gem/formula.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class <%= klass %> < Formula
ENV['GEM_HOME']="#{prefix}"
ENV['GEM_PATH']="#{prefix}"
rubybindir = '<%= use_homebrew_ruby ? "/usr/local/bin" : "/usr/bin" %>'
rubybindir = '<%= use_homebrew_ruby ? "#{HOMEBREW_PREFIX}/bin" : "/usr/bin" %>'
gem_path = "#{rubybindir}/gem"
ruby_path = "#{rubybindir}/ruby"
system gem_path, "install", cached_download,
Expand Down
1 change: 1 addition & 0 deletions spec/brew/gem/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
it { is_expected.to match("rubybindir = '/usr/bin'") }

context "homebrew-ruby" do
before { stub_const 'HOMEBREW_PREFIX', '/usr/local' }
subject(:formula) { described_class.expand_formula("foo-bar", "1.2.3", true) }
it { is_expected.to match("rubybindir = '/usr/local/bin'") }
end
Expand Down

0 comments on commit 5f26f02

Please sign in to comment.