Sha256: 2da4945e7811a08c76f95cf7c6a2da8f6e9aae8f8891f99ecb28af91c8b72780

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'optparse'
require 'yaml'

require 'rudder'

name = File.basename __FILE__

# TODO: Figure out a nice way to join these options with fly's without
# tieing them together
options = {}
optparse = OptionParser.new do |opts|
  opts.banner = "Usage: #{name} [options]"

  opts.on('-o', '--output YAML_PATH', 'YAML_PATH to write the pipeline config') do |p|
    options[:output] = p
  end

  opts.on('-c', '--config RUDDER_CONFIG', 'Path to the RUDDER_CONFIG file to evaluate') do |c|
    options[:rudder] = c
  end

  opts.on('-v', '--version', 'Show version') do
    options[:version] = true
  end
end
optparse.parse!

if options[:version]
  puts "Rudder Version: #{Rudder::VERSION}"
  exit
end

unless options[:rudder]
  puts 'Must provide RUDDER_CONFIG as option'
  puts optparse.help
  exit 1
end

pipeline = Rudder.compile(options[:rudder])

output   = STDOUT
if options[:output]
  output = File.open(options[:output], 'w+')
  at_exit do
    output.close
  end
end

Rudder.dump(pipeline, output)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rudder-0.2.2 exe/rudder
rudder-0.2.1 exe/rudder
rudder-0.2.0 exe/rudder
rudder-0.1.0 exe/rudder