1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00
pry--pry/lib/pry/commands/clear_screen.rb
Kyrylo Silin 187c199e77 Deprecate Pry::Platform and introduce Pry::Helpers::Platform
`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`.
2018-11-02 01:52:09 +08:00

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