Class: IRB::Command::Foreground

Inherits:
MultiIRBCommand show all
Defined in:
lib/irb/command/subirb.rb

Instance Attribute Summary

Attributes inherited from Base

#irb_context

Instance Method Summary collapse

Methods included from RubyArgsExtractor

#ruby_args, #unwrap_string_literal

Methods inherited from Base

category, description, execute, help_message, #initialize

Constructor Details

This class inherits a constructor from IRB::Command::Base

Instance Method Details

#execute(arg) ⇒ Object



77
78
79
80
# File 'lib/irb/command/subirb.rb', line 77

def execute(arg)
  args, kwargs = ruby_args(arg)
  execute_internal(*args, **kwargs)
end

#execute_internal(key = nil) ⇒ Object



82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/irb/command/subirb.rb', line 82

def execute_internal(key = nil)
  print_deprecated_warning

  if irb_context.with_debugger
    print_debugger_warning
    return
  end

  extend_irb_context

  raise CommandArgumentError.new("Please specify the id of target IRB job (listed in the `jobs` command).") unless key
  IRB.JobManager.switch(key)
  puts IRB.JobManager.inspect
end