Skip to content
Kward Search API index

Class: Kward::CLI::Tabs::TabRuntime

Inherits:
Struct
  • Object
show all
Defined in:
lib/kward/cli/tabs.rb

Constant Summary collapse

TRANSIENT_SHELL_OUTPUT_LIMIT =
200_000

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#agentObject

Returns the value of attribute agent

Returns:

  • (Object)

    the current value of agent



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def agent
  @agent
end

#answerObject

Returns the value of attribute answer

Returns:

  • (Object)

    the current value of answer



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def answer
  @answer
end

#cancellationObject

Returns the value of attribute cancellation

Returns:

  • (Object)

    the current value of cancellation



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def cancellation
  @cancellation
end

#diffObject

Returns the value of attribute diff

Returns:

  • (Object)

    the current value of diff



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def diff
  @diff
end

#driverObject

Returns the value of attribute driver

Returns:

  • (Object)

    the current value of driver



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def driver
  @driver
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def error
  @error
end

#error_reportedObject

Returns the value of attribute error_reported

Returns:

  • (Object)

    the current value of error_reported



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def error_reported
  @error_reported
end

#event_historyObject

Returns the value of attribute event_history

Returns:

  • (Object)

    the current value of event_history



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def event_history
  @event_history
end

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def label
  @label
end

#local_busy_activityObject

Returns the value of attribute local_busy_activity

Returns:

  • (Object)

    the current value of local_busy_activity



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def local_busy_activity
  @local_busy_activity
end

#markdown_chunksObject

Returns the value of attribute markdown_chunks

Returns:

  • (Object)

    the current value of markdown_chunks



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def markdown_chunks
  @markdown_chunks
end

#pending_questionObject

Returns the value of attribute pending_question

Returns:

  • (Object)

    the current value of pending_question



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def pending_question
  @pending_question
end

#queued_inputsObject

Returns the value of attribute queued_inputs

Returns:

  • (Object)

    the current value of queued_inputs



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def queued_inputs
  @queued_inputs
end

#seen_eventsObject

Returns the value of attribute seen_events

Returns:

  • (Object)

    the current value of seen_events



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def seen_events
  @seen_events
end

#sessionObject

Returns the value of attribute session

Returns:

  • (Object)

    the current value of session



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def session
  @session
end

#shellObject

Returns the value of attribute shell

Returns:

  • (Object)

    the current value of shell



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def shell
  @shell
end

#snapshotObject

Returns the value of attribute snapshot

Returns:

  • (Object)

    the current value of snapshot



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def snapshot
  @snapshot
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def status
  @status
end

#steeringObject

Returns the value of attribute steering

Returns:

  • (Object)

    the current value of steering



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def steering
  @steering
end

#stream_stateObject

Returns the value of attribute stream_state

Returns:

  • (Object)

    the current value of stream_state



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def stream_state
  @stream_state
end

#threadObject

Returns the value of attribute thread

Returns:

  • (Object)

    the current value of thread



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def thread
  @thread
end

#transient_shell_entriesObject

Returns the value of attribute transient_shell_entries

Returns:

  • (Object)

    the current value of transient_shell_entries



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def transient_shell_entries
  @transient_shell_entries
end

#unreadObject

Returns the value of attribute unread

Returns:

  • (Object)

    the current value of unread



17
18
19
# File 'lib/kward/cli/tabs.rb', line 17

def unread
  @unread
end

Instance Method Details

#append_transient_shell_entry(text) ⇒ Object



61
62
63
64
65
66
67
68
# File 'lib/kward/cli/tabs.rb', line 61

def append_transient_shell_entry(text)
  value = text.to_s
  return if value.empty?

  self.transient_shell_entries ||= []
  transient_shell_entries << value
  trim_transient_shell_entries
end

#clear_transient_shell_entriesObject



70
71
72
# File 'lib/kward/cli/tabs.rb', line 70

def clear_transient_shell_entries
  self.transient_shell_entries = []
end

#idle?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/kward/cli/tabs.rb', line 53

def idle?
  !running? && !local_busy?
end

#local_busy?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/kward/cli/tabs.rb', line 49

def local_busy?
  !local_busy_activity.to_s.empty?
end

#record_event(event) ⇒ Object



57
58
59
# File 'lib/kward/cli/tabs.rb', line 57

def record_event(event)
  event_history << event
end

#running?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/kward/cli/tabs.rb', line 45

def running?
  %w[queued running waiting_for_question].include?(status.to_s)
end