Class: CLI::UI::Widgets::Status
- Defined in:
- lib/cli/ui/widgets/status.rb
Constant Summary collapse
- ARGPARSE_PATTERN =
%r{ \A (?<succeeded> \d+) : (?<failed> \d+) : (?<working> \d+) : (?<pending> \d+) \z }x
- OPEN =
e.g. “1:23:3:404”
Color::RESET.code + Color::BOLD.code + '[' + Color::RESET.code
- CLOSE =
Color::RESET.code + Color::BOLD.code + ']' + Color::RESET.code
- ARROW =
Color::RESET.code + Color::GRAY.code + '◂' + Color::RESET.code
- COMMA =
Color::RESET.code + Color::GRAY.code + ',' + Color::RESET.code
- SPINNER_STOPPED =
'⠿'
- EMPTY_SET =
'∅'
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
Methods included from T::Sig
Methods included from T::Helpers
#abstract!, #final!, #interface!, #mixes_in_class_methods, #sealed!
Constructor Details
This class inherits a constructor from CLI::UI::Widgets::Base
Class Method Details
.argparse_pattern ⇒ Object
25 26 27 |
# File 'lib/cli/ui/widgets/status.rb', line 25 def self.argparse_pattern ARGPARSE_PATTERN end |
Instance Method Details
#render ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/cli/ui/widgets/status.rb', line 30 def render if zero?(@succeeded) && zero?(@failed) && zero?(@working) && zero?(@pending) Color::RESET.code + Color::BOLD.code + EMPTY_SET + Color::RESET.code else # [ 0✓ , 2✗ ◂ 3⠼ ◂ 4⌛︎ ] "#{OPEN}#{succeeded_part}#{COMMA}#{failed_part}#{ARROW}#{working_part}#{ARROW}#{pending_part}#{CLOSE}" end end |