Sha256: edff7c34976dbe6fdcbd42e4a1d3ad1ffc101406ccc8c58972ebc72dfd725ded

Contents?: true

Size: 589 Bytes

Versions: 4

Compression:

Stored size: 589 Bytes

Contents

require 'clamp'

module Podpisy
  class CLI < Clamp::Command
    option ['-a', '--areas'], :flag, 'convert postcode to aree in CSV'
    option ['-c', '--csv'], 'CSV', 'output to CSV file'
    option ['-t', '--tex'], 'TEX', 'output to TEX file'
    parameter 'file', 'csv file with signatures', attribute_name: :file

    def execute
      sigs = Signatures.new(file, areas: areas?)
      if csv
        open(csv, 'wb') do |out|
          sigs.to_csv out
        end
      end

      if tex
        open(tex, 'wb') do |out|
          sigs.to_tex out
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
podpisy-0.1.3 lib/podpisy/cli.rb
podpisy-0.1.2 lib/podpisy/cli.rb
podpisy-0.1.1 lib/podpisy/cli.rb
podpisy-0.1.0 lib/podpisy/cli.rb