Class: Everywhere::Dock::Null
- Inherits:
-
Object
- Object
- Everywhere::Dock::Null
- Defined in:
- lib/everywhere/dock.rb
Overview
The headless stand-in: same API, no escape sequences ever. Used for CI,
pipes, | tee, dumb terminals and windows too small to spare the rows.
It narrates transitions as ordinary lines so a piped log still reads.
Note it never installs itself as Console's sink — output keeps going straight to $stdout, exactly as it did before the dock existed.
Instance Attribute Summary collapse
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#announce_keys ⇒ Object
The one-shot keymap the old command printed, kept for headless runs.
- #clear ⇒ Object
- #close ⇒ Object
- #detail(_key, _text) ⇒ Object
- #emit(text) ⇒ Object
-
#initialize(targets, keys: true) ⇒ Null
constructor
A new instance of Null.
- #install ⇒ Object
- #refresh ⇒ Object
- #set(key, state, detail: nil) ⇒ Object
- #toggle_help ⇒ Object
Constructor Details
Instance Attribute Details
#state ⇒ Object (readonly)
Returns the value of attribute state.
214 215 216 |
# File 'lib/everywhere/dock.rb', line 214 def state @state end |
Instance Method Details
#announce_keys ⇒ Object
The one-shot keymap the old command printed, kept for headless runs.
231 232 233 234 235 |
# File 'lib/everywhere/dock.rb', line 231 def announce_keys return unless @keys UI.note(KEYS.map { |key, desc| "#{UI.bold(key)} #{desc}" }.join(" · "), marker: "⌨", color: :cyan) end |
#clear ⇒ Object
227 |
# File 'lib/everywhere/dock.rb', line 227 def clear = nil |
#close ⇒ Object
228 |
# File 'lib/everywhere/dock.rb', line 228 def close = nil |
#detail(_key, _text) ⇒ Object
223 |
# File 'lib/everywhere/dock.rb', line 223 def detail(_key, _text) = nil |
#emit(text) ⇒ Object
225 |
# File 'lib/everywhere/dock.rb', line 225 def emit(text) = nil |
#install ⇒ Object
216 |
# File 'lib/everywhere/dock.rb', line 216 def install = self |
#refresh ⇒ Object
226 |
# File 'lib/everywhere/dock.rb', line 226 def refresh = nil |
#set(key, state, detail: nil) ⇒ Object
218 219 220 221 |
# File 'lib/everywhere/dock.rb', line 218 def set(key, state, detail: nil) target = @state.set(key, state, detail: detail) or return UI.step("#{target.label} → #{[state, detail].compact.join(" ")}") end |
#toggle_help ⇒ Object
224 |
# File 'lib/everywhere/dock.rb', line 224 def toggle_help = nil |