Class: MOSAIK::Commands::Visualize

Inherits:
MOSAIK::Command::Graph show all
Defined in:
lib/mosaik/commands/visualize.rb

Overview

Render graph visualization

Instance Method Summary collapse

Instance Method Details

#callObject



26
27
28
29
30
31
# File 'lib/mosaik/commands/visualize.rb', line 26

def call
  info "Visualizing graph (#{options.map { |k, v| "#{k}: #{v}" }.join(', ')})"

  # Render graph visualization
  visualize_graph
end

#validateObject

Raises:



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/mosaik/commands/visualize.rb', line 14

def validate
  super

  raise OptionError, "input file not found: #{options[:input]}" unless File.exist? options[:input]

  # Force visualization
  options[:visualize] = true

  # Remove output file extension
  options[:output] = options[:output].sub(/\.\w+$/, "")
end