Top Level Namespace
Defined Under Namespace
Modules: ZQ
Classes: Echo, NoComposerProvided, NoOrchestrasFound, NoSourceProvided, OrchestraDoesNotExist, Tty
Instance Method Summary
collapse
Instance Method Details
#odie(error) ⇒ Object
89
90
91
92
|
# File 'lib/zq/utils.rb', line 89
def odie(error)
onoe error
exit 1
end
|
#ofail(error) ⇒ Object
84
85
86
87
|
# File 'lib/zq/utils.rb', line 84
def ofail(error)
onoe error
Lace.failed = true
end
|
#oh1(title) ⇒ Object
69
70
71
72
|
# File 'lib/zq/utils.rb', line 69
def oh1(title)
title = Tty.truncate(title) if $stdout.tty? && !ARGV.verbose?
puts "#{Tty.green}==>#{Tty.white} #{title}#{Tty.reset}"
end
|
#ohai(title, *sput) ⇒ Object
63
64
65
66
67
|
# File 'lib/zq/utils.rb', line 63
def ohai(title, *sput)
title = Tty.truncate(title) if $stdout.tty? && !ARGV.verbose?
puts "#{Tty.blue}==>#{Tty.white} #{title}#{Tty.reset}"
puts sput unless sput.empty?
end
|
#onoe(error) ⇒ Object
78
79
80
81
82
|
# File 'lib/zq/utils.rb', line 78
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
74
75
76
|
# File 'lib/zq/utils.rb', line 74
def opoo(warning)
STDERR.puts "#{Tty.red}Warning#{Tty.reset}: #{warning}"
end
|