lib/eye/cli/render.rb in reel-eye-0.5.1 vs lib/eye/cli/render.rb in reel-eye-0.5.2
- old
+ new
@@ -1,9 +1,9 @@
module Eye::Cli::Render
private
def render_info(data)
- error!("unexpected server answer #{data.inspect}") unless data.is_a?(Hash)
+ error!("unexpected server response #{data.inspect}") unless data.is_a?(Hash)
make_str data
end
def make_str(data, level = -1)
@@ -60,11 +60,11 @@
"#{Eye::Utils.human_time(start_time)}, #{cpu.to_i}%, #{memory / 1024 / 1024}Mb, <#{pid}>"
end
def render_debug_info(data)
- error!("unexpected server answer #{data.inspect}") unless data.is_a?(Hash)
+ error!("unexpected server response #{data.inspect}") unless data.is_a?(Hash)
s = ""
if config_yaml = data.delete(:config_yaml)
s << config_yaml
@@ -88,11 +88,11 @@
s
end
def render_history(data)
- error!("unexpected server answer #{data.inspect}") unless data.is_a?(Hash)
+ error!("unexpected server response #{data.inspect}") unless data.is_a?(Hash)
res = []
data.each do |name, data|
res << detail_process_info(name, data)
end
@@ -101,10 +101,10 @@
end
def detail_process_info(name, history)
return if history.empty?
- res = "\033[1m#{name}\033[0m:\n"
+ res = "\033[1m#{name}\033[0m\n"
history = history.reverse
history.chunk{|h| [h[:state], h[:reason].to_s] }.each do |_, hist|
if hist.size >= 3
res << detail_process_info_string(hist[0])