Class: Punchlist::Config
- Inherits:
-
Object
- Object
- Punchlist::Config
- Defined in:
- lib/punchlist/config.rb
Overview
Configuration for punchlist gem
Instance Attribute Summary collapse
-
#exclude ⇒ Object
readonly
Returns the value of attribute exclude.
-
#glob ⇒ Object
readonly
Returns the value of attribute glob.
-
#regexp ⇒ Object
readonly
Returns the value of attribute regexp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(regexp: nil, glob: nil, exclude: nil, source_file_globber:) ⇒ Config
constructor
A new instance of Config.
- #source_files ⇒ Object
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
#exclude ⇒ Object (readonly)
Returns the value of attribute exclude.
6 7 8 |
# File 'lib/punchlist/config.rb', line 6 def exclude @exclude end |
#glob ⇒ Object (readonly)
Returns the value of attribute glob.
6 7 8 |
# File 'lib/punchlist/config.rb', line 6 def glob @glob end |
#regexp ⇒ Object (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_string ⇒ Object
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_files ⇒ Object
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 |