Module: DatabaseCopy::ImportUI

Defined in:
lib/database_copy.rb

Constant Summary collapse

@@spinner =
nil

Class Method Summary collapse

Class Method Details

.clear_lineObject



27
28
29
# File 'lib/database_copy.rb', line 27

def self.clear_line
  @@spinner&.clear_line
end

.colorObject



45
46
47
# File 'lib/database_copy.rb', line 45

def self.color
  @@color ||= Pastel.new
end

.error(message) ⇒ Object



23
24
25
# File 'lib/database_copy.rb', line 23

def self.error(message)
  @@spinner&.error(message)
end

.finish(message = "") ⇒ Object



31
32
33
# File 'lib/database_copy.rb', line 31

def self.finish(message = "")
  @@spinner&.success(message)
end

.info(message) ⇒ Object



35
36
37
38
# File 'lib/database_copy.rb', line 35

def self.info(message)
  clear_line
  puts message
end

.start(message) ⇒ Object



18
19
20
21
# File 'lib/database_copy.rb', line 18

def self.start(message)
  @@spinner ||= TTY::Spinner.new(message)
  @@spinner&.auto_spin
end

.warn(message) ⇒ Object



40
41
42
43
# File 'lib/database_copy.rb', line 40

def self.warn(message)
  clear_line
  puts color.yellow message
end