Class: MyPKI::Prompter::CommandLinePrompter
- Inherits:
-
Object
- Object
- MyPKI::Prompter::CommandLinePrompter
- Defined in:
- lib/mypki/prompters/cli.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#file_prompt(prompt) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/mypki/prompters/cli.rb', line 4 def file_prompt prompt require 'readline' Readline.completion_append_character = '' Readline.completion_proc = proc do |key| path = File. key path += '/' if key.end_with? '/' Dir["#{path}*"] end Readline.readline(prompt, true) end |
#pass_prompt(prompt) ⇒ Object
17 18 19 20 |
# File 'lib/mypki/prompters/cli.rb', line 17 def pass_prompt prompt require 'highline/import' ask("#{prompt} ") {|q| q.echo = false} end |