Class: PuppetDebugServer::DebugSession::PuppetSessionRunMode
- Inherits:
-
Object
- Object
- PuppetDebugServer::DebugSession::PuppetSessionRunMode
- Defined in:
- lib/puppet-debugserver/debug_session/puppet_session_run_mode.rb
Overview
The run mode and configuration for a Debug Session.
Instance Attribute Summary collapse
-
#mode ⇒ Symbol
The run mode fo the debug session.
-
#options ⇒ Hash
Any options associated with the current mode.
Instance Method Summary collapse
-
#initialize(mode = :run, options = {}) ⇒ PuppetSessionRunMode
constructor
A new instance of PuppetSessionRunMode.
-
#next!(pops_depth_level) ⇒ Object
Configures the run_mode for “next”-ing through a debug session.
-
#run! ⇒ Object
Configures the run_mode for “continue until a breakpoint is hit.
-
#step_in! ⇒ Object
Configures the run_mode for “stepping in” a debug session.
-
#step_out!(pops_depth_level) ⇒ Object
Configures the run_mode for “stepping out” a debug session.
Constructor Details
#initialize(mode = :run, options = {}) ⇒ PuppetSessionRunMode
Returns a new instance of PuppetSessionRunMode.
18 19 20 21 22 23 24 25 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_run_mode.rb', line 18 def initialize(mode = :run, = {}) raise "Invalid mode #{mode}" unless %i[run stepin next stepout].include?(mode) @mode = mode @options = @run_mode_mutex = Mutex.new end |
Instance Attribute Details
#mode ⇒ Symbol
The run mode fo the debug session. Either run, stepin, next, or stepout
9 10 11 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_run_mode.rb', line 9 def mode @mode end |
#options ⇒ Hash
Any options associated with the current mode.
14 15 16 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_run_mode.rb', line 14 def @options end |
Instance Method Details
#next!(pops_depth_level) ⇒ Object
Configures the run_mode for “next”-ing through a debug session.
37 38 39 40 41 42 43 44 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_run_mode.rb', line 37 def next!(pops_depth_level) @run_mode_mutex.synchronize do @mode = :next @options = { pops_depth_level: pops_depth_level } end end |
#run! ⇒ Object
Configures the run_mode for “continue until a breakpoint is hit.
28 29 30 31 32 33 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_run_mode.rb', line 28 def run! @run_mode_mutex.synchronize do @mode = :run @options = {} end end |
#step_in! ⇒ Object
Configures the run_mode for “stepping in” a debug session.
47 48 49 50 51 52 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_run_mode.rb', line 47 def step_in! @run_mode_mutex.synchronize do @mode = :stepin @options = {} end end |
#step_out!(pops_depth_level) ⇒ Object
Configures the run_mode for “stepping out” a debug session.
56 57 58 59 60 61 62 63 |
# File 'lib/puppet-debugserver/debug_session/puppet_session_run_mode.rb', line 56 def step_out!(pops_depth_level) @run_mode_mutex.synchronize do @mode = :stepout @options = { pops_depth_level: pops_depth_level } end end |