Class: DevSystem::TypographyShell

Inherits:
Shell show all
Defined in:
lib/dev_system/subsystems/command/shells/typography_shell.rb

Instance Attribute Summary

Attributes inherited from Liza::Controller

#menv

Class Method Summary collapse

Methods inherited from Shell

all, cruby?, engine, jruby?, linux?, mac?, os, ruby_version, unix?, windows?

Methods inherited from Liza::Controller

#`, `, attr_accessor, attr_reader, attr_writer, #attrs, box, #box, call, color, division, division!, division?, inherited, menv_accessor, menv_reader, menv_writer, on_connected, panel, #panel, plural, require, requirements, sh, #sh, singular, subsystem, subsystem!, subsystem?, subsystem_token, token

Methods inherited from Liza::Unit

_erbs_for, #add, add, cl, #cl, class_methods_defined, const_added, const_missing, constants_defined, define_error, descendants_select, division, erbs_available, erbs_defined, erbs_for, errors, #fetch, fetch, get, #get, instance_methods_defined, log, #log, log?, #log?, #log_array, log_array, log_hash, #log_hash, #log_level, log_level, #log_level?, log_level?, log_levels, #log_levels, #log_render_convert, #log_render_format, #log_render_in, #log_render_out, method_added, methods_defined, namespace, part, raise_error, #raise_error, reload!, #reload!, #render, #render!, #render_stack, renderable_formats_for, renderable_names, section, sections, #set, set, #settings, settings, singleton_method_added, sleep, #sleep, stick, #stick, sticks, #sticks, subclasses_select, subunits, system, #system, system?, test_class, time_diff, #time_diff

Class Method Details

.color_class(klass) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/dev_system/subsystems/command/shells/typography_shell.rb', line 15

def self.color_class klass
  return klass.to_s unless klass < Liza::Unit
  return klass.to_s if klass.superclass == Liza::Unit

  namespace, _sep, classname = klass.to_s.rpartition('::')

  return stick classname, klass.system.color if namespace.empty?
  return stick klass.to_s, :white if namespace == "Liza"
  
  ns = Liza.const(namespace)

  "#{
    stick namespace, ns.system.color
  }::#{
    stick classname, klass.color
  }"
end

.h1(text, color, length: 100) ⇒ Object



3
4
5
# File 'lib/dev_system/subsystems/command/shells/typography_shell.rb', line 3

def self.h1(text, color, length: 100)
  stick color, " #{ text } ".center(length, "=")
end

.h2(text, color, length: 100) ⇒ Object



7
8
9
# File 'lib/dev_system/subsystems/command/shells/typography_shell.rb', line 7

def self.h2(text, color, length: 100)
  stick color, " #{ text } ".center(length, "-")
end

.h3(text, color, length: 100) ⇒ Object



11
12
13
# File 'lib/dev_system/subsystems/command/shells/typography_shell.rb', line 11

def self.h3(text, color, length: 100)
  stick color, " #{ text } ".center(length, " ")
end