Permalink
Browse files

Just print each result on one line. Don't use curses

  • Loading branch information...
1 parent ad9c4e6 commit 52a72317dfb4c682a8b9efd02bb32f7ec97cf13a @brynary committed Mar 25, 2009
Showing with 23 additions and 23 deletions.
  1. +23 −23 lib/nginx_stat.rb
View
@@ -29,17 +29,17 @@ def self.start(*args)
stats = []
- if args.length > 1 and not defined? Curses then
- $stderr.puts "Multiple logfile support requires curses"
- exit 1
- end
-
- if defined? Curses then
- Curses.init_screen
- Curses.clear
- Curses.addstr "Collecting data...\n"
- Curses.refresh
- end
+ # if args.length > 1 and not defined? Curses then
+ # $stderr.puts "Multiple logfile support requires curses"
+ # exit 1
+ # end
+
+ # if defined? Curses then
+ # Curses.init_screen
+ # Curses.clear
+ # Curses.addstr "Collecting data...\n"
+ # Curses.refresh
+ # end
args.each_with_index do |filename, offset|
stat = self.new File.open(filename), interval, offset
@@ -91,19 +91,19 @@ def start
end
def print
- if defined? Curses then
- Curses.setpos @offset, 0
- Curses.addstr ' ' * @last_len
- Curses.setpos @offset, 0
- Curses.addstr "#{@io_path}\t#{@status}"
- Curses.refresh
- else
- print "\r"
- print ' ' * @last_len
- print "\r"
- print @status
+ # if defined? Curses then
+ # Curses.setpos @offset, 0
+ # Curses.addstr ' ' * @last_len
+ # Curses.setpos @offset, 0
+ # Curses.addstr "#{@io_path}\t#{@status}"
+ # Curses.refresh
+ # else
+ # print "\r"
+ # print ' ' * @last_len
+ # print "\r"
+ puts @status
$stdout.flush
- end
+ # end
end
private

0 comments on commit 52a7231

Please sign in to comment.