Sha256: 9e3ecb17e1768b69bc02edb928da3d5330d6d1b4bec29c4826447e5f9178cc0d

Contents?: true

Size: 782 Bytes

Versions: 3

Compression:

Stored size: 782 Bytes

Contents

# frozen_string_literal: true

module Punchlist
  # Configuration for punchlist gem
  class Config
    attr_reader :regexp, :glob, :exclude

    def self.default_punchlist_line_regexp_string
      'XXX|TODO|FIXME|OPTIMIZE|HACK|REVIEW|LATER|FIXIT'
    end

    def source_files
      @source_file_globber.source_files_glob = glob if glob
      @source_file_globber.source_files_exclude_glob = exclude if exclude
      @source_file_globber.source_files_arr
    end

    def initialize(regexp: nil, glob: nil, exclude: nil,
                   source_file_globber:)
      @regexp = Regexp.new(regexp ||
                           Config.default_punchlist_line_regexp_string)
      @glob = glob
      @exclude = exclude
      @source_file_globber = source_file_globber
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
punchlist-1.3.2 lib/punchlist/config.rb
punchlist-1.3.1 lib/punchlist/config.rb
punchlist-1.3.0 lib/punchlist/config.rb