Sha256: cd86e9c2f99c8c0b457efc33015a96d4317800c1b6f7c335173283af53f842ce
Contents?: true
Size: 500 Bytes
Versions: 73
Compression:
Stored size: 500 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module RSpec # Helps find the true end location of nodes which might contain heredocs. module FinalEndLocation def final_end_location(start_node) heredoc_endings = start_node.each_node(:str, :dstr, :xstr) .select(&:heredoc?) .map { |node| node.loc.heredoc_end } [start_node.loc.end, *heredoc_endings].max_by(&:line) end end end end end
Version data entries
73 entries across 67 versions & 7 rubygems