aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMartin Afanasjew2016-05-26 16:27:53 +0200
committerMartin Afanasjew2016-05-26 16:27:53 +0200
commite517e2e41d2166d967a5ca8a71d4e178804a360c (patch)
treeda677bc5975e7afe58bfefbbcce39337fe38b2a0 /Library
parent75ab94c8ea8940f1609e62d23d45d8729dd4a83f (diff)
downloadbrew-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.rb12
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