aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils/shell.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-09-11 17:47:04 +0100
committerMike McQuaid2016-09-11 19:13:00 +0100
commitaa3d53f249a7afcaa76fc7652380dfc4099c66bf (patch)
tree4d671d098b047472cd9f046625656688aa49f5af /Library/Homebrew/utils/shell.rb
parentecf46b841b24fe650504a7388f25d1093189a09d (diff)
downloadbrew-aa3d53f249a7afcaa76fc7652380dfc4099c66bf.tar.bz2
utils/shell: fix Rubocop warnings.
Diffstat (limited to 'Library/Homebrew/utils/shell.rb')
-rw-r--r--Library/Homebrew/utils/shell.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/utils/shell.rb b/Library/Homebrew/utils/shell.rb
index c1a8f95b7..731277982 100644
--- a/Library/Homebrew/utils/shell.rb
+++ b/Library/Homebrew/utils/shell.rb
@@ -10,7 +10,7 @@ module Utils
}.freeze
module Shell
- UNSAFE_SHELL_CHAR = /([^A-Za-z0-9_\-.,:\/@\n])/
+ UNSAFE_SHELL_CHAR = %r{([^A-Za-z0-9_\-.,:\/@\n])}
# take a path and heuristically convert it
# to a shell name, return nil if there's no match
@@ -45,7 +45,7 @@ module Utils
str
end
module_function :csh_quote
-
+
def sh_quote(str)
# ruby's implementation of shell_escape
str = str.to_s
@@ -81,7 +81,7 @@ module Utils
module_function :shell_profile
def prepend_path_in_shell_profile(path)
- case preferred_shell
+ case preferred_shell
when :bash, :ksh, :sh, :zsh, nil
"echo 'export PATH=\"#{sh_quote(path)}:$PATH\"' >> #{shell_profile}"
when :csh, :tcsh