Sha256: 2d87cfca4b985d34f1ef46cf29a34446fda97399f8bcc41fb5fca32710698c5e
Contents?: true
Size: 575 Bytes
Versions: 6
Compression:
Stored size: 575 Bytes
Contents
require 'thor' require 'fukuzatsu' module Fukuzatsu class CLI < Thor desc "parse PATH_TO_FILE -f FORMAT", "Formats are text (default, to STDOUT), html, and csv. Ex: parse foo.rb -f html" method_option :format, :type => :string, :default => 'text', :aliases => "-f" def parse(file) file = ParsedFile.new(path_to_file: file) case options['format'] when 'html' Formatters::Html.new(file).export when 'csv' Formatters::Csv.new(file).export else Formatters::Text.new(file).export end end end end
Version data entries
6 entries across 6 versions & 1 rubygems