Class: Miniflow::TTYCommand
- Inherits:
-
TTY::Command
- Object
- TTY::Command
- Miniflow::TTYCommand
- Defined in:
- lib/miniflow/tty_command.rb
Overview
Miniflow uses tty-command to execute the command. Please see the following website for more information. ttytoolkit.org/
Defined Under Namespace
Classes: CustomPretty
Instance Method Summary collapse
- #include_meta_character?(str) ⇒ Boolean
-
#initialize(*args) ⇒ TTYCommand
constructor
A new instance of TTYCommand.
-
#run2(*args) ⇒ Object
run2 can execute the command in which the UNIX pipeline is used.
Constructor Details
#initialize(*args) ⇒ TTYCommand
Returns a new instance of TTYCommand.
36 37 38 39 |
# File 'lib/miniflow/tty_command.rb', line 36 def initialize(*args) # Do not output uuid super(*args, printer: CustomPretty, uuid: true) end |
Instance Method Details
#include_meta_character?(str) ⇒ Boolean
52 53 54 55 |
# File 'lib/miniflow/tty_command.rb', line 52 def (str) ['*', '?', '{', '}', '[', ']', '<', '>', '(', ')', '~', '&', '|', '\\', '$', ';', "'", '`', '"', "\n"].any? { |i| str.include?(i) } end |
#run2(*args) ⇒ Object
run2 can execute the command in which the UNIX pipeline is used.
42 43 44 45 46 47 48 49 50 |
# File 'lib/miniflow/tty_command.rb', line 42 def run2(*args) args.map!(&:to_s) command = args.join(' ') if (command) run(command) else run(*args) end end |