2012-08-11 20:22:29 -04:00
|
|
|
class Pry
|
2012-12-25 16:35:17 -05:00
|
|
|
class Command::ImportSet < Pry::ClassCommand
|
|
|
|
match 'import-set'
|
|
|
|
group 'Commands'
|
|
|
|
# TODO: Provide a better description with examples and a general conception
|
|
|
|
# of this command.
|
|
|
|
description 'Import a Pry command set.'
|
2012-08-11 20:22:29 -04:00
|
|
|
|
2013-01-09 15:23:19 -05:00
|
|
|
banner <<-'BANNER'
|
|
|
|
Import a Pry command set.
|
|
|
|
BANNER
|
|
|
|
|
2012-08-11 20:22:29 -04:00
|
|
|
def process(command_set_name)
|
|
|
|
raise CommandError, "Provide a command set name" if command_set.nil?
|
|
|
|
|
|
|
|
set = target.eval(arg_string)
|
|
|
|
_pry_.commands.import set
|
|
|
|
end
|
|
|
|
end
|
2012-12-25 16:35:17 -05:00
|
|
|
|
|
|
|
Pry::Commands.add_command(Pry::Command::ImportSet)
|
2012-08-11 20:22:29 -04:00
|
|
|
end
|