Class: Taski::Progress::Layout::Simple

Inherits:
Base show all
Defined in:
lib/taski/progress/layout/simple.rb

Overview

Simple layout providing a minimalist single-line progress display. Shows task execution status in a compact format with spinner animation:

⠹ [3/5] DeployTask | Uploading files...

Customization is done through Theme classes:

class MyTheme < Taski::Progress::Theme::Base
def spinner_frames
  %w[🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘]
end

def icon_success
  "🎉"
end

def format_count(count)
  "#{count}"
end

def execution_complete
  '{% icon %} Done! {{ execution.completed_count | format_count }} tasks in {{ execution.total_duration | format_duration }}'
end
end

layout = Taski::Progress::Layout::Simple.new(theme: MyTheme.new)

Instance Attribute Summary

Attributes inherited from Base

#spinner_index

Attributes inherited from Execution::TaskObserver

#context

Instance Method Summary collapse

Methods inherited from Base

#on_group_completed, #on_group_started, #on_ready, #on_start, #on_stop, #on_task_updated, #queue_message, #render_template_string, #start_spinner_timer, #stop_spinner_timer, #task_registered?, #task_state

Methods inherited from Execution::TaskObserver

#on_group_completed, #on_group_started, #on_ready, #on_start, #on_stop, #on_task_updated

Constructor Details

#initialize(output: $stdout, theme: nil) ⇒ Simple

Returns a new instance of Simple.



36
37
38
39
# File 'lib/taski/progress/layout/simple.rb', line 36

def initialize(output: $stdout, theme: nil)
  theme ||= Theme::Compact.new
  super
end