Class: Yapo::Command
- Inherits:
-
Object
- Object
- Yapo::Command
- Extended by:
- Forwardable
- Defined in:
- lib/yapo/command.rb
Direct Known Subclasses
Yapo::Commands::Exec, Helpers::CustomErrors::ErrorMessage, Helpers::Teletype
Instance Method Summary collapse
-
#command(**options) ⇒ Object
The external commands runner.
-
#exec_exist?(*args) ⇒ Boolean
Check if executable exists.
-
#execute ⇒ Object
Execute this command.
-
#generator ⇒ Object
File manipulation utility methods.
-
#pastel(**options) ⇒ Object
The output styler.
-
#platform ⇒ Object
Terminal platform and OS properties.
-
#prompt(**options) ⇒ Object
The interactive prompt.
-
#screen ⇒ Object
Get terminal screen properties.
-
#which(*args) ⇒ Object
The unix which utility.
Instance Method Details
#command(**options) ⇒ Object
The external commands runner
23 24 25 26 |
# File 'lib/yapo/command.rb', line 23 def command(**) require 'tty-command' TTY::Command.new() end |
#exec_exist?(*args) ⇒ Boolean
Check if executable exists
65 66 67 68 |
# File 'lib/yapo/command.rb', line 65 def exec_exist?(*args) require 'tty-which' TTY::Which.exist?(*args) end |
#execute ⇒ Object
Execute this command
15 16 17 18 19 20 |
# File 'lib/yapo/command.rb', line 15 def execute(*) raise( NotImplementedError, "#{self.class}##{__method__} must be implemented" ) end |
#generator ⇒ Object
File manipulation utility methods
35 36 37 38 |
# File 'lib/yapo/command.rb', line 35 def generator require 'tty-file' TTY::File end |
#pastel(**options) ⇒ Object
The output styler
29 30 31 32 |
# File 'lib/yapo/command.rb', line 29 def pastel(**) require 'pastel' Pastel.new() end |
#platform ⇒ Object
Terminal platform and OS properties
41 42 43 44 |
# File 'lib/yapo/command.rb', line 41 def platform require 'tty-platform' TTY::Platform.new end |
#prompt(**options) ⇒ Object
The interactive prompt
47 48 49 50 |
# File 'lib/yapo/command.rb', line 47 def prompt(**) require 'tty-prompt' TTY::Prompt.new() end |
#screen ⇒ Object
Get terminal screen properties
53 54 55 56 |
# File 'lib/yapo/command.rb', line 53 def screen require 'tty-screen' TTY::Screen end |
#which(*args) ⇒ Object
The unix which utility
59 60 61 62 |
# File 'lib/yapo/command.rb', line 59 def which(*args) require 'tty-which' TTY::Which.which(*args) end |