Class: Punchlist::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/punchlist/config.rb

Overview

Configuration for punchlist gem

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(regexp: nil, glob: nil, exclude: nil, source_file_globber:) ⇒ Config

Returns a new instance of Config.



18
19
20
21
22
23
24
25
# File 'lib/punchlist/config.rb', line 18

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

Instance Attribute Details

#excludeObject (readonly)

Returns the value of attribute exclude.



6
7
8
# File 'lib/punchlist/config.rb', line 6

def exclude
  @exclude
end

#globObject (readonly)

Returns the value of attribute glob.



6
7
8
# File 'lib/punchlist/config.rb', line 6

def glob
  @glob
end

#regexpObject (readonly)

Returns the value of attribute regexp.



6
7
8
# File 'lib/punchlist/config.rb', line 6

def regexp
  @regexp
end

Class Method Details

.default_punchlist_line_regexp_stringObject



8
9
10
# File 'lib/punchlist/config.rb', line 8

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

Instance Method Details

#source_filesObject



12
13
14
15
16
# File 'lib/punchlist/config.rb', line 12

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