class Pipely::Actions::GraphFilePipeline

Graph a pipeline definition from a file.

Public Class Methods

new(options) click to toggle source
# File lib/pipely/actions/graph_file_pipeline.rb, line 8
def initialize(options)
  @options = options
end

Public Instance Methods

execute() click to toggle source
# File lib/pipely/actions/graph_file_pipeline.rb, line 12
def execute
  puts "Generating #{output_file}"
  Pipely.draw(definition_json, output_file)
end

Private Instance Methods

definition_json() click to toggle source
# File lib/pipely/actions/graph_file_pipeline.rb, line 19
def definition_json
  File.open(@options.input_path).read
end
output_base() click to toggle source
# File lib/pipely/actions/graph_file_pipeline.rb, line 23
def output_base
  @output_base ||= File.basename(@options.input_path,".*") + '.png'
end
output_file() click to toggle source
# File lib/pipely/actions/graph_file_pipeline.rb, line 27
def output_file
  @output_file ||= if @options.output_path
    File.join(@options.output_path, output_base)
  else
    output_base
  end
end