aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/global.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-09-18 13:28:15 +0100
committerGitHub2016-09-18 13:28:15 +0100
commit59b7f16bfd9c1968aae0a2f1cd9a43d3d160d99f (patch)
tree17d2adec882cdeef36a8fd40d891fe7fe4021572 /Library/Homebrew/global.rb
parent56541001a45ea58c54096bc42584c17d72b1415a (diff)
parent1bdbb0f462e4c3557bbcba0b203696bdcf025bb4 (diff)
downloadbrew-59b7f16bfd9c1968aae0a2f1cd9a43d3d160d99f.tar.bz2
Merge pull request #989 from MikeMcQuaid/rubocop-final
Rubocop: apply auto-corrections and don't use hash-rockets
Diffstat (limited to 'Library/Homebrew/global.rb')
-rw-r--r--Library/Homebrew/global.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index 8472eba5c..91692c146 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -16,7 +16,7 @@ ARGV.extend(HomebrewArgvExtension)
HOMEBREW_PRODUCT = ENV["HOMEBREW_PRODUCT"]
HOMEBREW_VERSION = ENV["HOMEBREW_VERSION"]
-HOMEBREW_WWW = "http://brew.sh"
+HOMEBREW_WWW = "http://brew.sh".freeze
require "config"
@@ -26,7 +26,7 @@ RUBY_PATH = Pathname.new(RbConfig.ruby)
RUBY_BIN = RUBY_PATH.dirname
HOMEBREW_USER_AGENT_CURL = ENV["HOMEBREW_USER_AGENT_CURL"]
-HOMEBREW_USER_AGENT_RUBY = "#{ENV["HOMEBREW_USER_AGENT"]} ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
+HOMEBREW_USER_AGENT_RUBY = "#{ENV["HOMEBREW_USER_AGENT"]} ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}".freeze
HOMEBREW_CURL_ARGS = [
"--fail",
@@ -54,7 +54,13 @@ HOMEBREW_PULL_OR_COMMIT_URL_REGEX = %r[https://github\.com/([\w-]+)/([\w-]+)?/(?
require "compat" unless ARGV.include?("--no-compat") || ENV["HOMEBREW_NO_COMPAT"]
-ORIGINAL_PATHS = ENV["PATH"].split(File::PATH_SEPARATOR).map { |p| Pathname.new(p).expand_path rescue nil }.compact.freeze
+ORIGINAL_PATHS = ENV["PATH"].split(File::PATH_SEPARATOR).map do |p|
+ begin
+ Pathname.new(p).expand_path
+ rescue
+ nil
+ end
+end.compact.freeze
# TODO: remove this as soon as it's removed from commands.rb.
HOMEBREW_INTERNAL_COMMAND_ALIASES = {
@@ -71,5 +77,5 @@ HOMEBREW_INTERNAL_COMMAND_ALIASES = {
"dr" => "doctor",
"--repo" => "--repository",
"environment" => "--env",
- "--config" => "config"
-}
+ "--config" => "config",
+}.freeze