Module: Optics
- Includes:
- ANSI, VERSION
- Defined in:
- lib/version.rb,
lib/ansi.rb,
lib/optics.rb
Overview
Defined Under Namespace
Modules: ANSI, VERSION
Constant Summary
collapse
- LIBPATH =
::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
- PATH =
::File.dirname(LIBPATH) + ::File::SEPARATOR
Constants included
from ANSI
ANSI::CLASSES, ANSI::COLORS, ANSI::C_STRUCTURE, ANSI::EFFECTS
Constants included
from VERSION
VERSION::MAJOR, VERSION::MINOR, VERSION::REVISION, VERSION::TINY
Class Method Summary
collapse
Methods included from ANSI
#dark, #dark_bg, #light, #light_bg
Methods included from VERSION
pretty
Class Method Details
.dark(color, &block) ⇒ Object
Also known as:
dark_color, color
42
43
44
45
46
47
48
49
|
# File 'lib/optics.rb', line 42
def dark(color, &block)
o = base(color, 3)
if block_given?
o += yield
o += reset
end
o
end
|
.dark_bg(color, &block) ⇒ Object
66
67
68
69
70
71
72
73
|
# File 'lib/optics.rb', line 66
def dark_bg(color, &block)
o = base(color, 4)
if block_given?
o += yield
o += reset
end
o
end
|
.libpath(*args) ⇒ Object
23
24
25
|
# File 'lib/version.rb', line 23
def self.libpath( *args )
args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
end
|
.light(color, &block) ⇒ Object
Also known as:
light_color, pale
54
55
56
57
58
59
60
61
|
# File 'lib/optics.rb', line 54
def light(color, &block)
o = base(color, 9)
if block_given?
o += yield
o += reset
end
o
end
|
.light_bg(color, &block) ⇒ Object
76
77
78
79
80
81
82
83
|
# File 'lib/optics.rb', line 76
def light_bg(color, &block)
o = base(color, 10)
if block_given?
o += yield
o += reset
end
o
end
|
.path(*args) ⇒ Object
27
28
29
|
# File 'lib/version.rb', line 27
def self.path( *args )
args.empty? ? PATH : ::File.join(PATH, args.flatten)
end
|
.require_all_libs_relative_to(fname, dir = nil) ⇒ Object
31
32
33
34
35
36
37
|
# File 'lib/version.rb', line 31
def self.require_all_libs_relative_to( fname, dir = nil )
dir ||= ::File.basename(fname, '.*')
search_me = ::File.expand_path(
::File.join(::File.dirname(fname), dir, '**', '*.rb'))
Dir.glob(search_me).sort.each {|rb| require rb}
end
|