File: terminal.rb

package info (click to toggle)
ruby-guard 2.18.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,344 kB
  • sloc: ruby: 9,256; makefile: 6
file content (13 lines) | stat: -rw-r--r-- 302 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
require "shellany/sheller"

module Guard
  class Terminal
    class << self
      def clear
        cmd = Gem.win_platform? ? "cls" : "printf '\33c\e[3J';"
        exit_code, _, stderr = Shellany::Sheller.system(cmd)
        fail Errno::ENOENT, stderr unless exit_code == 0
      end
    end
  end
end