diff options
| author | Martin Afanasjew | 2016-05-26 16:27:53 +0200 |
|---|---|---|
| committer | Martin Afanasjew | 2016-05-26 16:27:53 +0200 |
| commit | e517e2e41d2166d967a5ca8a71d4e178804a360c (patch) | |
| tree | da677bc5975e7afe58bfefbbcce39337fe38b2a0 /Library | |
| parent | 75ab94c8ea8940f1609e62d23d45d8729dd4a83f (diff) | |
| download | brew-e517e2e41d2166d967a5ca8a71d4e178804a360c.tar.bz2 | |
utils: avoid using 'gem' as an identifier (#278)
Avoid breaking code highlighting of some editors (e.g. Sublime Text)
when `gem` is used as an identifier. This messes up the highlighting
below the first use and makes working with the file rather annoying.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/utils.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 6502d5070..caa1a87e2 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -242,7 +242,7 @@ module Homebrew end end - def self.install_gem_setup_path!(gem, version = nil, executable = gem) + def self.install_gem_setup_path!(name, version = nil, executable = name) require "rubygems" # Add Gem binary directory and (if missing) Ruby binary directory to PATH. @@ -251,9 +251,9 @@ module Homebrew path.unshift("#{Gem.user_dir}/bin") ENV["PATH"] = path.join(File::PATH_SEPARATOR) - if Gem::Specification.find_all_by_name(gem, version).empty? - ohai "Installing or updating '#{gem}' gem" - install_args = %W[--no-ri --no-rdoc --user-install #{gem}] + if Gem::Specification.find_all_by_name(name, version).empty? + ohai "Installing or updating '#{name}' gem" + install_args = %W[--no-ri --no-rdoc --user-install #{name}] install_args << "--version" << version if version # Do `gem install [...]` without having to spawn a separate process or @@ -267,12 +267,12 @@ module Homebrew rescue Gem::SystemExitException => e exit_code = e.exit_code end - odie "Failed to install/update the '#{gem}' gem." if exit_code != 0 + odie "Failed to install/update the '#{name}' gem." if exit_code != 0 end unless which executable odie <<-EOS.undent - The '#{gem}' gem is installed but couldn't find '#{executable}' in the PATH: + The '#{name}' gem is installed but couldn't find '#{executable}' in the PATH: #{ENV["PATH"]} EOS end |
