Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rubocop: disable Performance/RedundantBlockCall
It suggests changes like this: diff --git a/lib/tasks/book2.rake b/lib/tasks/book2.rake index 046f35f3..f083f25a 100644 --- a/lib/tasks/book2.rake +++ b/lib/tasks/book2.rake @@ -11,9 +11,9 @@ def expand(content, path, &get_content) else new_fname = (Pathname.new(path).dirname + Pathname.new($1)).cleanpath.to_s end - new_content = get_content.call(new_fname) + new_content = yield(new_fname) if new_content - expand(new_content.gsub("\xEF\xBB\xBF".force_encoding("UTF-8"), ""), new_fname) { |c| get_content.call (c) } + expand(new_content.gsub("\xEF\xBB\xBF".force_encoding("UTF-8"), ""), new_fname) { |c| yield (c) } else puts "#{new_fname} could not be resolved for expansion" "" That's not wrong, but it seems weird to me to yield in a function that takes a bunch of parameters. Yes, the get_content function passed in _happens_ to be the final one, but it doesn't have to be.
- Loading branch information