diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2016-02-16 10:51:11 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2016-02-16 15:51:13 -0800 |
commit | de67115e7cd215a6b1d7a894a5d78228a81e6d87 (patch) | |
tree | 680705c48f79f01b1889f20a58efa54845296185 | |
parent | 454a326105e430c4915758c1e70aa2e2eb796bd4 (diff) | |
download | chef-jdm/4915.tar.gz |
Fix rubocop warningsjdm/4915
-rw-r--r-- | chef-config/lib/chef-config/path_helper.rb | 2 | ||||
-rw-r--r-- | lib/chef/data_bag.rb | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/chef-config/lib/chef-config/path_helper.rb b/chef-config/lib/chef-config/path_helper.rb index 8fc6fbdff8..10384974c7 100644 --- a/chef-config/lib/chef-config/path_helper.rb +++ b/chef-config/lib/chef-config/path_helper.rb @@ -154,7 +154,7 @@ module ChefConfig # This is because only forwardslashes should be used with dir (even for windows) def self.escape_glob_dir(*parts) path = Pathname.new(join(*parts)).cleanpath.to_s - path.gsub(/[\\\{\}\[\]\*\?]/) { |x| "\\"+x } + path.gsub(/[\\\{\}\[\]\*\?]/) { |x| "\\" + x } end def self.relative_path_from(from, to) diff --git a/lib/chef/data_bag.rb b/lib/chef/data_bag.rb index d9b2f4180d..f4642e255f 100644 --- a/lib/chef/data_bag.rb +++ b/lib/chef/data_bag.rb @@ -98,8 +98,9 @@ class Chef unless File.directory?(path) raise Chef::Exceptions::InvalidDataBagPath, "Data bag path '#{path}' is invalid" end - - names += Dir.glob(File.join(Chef::Util::PathHelper.escape_glob_dir(path), "*")).map{|f|File.basename(f)}.sort + + names += Dir.glob(File.join( + Chef::Util::PathHelper.escape_glob_dir(path), "*")).map { |f| File.basename(f) }.sort end names.inject({}) { |h, n| h[n] = n; h } else |