Sha256: 2f578b500b37a57d582f7d62a5d4085a557034215bf452e107c3363f12d5fb21
Contents?: true
Size: 725 Bytes
Versions: 14
Compression:
Stored size: 725 Bytes
Contents
# frozen_string_literal: true module Mutant class Subject class Config include Adamantium, Anima.new(:inline_disable, :mutation) DEFAULT = new(inline_disable: false, mutation: Mutation::Config::DEFAULT) DISABLE_REGEXP = /(\s|^)mutant:disable(?:\s|$)/.freeze SYNTAX_REGEXP = /\A(?:#|=begin\n)/.freeze def self.parse(comments:, mutation:) new( inline_disable: comments.any? { |comment| DISABLE_REGEXP.match?(comment_body(comment)) }, mutation: mutation ) end def self.comment_body(comment) comment.text.sub(SYNTAX_REGEXP, '') end private_class_method :comment_body end # Config end # Subject end # Mutant
Version data entries
14 entries across 14 versions & 1 rubygems