Skip to content

Commit

Permalink
Merge pull request #525 from gjtorikian/ua-on-cli
Browse files Browse the repository at this point in the history
Don't set blank hash values
  • Loading branch information
gjtorikian authored Jul 17, 2019
2 parents 86180ac + 4050516 commit 744509c
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions bin/htmlproofer
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,24 @@ Mercenary.program(:htmlproofer) do |p|
options[:error_sort] = opts['error-sort'].to_sym unless opts['error-sort'].nil?
options[:log_level] = opts['log_level'].to_sym unless opts['log_level'].nil?

# FIXME: this is gross
options[:validation] = {}
options[:validation][:report_script_embeds] = opts['report_script_embeds']
options[:validation][:report_missing_names] = opts['report_missing_names']
options[:validation][:report_invalid_tags] = opts['report_invalid_tags']

options[:typhoeus] = {}
options[:typhoeus] = HTMLProofer::Configuration.parse_json_option('typhoeus_config', opts['typhoeus_config'])

options[:cache] = {}
options[:cache][:timeframe] = opts['timeframe'] unless opts['timeframe'].nil?
options[:cache][:storage_dir] = opts['storage_dir'] unless opts['storage_dir'].nil?
options[:validation] = HTMLProofer::Configuration::VALIDATION_DEFAULTS.dup
options[:validation][:report_script_embeds] = opts['report_script_embeds'] unless opts['report_script_embeds'].nil?
options[:validation][:report_missing_names] = opts['report_missing_names'] unless opts['report_missing_names'].nil?
options[:validation][:report_invalid_tags] = opts['report_invalid_tags'] unless opts['report_invalid_tags'].nil?

unless opts['typhoeus_config'].nil?
options[:typhoeus] = HTMLProofer::Configuration.parse_json_option('typhoeus_config', opts['typhoeus_config'])
end

unless opts['timeframe'].nil?
options[:cache] ||= {}
options[:cache][:timeframe] = opts['timeframe'] unless opts['timeframe'].nil?
end

unless opts['storage_dir'].nil?
options[:cache] ||= {}
options[:cache][:storage_dir] = opts['storage_dir'] unless opts['storage_dir'].nil?
end

options[:http_status_ignore] = Array(options[:http_status_ignore]).map(&:to_i)

Expand Down

0 comments on commit 744509c

Please sign in to comment.