Top Level Namespace
Defined Under Namespace
Modules: HDIUtil, IESD, KextCache, PKGUtil, Tty
Instance Method Summary
collapse
Instance Method Details
#odie(error) ⇒ Object
59
60
61
62
|
# File 'lib/iesd/utility/tty.rb', line 59
def odie error
onoe error
exit 1
end
|
#oh1(title) ⇒ Object
44
45
46
47
|
# File 'lib/iesd/utility/tty.rb', line 44
def oh1 title
title = Tty.truncate(title) if $stdout.tty? && ENV['VERBOSE'].nil?
puts "#{Tty.green}==>#{Tty.white} #{title}#{Tty.reset}"
end
|
#ohai(title, *sput) ⇒ Object
38
39
40
41
42
|
# File 'lib/iesd/utility/tty.rb', line 38
def ohai title, *sput
title = Tty.truncate(title) if $stdout.tty? && ENV['VERBOSE'].nil?
puts "#{Tty.blue}==>#{Tty.white} #{title}#{Tty.reset}"
puts sput unless sput.empty?
end
|
#onoe(error) ⇒ Object
53
54
55
56
57
|
# File 'lib/iesd/utility/tty.rb', line 53
def onoe error
lines = error.to_s.split("\n")
STDERR.puts "#{Tty.red}Error#{Tty.reset}: #{lines.shift}"
STDERR.puts lines unless lines.empty?
end
|
#opoo(warning) ⇒ Object
49
50
51
|
# File 'lib/iesd/utility/tty.rb', line 49
def opoo warning
STDERR.puts "#{Tty.red}Warning#{Tty.reset}: #{warning}"
end
|
#sudo(*args) ⇒ Object
68
69
70
71
72
73
74
75
76
|
# File 'lib/iesd/utility/tty.rb', line 68
def sudo *args
args = if args.length > 1
args.unshift "/usr/bin/sudo"
else
"/usr/bin/sudo #{args.first}"
end
ohai(*args)
system(*args)
end
|
#system(*args) ⇒ Object
64
65
66
|
# File 'lib/iesd/utility/tty.rb', line 64
def system *args
abort "Failed during: #{args.shelljoin}" unless Kernel.system(*args)
end
|