Class: Byebug::Skipper::SkipBangCommand
- Inherits:
-
Byebug::SkipCommand
- Object
- Byebug::SkipCommand
- Byebug::Skipper::SkipBangCommand
- Defined in:
- lib/byebug/skipper/skip_bang_command.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize_attributes ⇒ Object
This method gets run once when the command starts.
Class Method Details
.description ⇒ Object
11 12 13 |
# File 'lib/byebug/skipper/skip_bang_command.rb', line 11 def self.description short_description end |
.regexp ⇒ Object
3 4 5 |
# File 'lib/byebug/skipper/skip_bang_command.rb', line 3 def self.regexp /^ \s* skip! \s* $/x end |
.short_description ⇒ Object
7 8 9 |
# File 'lib/byebug/skipper/skip_bang_command.rb', line 7 def self.short_description "Same as `skip` but also comments out the line before the current one (where `byebug` or `binding.pry` usually is)" end |
Instance Method Details
#initialize_attributes ⇒ Object
This method gets run once when the command starts. After that, ‘#execute` gets called repeatedly from different locations, so we can’t use it without adding random commented lines everywhere.
18 19 20 21 |
# File 'lib/byebug/skipper/skip_bang_command.rb', line 18 def initialize_attributes CommentLineAbove.(context.location) super end |