Module: Kontena::Cli::ShellSpinner

Defined in:
lib/kontena/cli/spinner.rb

Instance Method Summary collapse

Instance Method Details



196
197
198
199
200
201
202
# File 'lib/kontena/cli/spinner.rb', line 196

def print(*msgs)
  if Thread.main['spinners'] && !Thread.main['spinners'].empty?
    Thread.main['spinner_msgs'] << msgs.join
  else
    super(*msgs)
  end
end

#puts(*msgs) ⇒ Object



188
189
190
191
192
193
194
# File 'lib/kontena/cli/spinner.rb', line 188

def puts(*msgs)
  if Thread.main['spinners'] && !Thread.main['spinners'].empty?
    msgs.each { |msg| Thread.main['spinner_msgs'] << msg }
  else
    super(*msgs)
  end
end

#spinner(msg = "", &block) ⇒ Object



184
185
186
# File 'lib/kontena/cli/spinner.rb', line 184

def spinner(msg = "", &block)
  Kontena::Cli::Spinner.spin(msg, &block)
end