提交 37f15593 编写于 作者: J Justin

Merge pull request #344 from presidentbeef/allow_empty_config_file

Allow empty Brakeman config file
......@@ -91,11 +91,17 @@ module Brakeman
#Load configuration file
if config = config_file(custom_location)
options = YAML.load_file config
options.each { |k, v| options[k] = Set.new v if v.is_a? Array }
# notify if options[:quiet] and quiet is nil||false
notify "[Notice] Using configuration in #{config}" unless (options[:quiet] || quiet)
options
if options
options.each { |k, v| options[k] = Set.new v if v.is_a? Array }
# notify if options[:quiet] and quiet is nil||false
notify "[Notice] Using configuration in #{config}" unless (options[:quiet] || quiet)
options
else
notify "[Notice] Empty configuration file: #{config}" unless quiet
{}
end
else
{}
end
......
abort "Please run using test/test.rb" unless defined? BrakemanTester
Rails3 = BrakemanTester.run_scan "rails3", "Rails 3", :rails3 => true
Rails3 = BrakemanTester.run_scan "rails3", "Rails 3", :rails3 => true,
:config_file => File.join(TEST_PATH, "apps", "rails3", "config", "brakeman.yml")
class Rails3Tests < Test::Unit::TestCase
include BrakemanTester::FindWarning
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册