2011-04-25 11:26:25 +00:00
|
|
|
class Pry
|
|
|
|
# Command contexts are the objects runing each command.
|
|
|
|
# Helper modules can be mixed into this class.
|
|
|
|
class CommandContext
|
|
|
|
attr_accessor :output
|
|
|
|
attr_accessor :target
|
2011-05-27 16:16:09 +00:00
|
|
|
attr_accessor :captures
|
|
|
|
attr_accessor :eval_string
|
|
|
|
attr_accessor :arg_string
|
2011-04-25 11:26:25 +00:00
|
|
|
attr_accessor :opts
|
2011-04-25 21:13:36 +00:00
|
|
|
attr_accessor :command_set
|
2011-04-29 16:14:48 +00:00
|
|
|
attr_accessor :command_processor
|
2011-04-25 21:13:36 +00:00
|
|
|
|
|
|
|
def run(name, *args)
|
2011-05-28 15:41:15 +00:00
|
|
|
command_set.run_command(self, name, *args)
|
2011-04-25 21:13:36 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def commands
|
|
|
|
command_set.commands
|
|
|
|
end
|
2011-04-25 11:26:25 +00:00
|
|
|
|
2011-05-06 17:28:12 +00:00
|
|
|
def text
|
2011-05-08 17:38:14 +00:00
|
|
|
Pry::Helpers::Text
|
2011-05-06 17:28:12 +00:00
|
|
|
end
|
|
|
|
|
2011-04-25 20:58:06 +00:00
|
|
|
include Pry::Helpers::BaseHelpers
|
|
|
|
include Pry::Helpers::CommandHelpers
|
2011-04-25 11:26:25 +00:00
|
|
|
end
|
|
|
|
end
|