Class: Defmastership::Core::ParsingState
- Inherits:
-
Object
- Object
- Defmastership::Core::ParsingState
- Defined in:
- lib/defmastership/core/parsing_state.rb
Overview
Allow to know if we need to parse the line or simply ignore it
Instance Method Summary collapse
- #enabled?(line) ⇒ Boolean
-
#initialize ⇒ ParsingState
constructor
mutant:disable (for mutant, aatribute initialization is useless).
Constructor Details
#initialize ⇒ ParsingState
mutant:disable (for mutant, aatribute initialization is useless)
12 13 14 |
# File 'lib/defmastership/core/parsing_state.rb', line 12 def initialize @last_disabling_line = nil end |
Instance Method Details
#enabled?(line) ⇒ Boolean
16 17 18 19 20 21 22 23 |
# File 'lib/defmastership/core/parsing_state.rb', line 16 def enabled?(line) return false if line.match?(DMRegexp::SINGLE_LINE_COMMENT) line = line.chomp possibly_invert_last_disabling_line(line) if ['....', '----', '////'].include?(line) !@last_disabling_line end |