Sha256: 363d20431974bffde9b75ae977e854dc896ae3d6435f75ee11bae79c32d23952

Contents?: true

Size: 1.24 KB

Versions: 4

Compression:

Stored size: 1.24 KB

Contents

#!/usr/bin/env ruby
$LOAD_PATH.push File.expand_path('../../lib', __FILE__)

require 'optparse'
require 'rubrowser'
require 'rubrowser/renderer'

options = {
  toolbox: true,
  layout: nil,
  output: STDOUT
}

OptionParser.new do |opts|
  opts.banner = "Usage: #{File.basename(__FILE__)} [options] [file] ..."

  opts.on(
    '-oFILE',
    '--output=FILE',
    'output file page, if not specified output will be written to stdout'
  ) { |output| options[:output] = output }

  opts.on(
    '-lFILE',
    '--layout=FILE',
    'layout file to apply on the resulting graph'
  ) { |layout| options[:layout] = layout }

  opts.on(
    '-sSERVER:PORT',
    '--server=SERVER:PORT',
    'rubrowser server for execution monitoring'
  ) { |server| options[:server] = server }

  opts.on('-T', '--no-toolbox', 'Don\'t display toolbox on the page') do
    options[:toolbox] = false
  end

  opts.on('-j', '--json', 'Do export data as JSON instead of HTML') do
    options[:json] = true
  end

  opts.on('-v', '--version', 'Print Rubrowser version') do
    puts "Rubrowser #{Rubrowser::VERSION}"
    exit
  end

  opts.on('-h', '--help', 'Prints this help') do
    puts opts
    exit
  end
end.parse!

options[:files] = ARGV.empty? ? ['.'] : ARGV

Rubrowser::Renderer.call(options)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubrowser-2.10 bin/rubrowser
rubrowser-2.9.1 bin/rubrowser
rubrowser-2.9.0 bin/rubrowser
rubrowser-2.8.0 bin/rubrowser