Class: Ralph::Output::Status

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/ralph/output/status.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#check_completion, #escape_regex, #format_duration, #format_duration_long, #format_tool_summary, #now_ms, #strip_ansi, #which

Constructor Details

#initialize(options) ⇒ Status

Returns a new instance of Status.



12
13
14
# File 'lib/ralph/output/status.rb', line 12

def initialize(options)
  @options = options
end

Class Method Details

.call(options:) ⇒ Object



8
9
10
# File 'lib/ralph/output/status.rb', line 8

def self.call(options:)
  new(options).call
end

Instance Method Details

#callObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ralph/output/status.rb', line 16

def call
  state = Storage::State.load
  history = Storage::History.load_history
  context = Storage::Context.new
  show_tasks = @options[:tasks_mode] || state&.tasks_mode

  print_header
  print_loop_status(state)
  print_pending_context(context)
  print_tasks if show_tasks
  print_history(history)
  print_footer
end