Skip to content

Commit

Permalink
Merge pull request #1419 from jcouball/main
Browse files Browse the repository at this point in the history
Only call Object#taint when the taint method exists
  • Loading branch information
lsegal authored Jan 3, 2022
2 parents d623e5f + 7dca12c commit 7f399d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/yard/cli/stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ def general_options(opts)
end

opts.on('--query QUERY', "Only includes objects that match a specific query") do |query|
options[:verifier].add_expressions(query.taint)
query.taint if query.respond_to?(:taint)
options[:verifier].add_expressions(query)
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/yard/cli/yardoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ def output_options(opts)

opts.on('--query QUERY', "Only show objects that match a specific query") do |query|
next if YARD::Config.options[:safe_mode]
options.verifier.add_expressions(query.taint)
query.taint if query.respond_to?(:taint)
options.verifier.add_expressions(query)
end

opts.on('--title TITLE', 'Add a specific title to HTML documents') do |title|
Expand Down
4 changes: 3 additions & 1 deletion lib/yard/templates/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ def include_inherited(full_paths)
def load_setup_rb
setup_file = File.join(full_path, 'setup.rb')
if File.file? setup_file
module_eval(File.read(setup_file).taint, setup_file, 1)
setup_code = File.read(setup_file)
setup_code.taint if setup_code.respond_to?(:taint)
module_eval(setup_code, setup_file, 1)
end
end
end
Expand Down

0 comments on commit 7f399d3

Please sign in to comment.