Sha256: 59e3360107fe069c31575ca1985641d35a1324c4b7f2645947529d24186c4ceb
Contents?: true
Size: 659 Bytes
Versions: 6885
Compression:
Stored size: 659 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop # Common functionality for working with heredoc strings. module Heredoc OPENING_DELIMITER = /(<<[~-]?)['"`]?([^'"`]+)['"`]?/.freeze def on_str(node) return unless node.heredoc? on_heredoc(node) end alias on_dstr on_str alias on_xstr on_str def on_heredoc(_node) raise NotImplementedError end private def delimiter_string(node) node.source.match(OPENING_DELIMITER).captures[1] end def heredoc_type(node) node.source.match(OPENING_DELIMITER).captures[0] end end end end
Version data entries
6,885 entries across 6,859 versions & 31 rubygems