summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2016-02-16 10:51:11 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2016-02-16 19:07:55 -0800
commit4db706fcce25b6d269a1b232e316083ae1a45b9b (patch)
tree7be29c2e270499ea5bfdd7e3f2831b8f8d88cf23
parent2bfb3d37acdd9a71c17cd3ac28fed5e9e53de4ee (diff)
downloadchef-4db706fcce25b6d269a1b232e316083ae1a45b9b.tar.gz
Fix rubocop warnings
-rw-r--r--chef-config/lib/chef-config/path_helper.rb2
-rw-r--r--lib/chef/data_bag.rb5
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 2852055203..fb6615d741 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