lib/quality/rake/config.rb in quality-8.1.1 vs lib/quality/rake/config.rb in quality-9.0.0
- old
+ new
@@ -35,13 +35,20 @@
#
# Defaults to the same as ruby_dirs
attr_writer :source_dirs
# Pick any extra files that are source files, but may not have
- # extensions--defaults to ['Rakefile']
+ # extensions--defaults to %w(Rakefile Dockerfile)
attr_accessor :extra_files
+ # Extensions for Ruby language files--defaults to 'rb,rake'
+ attr_accessor :ruby_file_extensions
+
+ # Extensions for all source files--defaults to
+ # 'rb,rake,swift,cpp,c,java,py,clj,cljs,scala,js,yml,sh,json'
+ attr_accessor :source_file_extensions
+
# Pipe-separated regexp string describing what to look for in
# files as 'todo'-like 'punchlist' comments.
#
# Defaults to 'XXX|TODO'
attr_accessor :punchlist_regexp
@@ -59,15 +66,17 @@
def source_dirs
@source_dirs ||= ruby_dirs.clone
end
def extra_files
- @extra_files ||= ['Rakefile']
+ @extra_files ||= %w(Rakefile Dockerfile)
end
def source_file_extensions
- "#{ruby_file_extensions},swift,cpp,c,java,py,clj,cljs,scala,js"
+ @source_file_extensions ||=
+ "#{ruby_file_extensions},swift,cpp,c,java,py,clj,cljs,scala,js," \
+ 'yml,sh,json'
end
def source_files_glob(dirs = source_dirs,
extensions = source_file_extensions)
"{#{extra_files.join(',')}," +
@@ -76,10 +85,10 @@
"*.{#{extensions}}") +
'}'
end
def ruby_file_extensions
- 'rb,rake'
+ @ruby_file_extensions ||= 'rb,rake'
end
def ruby_files_glob
source_files_glob(ruby_dirs, ruby_file_extensions)
end