Sha256: 99e6cc95a0e267712e9cf399fbf86cbf0113beb848c28a51d7bece48334b4f9e

Contents?: true

Size: 576 Bytes

Versions: 1

Compression:

Stored size: 576 Bytes

Contents

require "thor"
require "json"
require "pathname"

module CodeInventory
  module CLI
    class App < Thor
      desc "csv AGENCY FILENAME", "Build an inventory from a CSV file"
      def csv(agency, filename)
        file = Pathname.new(filename)
        unless File.exist? file
          puts "No such file: #{file}"
          exit 1
        end
        source = CodeInventory::CSVFile.new(file)
        inventory = CodeInventory::Inventory.new(source)
        output = inventory.generate(agency, "2.0.0")
        puts JSON.pretty_generate(output)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codeinventory-0.3.1 lib/codeinventory/cli/csv.rb