Sha256: 65b71cba72eb6c14221ba4e7f0a505f08eaae477c70a0fadbf9319e48d46aee0

Contents?: true

Size: 1.31 KB

Versions: 67

Compression:

Stored size: 1.31 KB

Contents

# This file is an example of a generic Test plugin.
# The MyTopographerOutputPlugin example contains example of code that could be used to write a plugin for new topographer output formats.
module HybridPlatformsConductor

  class Topographer

    module Plugins

      # Brief description of the plugin here.
      # The name should match the file name.
      # It should always inherit from Topographer::Plugin.
      # In all instance methods of a test plugin, the following variables are accessible:
      # * @topographer (Topographer): Topographer used to get info about the graph to render.
      class MyTopographerOutputPlugin < Topographer::Plugin

        # Output the nodes graph in a file
        # [API] - This method is mandatory.
        #
        # Parameters::
        # * *file_name* (String): The file name for output
        def write_graph(file_name)
          # This method is meant to dump into a file named file_name the graph in the plugin-specific format.
          File.open(file_name, 'w') do |f|
            f.puts 'Graph dump'
            @topographer.nodes_graph.each do |node_name, node_info|
              f.puts "#{node_name} is linked to #{node_info[:connections].map { |connected_node_name, _labels| connected_node_name }.join(', ')}"
            end
          end
        end

      end

    end

  end

end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
hybrid_platforms_conductor-33.9.5 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.9.4 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.9.2 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.9.1 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.9.0 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.8.4 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.8.3 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.8.2 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.8.1 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.8.0 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.7.4 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.7.3 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.7.2 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.7.1 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.7.0 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.6.0 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.5.1 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.5.0 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.4.0 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample
hybrid_platforms_conductor-33.3.0 lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample