Class: RedisCopy::UI::CommandLine
- Inherits:
-
Object
- Object
- RedisCopy::UI::CommandLine
- Defined in:
- lib/redis-copy/ui/command_line.rb
Instance Method Summary collapse
Instance Method Details
#abort(message = nil) ⇒ Object
18 19 20 21 |
# File 'lib/redis-copy/ui/command_line.rb', line 18 def abort( = nil) notify(['ABORTED',].compact.join(': ')) exit 1 end |
#confirm?(prompt) ⇒ Boolean
10 11 12 13 14 15 16 |
# File 'lib/redis-copy/ui/command_line.rb', line 10 def confirm?(prompt) $stderr.puts(prompt) return true unless @options[:prompt] $stderr.puts("Continue? [yN]") abort unless $stdin.gets.chomp =~ /y/i true end |
#notify(message) ⇒ Object
23 24 25 |
# File 'lib/redis-copy/ui/command_line.rb', line 23 def notify() $stderr.puts() end |