Sha256: 2050a09de5825e6dd224f0383cebe5752d3b3afeb3d8bbb0512ac4ebca91eb94

Contents?: true

Size: 1002 Bytes

Versions: 2

Compression:

Stored size: 1002 Bytes

Contents

#!/usr/bin/env ruby
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')

require 'rubygems'
require 'gruff'
require 'grapher'
require 'trollop'

opts = Trollop::options do
  banner <<-EOS
Takes a stresser csv file and creates graph images from it.

Usage:
       stresser-grapher [options] csv_file
where [options] are:
EOS
  opt :report, "The report to generate",
        :type => String
  opt :report_definitions, "You can provide your own yaml file - it maps csv columns to data rows in an image",
        :type => String,
        :default => "lib/reports.yml"
  opt :output_dir, "Output directory",
        :type => String
end.merge(:csv_file => ARGV.last)
  
Trollop::die :output_dir,  "must be writeable"   unless opts[:output_dir] and File.stat(opts[:output_dir]).writable? 
Trollop::die :output_dir, "must be a directory"  unless opts[:output_dir] and File.stat(opts[:output_dir]).directory?

Grapher.generate_reports(opts)

`open #{ARGV[1]}` if ARGV.last == "open" 
puts "Done."

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stresser-0.3.2 bin/stresser-grapher
stresser-0.3.1 bin/stresser-grapher