class S3sec::Command
Public Instance Methods
The external commands runner
@see www.rubydoc.info/gems/tty-command
@api public
# File lib/s3sec/command.rb, line 27 def command(**options) require 'tty-command' TTY::Command.new(options) end
Read configuration
@see www.rubydoc.info/gems/tty-config
@api public
# File lib/s3sec/command.rb, line 138 def config return @config if @config @config = TTY::Config.new @config.filename = 'config' @config.extname = '.yml' @config.append_path Dir.pwd @config.read if @config.exist? @config end
The cursor movement
@see www.rubydoc.info/gems/tty-cursor
@api public
# File lib/s3sec/command.rb, line 37 def cursor require 'tty-cursor' TTY::Cursor end
Open a file or text in the user's preferred editor
@see www.rubydoc.info/gems/tty-editor
@api public
# File lib/s3sec/command.rb, line 47 def editor require 'tty-editor' TTY::Editor end
Check if executable exists
@see www.rubydoc.info/gems/tty-which
@api public
# File lib/s3sec/command.rb, line 128 def exec_exist?(*args) require 'tty-which' TTY::Which.exist?(*args) end
Execute this command
@api public
# File lib/s3sec/command.rb, line 15 def execute(*) raise( NotImplementedError, "#{self.class}##{__method__} must be implemented" ) end
File manipulation utility methods
@see www.rubydoc.info/gems/tty-file
@api public
# File lib/s3sec/command.rb, line 57 def generator require 'tty-file' TTY::File end
Terminal output paging
@see www.rubydoc.info/gems/tty-pager
@api public
# File lib/s3sec/command.rb, line 67 def pager(**options) require 'tty-pager' TTY::Pager.new(options) end
The interactive pastel
@see www.rubydoc.info/gems/pastel
@api public
# File lib/s3sec/command.rb, line 87 def pastel(**options) require 'pastel' Pastel.new(options) end
Terminal platform and OS properties
@see www.rubydoc.info/gems/tty-pager
@api public
# File lib/s3sec/command.rb, line 77 def platform require 'tty-platform' TTY::Platform.new end
The interactive prompt
@see www.rubydoc.info/gems/tty-prompt
@api public
# File lib/s3sec/command.rb, line 98 def prompt(**options) require 'tty-prompt' TTY::Prompt.new(options) end
Get terminal screen properties
@see www.rubydoc.info/gems/tty-screen
@api public
# File lib/s3sec/command.rb, line 108 def screen require 'tty-screen' TTY::Screen end
The unix which utility
@see www.rubydoc.info/gems/tty-which
@api public
# File lib/s3sec/command.rb, line 118 def which(*args) require 'tty-which' TTY::Which.which(*args) end