Module: Stella

Extended by:
Stella
Included in:
Stella
Defined in:
lib/stella.rb,
lib/stella/stats.rb,
lib/stella/utils.rb,
lib/stella/client.rb,
lib/stella/version.rb,
lib/stella/testplan.rb,
lib/stella/exceptions.rb,
lib/stella/guidelines.rb,
lib/stella/testplan/stats.rb,
lib/stella/testplan/usecase.rb

Defined Under Namespace

Modules: Data, Engine, Guidelines, Utils, VERSION Classes: CLI, Client, Config, Error, InvalidOption, NoHostDefined, Stats, Testplan

Constant Summary collapse

LIB_HOME =
File.expand_path File.dirname(__FILE__)
@@sysinfo =
SysInfo.new.freeze
@@logger =
Drydock::Screen
@@loglev =
1
@@debug =
false

Instance Method Summary collapse

Instance Method Details

#debug?Boolean

Returns:

  • (Boolean)


48
# File 'lib/stella.rb', line 48

def debug?; @@debug == true; end

#disable_debugObject



50
# File 'lib/stella.rb', line 50

def disable_debug; @@debug = false; end

#disable_quietObject



46
# File 'lib/stella.rb', line 46

def disable_quiet; @@loglev = 1; end

#enable_debugObject



49
# File 'lib/stella.rb', line 49

def enable_debug; @@debug = true; end

#enable_quietObject



45
# File 'lib/stella.rb', line 45

def enable_quiet; @@loglev = 0; end

#ld(*msg) ⇒ Object

Puts msg to @@logger if Rudy.debug? returns true



36
37
38
# File 'lib/stella.rb', line 36

def ld(*msg)
  @@logger.puts "D:  " << msg.join("#{$/}D:  ") if debug?
end

#le(*msg) ⇒ Object

Puts msg to @@logger with “ERROR: ” prepended



34
# File 'lib/stella.rb', line 34

def le(*msg); @@logger.puts "  " << msg.join("#{$/}  ").color(:red); end

#lflushObject

Puts msg to @@logger



26
# File 'lib/stella.rb', line 26

def lflush; @@logger.flush if @@logger.respond_to? :flush; end

#li(*msg) ⇒ Object



27
# File 'lib/stella.rb', line 27

def li(*msg); msg.each { |m| @@logger.puts m } if !quiet? end

#li1(*msg) ⇒ Object



28
# File 'lib/stella.rb', line 28

def li1(*msg); li *msg if @@loglev >= 1 end

#li2(*msg) ⇒ Object



29
# File 'lib/stella.rb', line 29

def li2(*msg); li *msg if @@loglev >= 2 end

#li3(*msg) ⇒ Object



30
# File 'lib/stella.rb', line 30

def li3(*msg); li *msg if @@loglev >= 3 end

#li4(*msg) ⇒ Object



31
# File 'lib/stella.rb', line 31

def li4(*msg); li *msg if @@loglev >= 4 end

#loglevObject



40
# File 'lib/stella.rb', line 40

def loglev; @@loglev; end

#loglev=(val) ⇒ Object



41
# File 'lib/stella.rb', line 41

def loglev=(val); @@loglev = val; end

#quiet?Boolean

Returns:

  • (Boolean)


44
# File 'lib/stella.rb', line 44

def quiet?; @@loglev == 0; end

#rescue(&blk) ⇒ Object



52
53
54
55
56
57
# File 'lib/stella.rb', line 52

def rescue(&blk)
  blk.call
rescue => ex
  Stella.le "ERROR: #{ex.message}"
  Stella.ld ex.backtrace
end

#sysinfoObject



42
# File 'lib/stella.rb', line 42

def sysinfo; @@sysinfo; end