Class: Ninny::Command
- Inherits:
-
Object
- Object
- Ninny::Command
- Extended by:
- Forwardable
- Defined in:
- lib/ninny/command.rb
Direct Known Subclasses
Ninny::Commands::CreateDatedBranch, Ninny::Commands::OutputDatedBranch, Ninny::Commands::PullRequestMerge, Ninny::Commands::Setup
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?(*args) ⇒ 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(*args) ⇒ Object
The unix which utility.
Instance Method Details
#command(**options) ⇒ Object
The external commands runner
24 25 26 27 |
# File 'lib/ninny/command.rb', line 24 def command(**) require 'tty-command' TTY::Command.new() end |
#cursor ⇒ Object
The cursor movement
34 35 36 37 |
# File 'lib/ninny/command.rb', line 34 def cursor require 'tty-cursor' TTY::Cursor end |
#editor ⇒ Object
Open a file or text in the user’s preferred editor
44 45 46 47 |
# File 'lib/ninny/command.rb', line 44 def editor require 'tty-editor' TTY::Editor end |
#exec_exist?(*args) ⇒ Boolean
Check if executable exists
114 115 116 117 |
# File 'lib/ninny/command.rb', line 114 def exec_exist?(*args) require 'tty-which' TTY::Which.exist?(*args) end |
#execute ⇒ Object
Execute this command
12 13 14 15 16 17 |
# File 'lib/ninny/command.rb', line 12 def execute(*) raise( NotImplementedError, "#{self.class}##{__method__} must be implemented" ) end |
#generator ⇒ Object
File manipulation utility methods
54 55 56 57 |
# File 'lib/ninny/command.rb', line 54 def generator require 'tty-file' TTY::File end |
#pager(**options) ⇒ Object
Terminal output paging
64 65 66 67 |
# File 'lib/ninny/command.rb', line 64 def pager(**) require 'tty-pager' TTY::Pager.new() end |
#platform ⇒ Object
Terminal platform and OS properties
74 75 76 77 |
# File 'lib/ninny/command.rb', line 74 def platform require 'tty-platform' TTY::Platform.new end |
#prompt(**options) ⇒ Object
The interactive prompt
84 85 86 87 |
# File 'lib/ninny/command.rb', line 84 def prompt(**) require 'tty-prompt' TTY::Prompt.new(*) end |
#screen ⇒ Object
Get terminal screen properties
94 95 96 97 |
# File 'lib/ninny/command.rb', line 94 def screen require 'tty-screen' TTY::Screen end |
#which(*args) ⇒ Object
The unix which utility
104 105 106 107 |
# File 'lib/ninny/command.rb', line 104 def which(*args) require 'tty-which' TTY::Which.which(*args) end |