diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-05 15:00:00 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-05 15:00:00 -0800 |
commit | 686113531d23f30e9973d659c456ae33eb9cff1f (patch) | |
tree | f225de7251a8b49b8d183dd168bab0a0addbe23f /chef-config/lib/chef-config/path_helper.rb | |
parent | d1cf34b059a16a81e0fc48de52ba29863bb41fe6 (diff) | |
download | chef-686113531d23f30e9973d659c456ae33eb9cff1f.tar.gz |
autofixing whitespace cops
4174 Style/SpaceInsideHashLiteralBraces
1860 Style/SpaceAroundOperators
1336 Style/SpaceInsideBlockBraces
1292 Style/AlignHash
997 Style/SpaceAfterComma
860 Style/SpaceAroundEqualsInParameterDefault
310 Style/EmptyLines
294 Style/IndentationConsistency
267 Style/TrailingWhitespace
238 Style/ExtraSpacing
212 Style/SpaceBeforeBlockBraces
166 Style/MultilineOperationIndentation
144 Style/TrailingBlankLines
120 Style/EmptyLineBetweenDefs
101 Style/IndentationWidth
82 Style/SpaceAroundBlockParameters
40 Style/EmptyLinesAroundMethodBody
29 Style/EmptyLinesAroundAccessModifier
1 Style/RescueEnsureAlignment
Diffstat (limited to 'chef-config/lib/chef-config/path_helper.rb')
-rw-r--r-- | chef-config/lib/chef-config/path_helper.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/chef-config/lib/chef-config/path_helper.rb b/chef-config/lib/chef-config/path_helper.rb index 28c16cd608..7fc79ba4a9 100644 --- a/chef-config/lib/chef-config/path_helper.rb +++ b/chef-config/lib/chef-config/path_helper.rb @@ -36,7 +36,7 @@ module ChefConfig elsif slash == end_slash - 1 end_slash = slash else - return path[0..slash-1] + return path[0..slash - 1] end end else @@ -110,7 +110,7 @@ module ChefConfig end # Produces a comparable path. - def self.canonical_path(path, add_prefix=true) + def self.canonical_path(path, add_prefix = true) # First remove extra separators and resolve any relative paths abs_path = File.absolute_path(path) @@ -146,7 +146,7 @@ module ChefConfig # http://stackoverflow.com/questions/14127343 def self.escape_glob(*parts) path = cleanpath(join(*parts)) - path.gsub(/[\\\{\}\[\]\*\?]/) { |x| "\\"+x } + path.gsub(/[\\\{\}\[\]\*\?]/) { |x| "\\" + x } end def self.relative_path_from(from, to) @@ -233,18 +233,19 @@ module ChefConfig def self.is_sip_path?(path, node) if node["platform"] == "mac_os_x" and Gem::Version.new(node["platform_version"]) >= Gem::Version.new("10.11") # todo: parse rootless.conf for this? - sip_paths= [ - "/System", "/bin", "/sbin", "/usr" - ] - sip_paths.each do |sip_path| - ChefConfig.logger.info("This is a SIP path, checking if it in exceptions list.") - return true if path.start_with?(sip_path) - end - false + sip_paths = [ + "/System", "/bin", "/sbin", "/usr" + ] + sip_paths.each do |sip_path| + ChefConfig.logger.info("This is a SIP path, checking if it in exceptions list.") + return true if path.start_with?(sip_path) + end + false else false end end + # Determine if the given path is on the exception list for OS X System Integrity Protection. def self.writable_sip_path?(path) # todo: parse rootless.conf for this? @@ -261,4 +262,3 @@ module ChefConfig end end end - |