Class: Meshchat::Ui::Command::Irb

Inherits:
Base
  • Object
show all
Defined in:
lib/meshchat/ui/command/irb.rb

Overview

TODO: remove this command before release

Constant Summary

Constants inherited from Base

Base::ADD, Base::ALL_CHAT_LOCK, Base::BIND, Base::CHAT, Base::CONFIG, Base::DISPLAY, Base::EMOTE, Base::EXIT, Base::EXPORT, Base::HELP, Base::IDENTITY, Base::IMPORT, Base::IRB, Base::OFFLINE, Base::ONLINE, Base::PING, Base::PING_ALL, Base::QUIT, Base::REMOVE, Base::RM, Base::ROLL, Base::SEND_DISCONNECT, Base::SERVER, Base::SERVERS, Base::SET, Base::SHARE, Base::WHISPER_LOCK, Base::WHO

Instance Attribute Summary

Attributes inherited from Base

#_input, #_input_factory, #_message_dispatcher, #_message_factory

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Meshchat::Ui::Command::Base

Class Method Details

.descriptionObject



7
8
9
# File 'lib/meshchat/ui/command/irb.rb', line 7

def self.description
  'runs ruby commands (useful for debugging)'
end

Instance Method Details

#handleObject



11
12
13
14
15
16
17
18
# File 'lib/meshchat/ui/command/irb.rb', line 11

def handle
  code = command_args[1..command_args.length].join(' ')
  ap eval(code)
  ''
rescue => e
  ap e.message
  ap e.backtrace
end