summaryrefslogtreecommitdiff
path: root/lib/chef/cookbook/syntax_check.rb
diff options
context:
space:
mode:
authorMatt Veitas <mveitas@gmail.com>2014-03-10 19:01:46 -0400
committerBryan McLellan <btm@getchef.com>2014-03-28 16:16:47 -0700
commit8f40a3d5ea3db77804852e48b187cf3ae85fc236 (patch)
treee464419d126d48356eea715c3b8d7bbefc6c5c23 /lib/chef/cookbook/syntax_check.rb
parent6c9dbd230d052c0c4cb5a7cf32eca244f2406e30 (diff)
downloadchef-8f40a3d5ea3db77804852e48b187cf3ae85fc236.tar.gz
Use an attr_accessor instead of referencing the instance variable directly
Diffstat (limited to 'lib/chef/cookbook/syntax_check.rb')
-rw-r--r--lib/chef/cookbook/syntax_check.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/cookbook/syntax_check.rb b/lib/chef/cookbook/syntax_check.rb
index 0f0fe3255b..effc7dd01d 100644
--- a/lib/chef/cookbook/syntax_check.rb
+++ b/lib/chef/cookbook/syntax_check.rb
@@ -77,6 +77,8 @@ class Chef
# validated.
attr_reader :validated_files
+ attr_reader :chefignore
+
# Creates a new SyntaxCheck given the +cookbook_name+ and a +cookbook_path+.
# If no +cookbook_path+ is given, +Chef::Config.cookbook_path+ is used.
def self.for_cookbook(cookbook_name, cookbook_path=nil)
@@ -98,12 +100,12 @@ class Chef
end
def remove_ignored_files(file_list)
- return file_list unless @chefignore.ignores.length > 0
+ return file_list unless chefignore.ignores.length > 0
file_list.reject do |full_path|
cookbook_pn = Pathname.new cookbook_path
full_pn = Pathname.new full_path
relative_pn = full_pn.relative_path_from cookbook_pn
- @chefignore.ignored? relative_pn.to_s
+ chefignore.ignored? relative_pn.to_s
end
end