mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 14:29:31 +00:00
Merge pull request #1349 from bf4/allow_ruby_head_failures
Add more warnings ignore directories
This commit is contained in:
commit
4590161abc
@ -9,7 +9,11 @@ class CaptureWarnings
|
||||
@app_root ||= Dir.pwd
|
||||
@output_dir = File.join(app_root, 'tmp')
|
||||
FileUtils.mkdir_p(output_dir)
|
||||
@bundle_dir = File.join(app_root, 'bundle')
|
||||
@ignore_dirs = [
|
||||
File.join(app_root, '.bundle'),
|
||||
File.join(app_root, 'bundle'),
|
||||
File.join(app_root, 'vendor')
|
||||
]
|
||||
@output = STDOUT
|
||||
end
|
||||
|
||||
@ -28,7 +32,7 @@ class CaptureWarnings
|
||||
|
||||
def after_tests(lines)
|
||||
app_warnings, other_warnings = lines.partition do |line|
|
||||
line.include?(app_root) && !line.include?(bundle_dir)
|
||||
line.include?(app_root) && ignore_dirs.none? { |ignore_dir| line.include?(ignore_dir) }
|
||||
end
|
||||
|
||||
if app_warnings.any?
|
||||
@ -67,5 +71,5 @@ class CaptureWarnings
|
||||
|
||||
private
|
||||
|
||||
attr_reader :stderr_file, :app_root, :output_dir, :bundle_dir, :fail_on_warnings, :output
|
||||
attr_reader :stderr_file, :app_root, :output_dir, :ignore_dirs, :fail_on_warnings, :output
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user