I’m reading some source code at https://github.com/plataformatec/devise and found that line of code:
class_eval <<-URL_HELPERS, __FILE__, __LINE__ + 1
What the params __FILE__ and __LINE__ + 1 does in block declaration (what changes in relation of a string block without these params)?
https://github.com/plataformatec/devise/blob/master/lib/devise/controllers/url_helpers.rb#L47
Thank
Those params belong to the class_eval method, not to the here document. It’s common practice to ensure that error, which can raise the evaled code, will be shown with a reference to the current file and with correct line number.