Class: DevSystem::MainShell

Inherits:
Shell show all
Defined in:
lib/dev_system/subsystems/shell/shells/main_shell.rb

Overview

DevSystem::MainShell is a functional wrapper for advanced use cases related to main.

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

.easy!Object



8
9
10
11
# File 'lib/dev_system/subsystems/shell/shells/main_shell.rb', line 8

def self.easy!
  easy_constants!
  easy_log!
end

.easy_constants!Object



13
14
15
16
17
18
19
# File 'lib/dev_system/subsystems/shell/shells/main_shell.rb', line 13

def self.easy_constants!
  puts
  log "Object.const_missing now delegates to Liza.const_missing"
  puts
  proc = Liza.method(:const_missing)
  main.define_singleton_method :const_missing, &proc
end

.easy_log!Object



21
22
23
24
25
26
27
# File 'lib/dev_system/subsystems/shell/shells/main_shell.rb', line 21

def self.easy_log!
  m = main
  def m.log(...)=       DevSystem::MainShell.log(...)
  def m.log_array(...)= DevSystem::MainShell.log_array(...)
  def m.log_hash(...)=  DevSystem::MainShell.log_hash(...)
  def m.stick(...)=     DevSystem::MainShell.stick(...)
end

.mainObject



4
5
6
# File 'lib/dev_system/subsystems/shell/shells/main_shell.rb', line 4

def self.main
  $main
end