summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVivek Singh <vivek.singh@msystechnologies.com>2019-09-25 17:42:05 +0530
committerVivek Singh <vivek.singh@msystechnologies.com>2019-10-28 14:06:22 +0530
commit377861d1f1dcd93f39f1e8596db50a63f7650ca2 (patch)
tree62f4a5c848fdf2c21ce857aa55e8cee3f064207a /lib
parent752e5f869506866a503fe8c8a789c4c94205e6c4 (diff)
downloadchef-377861d1f1dcd93f39f1e8596db50a63f7650ca2.tar.gz
Add chefignore method to ChefRepositoryFileSystemCookbookDir
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb
index 74170cc7a9..f75251a99b 100644
--- a/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb
+++ b/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_cookbook_dir.rb
@@ -21,6 +21,7 @@ require_relative "../chef_server/cookbook_dir"
require_relative "../chef_server/versioned_cookbook_dir"
require_relative "../exceptions"
require_relative "../../../cookbook/cookbook_version_loader"
+require_relative "../../../cookbook/chefignore"
class Chef
module ChefFS
@@ -31,6 +32,11 @@ class Chef
class ChefRepositoryFileSystemCookbookDir < ChefRepositoryFileSystemCookbookEntry
# API Required by Respository::Directory
+ def chefignore
+ @chefignore ||= Chef::Cookbook::Chefignore.new(file_path)
+ rescue Errno::EISDIR, Errno::EACCES
+ # Work around a bug in Chefignore when chefignore is a directory
+ end
def fs_entry_valid?
return false unless File.directory?(file_path) && name_valid?