mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
187c199e77
`Pry::Platform` really looks like a helper and therefore should be defined as one. Invoking `Pry::Platform` emits a warning now. Users are encouraged to use `Pry::Helpers::Platform`.
14 lines
407 B
Ruby
14 lines
407 B
Ruby
class Pry::Command::ClearScreen < Pry::ClassCommand
|
|
match 'clear-screen'
|
|
group 'Input and Output'
|
|
description 'Clear the contents of the screen/window Pry is running in.'
|
|
|
|
def process
|
|
if Helpers::Platform.windows?
|
|
_pry_.config.system.call(_pry_.output, 'cls', _pry_)
|
|
else
|
|
_pry_.config.system.call(_pry_.output, 'clear', _pry_)
|
|
end
|
|
end
|
|
Pry::Commands.add_command(self)
|
|
end
|