Sha256: d8078224168e118c9170236b3870ebef117f2a8d165d6970c883c977f9c7027d

Contents?: true

Size: 353 Bytes

Versions: 5

Compression:

Stored size: 353 Bytes

Contents

# frozen_string_literal: true

require_relative "../lib/tty-spinner"

# without block
spinner = TTY::Spinner.new(":title :spinner ...", format: :pulse_3)

def long_task
  10_000_000.times do |n|
    n * n
  end
end

spinner.update(title: "Task 1")
spinner.run "done" do
  long_task
end

spinner.update(title: "Task 2")
spinner.run("done") { long_task }

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
planter-cli-3.0.7 lib/tty-spinner/examples/run.rb
planter-cli-3.0.5 lib/tty-spinner/examples/run.rb
planter-cli-3.0.4 lib/tty-spinner/examples/run.rb
planter-cli-3.0.3 lib/tty-spinner/examples/run.rb
planter-cli-3.0.2 lib/tty-spinner/examples/run.rb