Class: PDK::CLI::Util::CommandRedirector
- Inherits:
-
TTY::Prompt::AnswersCollector
- Object
- TTY::Prompt::AnswersCollector
- PDK::CLI::Util::CommandRedirector
- Defined in:
- lib/pdk/cli/util/command_redirector.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
Instance Method Summary collapse
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
8 9 10 |
# File 'lib/pdk/cli/util/command_redirector.rb', line 8 def command @command end |
Instance Method Details
#pastel ⇒ Object
10 11 12 |
# File 'lib/pdk/cli/util/command_redirector.rb', line 10 def pastel @pastel ||= Pastel.new end |
#run ⇒ Object
18 19 20 21 22 23 |
# File 'lib/pdk/cli/util/command_redirector.rb', line 18 def run @prompt.puts _('Did you mean \'%{command}\'?') % { command: pastel.bold(@command) } @prompt.yes?('-->') rescue PDK::CLI::Util::Interview::READER::InputInterrupt nil end |
#target_command(cmd) ⇒ Object
14 15 16 |
# File 'lib/pdk/cli/util/command_redirector.rb', line 14 def target_command(cmd) @command = cmd end |