Sha256: 3535c5f3d84196ec6591c3fb4e0de73016f015086bc1a42bd2caba96551b21eb
Contents?: true
Size: 794 Bytes
Versions: 9
Compression:
Stored size: 794 Bytes
Contents
# frozen_string_literal: true require_relative 'line' module Codeowners class Checker class Group # Define and manage comment line. class Comment < Line # Matches if the line is a comment. # @return [Boolean] if the line start with `#` def self.match?(line) line.start_with?('#') end # Return the comment level if the comment works like a markdown # headers. # @return [Integer] with the heading level. # # @example # Comment.new('# First level').level # => 1 # Comment.new('## Second').level # => 2 def level (@line[/^#+/] || '').size end end end end end require_relative 'group_begin_comment' require_relative 'group_end_comment'
Version data entries
9 entries across 9 versions & 2 rubygems