Class: Barrage::Program
- Inherits:
-
Object
- Object
- Barrage::Program
- Defined in:
- lib/barrage/program.rb
Class Method Summary collapse
Class Method Details
.kill(pid) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/barrage/program.rb', line 22 def self.kill(pid) if pid > 0 puts "#{pid}" Process.kill "QUIT", pid end puts "Plotting..." Commandline.plot(Commandline.dstat_file) Commandline.upload exit(0) end |
.run(argv) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/barrage/program.rb', line 9 def self.run(argv) trap("INT") { Program.kill(Commandline.dstat_pid) } Commandline.start(argv) if argv.size > 0 && argv[0] != "--help" if !Dir.exist?('output') Dir.mkdir 'output' end $stdin.read end end |