Skip to content

Commit

Permalink
Added README + added option to launch pry from debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
xea committed Oct 1, 2015
1 parent f6c0282 commit 82f950e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Empty file added README
Empty file.
4 changes: 4 additions & 0 deletions lib/console/mode_debug.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class ModeDebug < BaseMode
register_command(:clear_history, "clear history", "Clear command history") { |history| history.clear }
register_command(:mode_core, "core", "Enter core management mode") { |intp| intp.modes.enter_mode :core }
register_command(:exit_mode, "exit", "Exit current mode") { |intp| intp.modes.exit_mode }
register_command(:launch_debugger, "debugger", "Launch interactive debugger (pry)")

def construct
@mode_active = false
Expand All @@ -20,4 +21,7 @@ def pre_exit
@mode_active = false
end

def launch_debugger
binding.pry
end
end
4 changes: 1 addition & 3 deletions lib/console/mode_global.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative "mode"

# Default global mode for providing commands available throughout the whole framework.
class ModeGlobal < BaseMode
mode_id :global

Expand All @@ -11,9 +12,6 @@ class ModeGlobal < BaseMode
# Debug mode is allowed anywhere in the shell
register_command(:mode_debug, "debug", "Enter debug mode", scope(true) { |intp| intp.modes.current_mode.mode_id != :debug }) { |intp| intp.modes.enter_mode :debug }

def construct
end

# This command is generated when other commands can't be assigned to the current request
def command_not_found
Command.new(:not_found, "", "") { puts "not found" }
Expand Down

0 comments on commit 82f950e

Please sign in to comment.