Class: Expire::Command
- Inherits:
-
Object
- Object
- Expire::Command
- Extended by:
- Forwardable
- Defined in:
- lib/expire/command.rb
Overview
Helpers for TTY
Direct Known Subclasses
Expire::Commands::Newest, Expire::Commands::Oldest, Expire::Commands::Purge, Expire::Commands::Remove, Expire::Commands::RuleClasses, Expire::Commands::RuleNames, Expire::Commands::RuleOptionNames
Instance Method Summary collapse
-
#command(**options) ⇒ Object
The external commands runner.
-
#cursor ⇒ Object
The cursor movement.
-
#editor ⇒ Object
Open a file or text in the user’s preferred editor.
-
#exec_exist? ⇒ Boolean
Check if executable exists.
-
#execute ⇒ Object
Execute this command.
-
#generator ⇒ Object
File manipulation utility methods.
-
#pager(**options) ⇒ Object
Terminal output paging.
-
#platform ⇒ Object
Terminal platform and OS properties.
-
#prompt(**options) ⇒ Object
The interactive prompt.
-
#screen ⇒ Object
Get terminal screen properties.
-
#which ⇒ Object
The unix which utility.
Instance Method Details
#command(**options) ⇒ Object
The external commands runner
27 28 29 30 |
# File 'lib/expire/command.rb', line 27 def command(**) require "tty-command" TTY::Command.new() end |
#cursor ⇒ Object
The cursor movement
37 38 39 40 |
# File 'lib/expire/command.rb', line 37 def cursor require "tty-cursor" TTY::Cursor end |
#editor ⇒ Object
Open a file or text in the user’s preferred editor
47 48 49 50 |
# File 'lib/expire/command.rb', line 47 def editor require "tty-editor" TTY::Editor end |
#exec_exist? ⇒ Boolean
Check if executable exists
117 118 119 120 |
# File 'lib/expire/command.rb', line 117 def exec_exist?(*) require "tty-which" TTY::Which.exist?(*) end |
#execute ⇒ Object
Execute this command
15 16 17 18 19 20 |
# File 'lib/expire/command.rb', line 15 def execute(*) raise( NotImplementedError, "#{self.class}##{__method__} must be implemented" ) end |
#generator ⇒ Object
File manipulation utility methods
57 58 59 60 |
# File 'lib/expire/command.rb', line 57 def generator require "tty-file" TTY::File end |
#pager(**options) ⇒ Object
Terminal output paging
67 68 69 70 |
# File 'lib/expire/command.rb', line 67 def pager(**) require "tty-pager" TTY::Pager.new() end |
#platform ⇒ Object
Terminal platform and OS properties
77 78 79 80 |
# File 'lib/expire/command.rb', line 77 def platform require "tty-platform" TTY::Platform.new end |
#prompt(**options) ⇒ Object
The interactive prompt
87 88 89 90 |
# File 'lib/expire/command.rb', line 87 def prompt(**) require "tty-prompt" TTY::Prompt.new() end |
#screen ⇒ Object
Get terminal screen properties
97 98 99 100 |
# File 'lib/expire/command.rb', line 97 def screen require "tty-screen" TTY::Screen end |
#which ⇒ Object
The unix which utility
107 108 109 110 |
# File 'lib/expire/command.rb', line 107 def which(*) require "tty-which" TTY::Which.which(*) end |