Sha256: 506652254005ccbe10d2d250f4cfd81b9a0a1bbb7f4f04aef0eaee8001ac25b1

Contents?: true

Size: 1.71 KB

Versions: 2

Compression:

Stored size: 1.71 KB

Contents

require "thor"
require "hasmenu/version"
require "hasmenu/printer"
require "hasmenu/formatter"
require "hasmenu/spellchecker"
require "hasmenu/validator"
require "hasmenu/builder"
require "hasmenu/reporter"

module Hasmenu
  class Cli < Thor
    map %w(--version -v) => :__print_version

    desc "--version, -v", "Print the version"
    def __print_version
      puts Hasmenu::VERSION
    end

    desc "format <type> <path>", "Format Has.Menu data"
    option :location, aliases: :l, desc: "Path to data repository"
    def format(type, path)
      Hasmenu::Formatter.new(type, options).format(path)
    end
    map "f" => :format

    desc "spellcheck <path>", "Run spellcheck on Has.Menu data"
    option :dicts, aliases: :d, desc: "Path to dictionary files"
    option :except, aliases: :e, desc: "Exception file id"
    def spellcheck(path)
      Hasmenu::SpellChecker.new(options).check(path)
    end
    map "sc" => :spellcheck

    desc "validate <type> <path>", "Run validation on Has.Menu data"
    option :schema, aliases: :s, desc: "Path to schema files"
    def validate(type, path)
      Hasmenu::Validator.new(type, options).perform(path)
    end
    map "v" => :validate

    desc "build <type> [uid] [menu-uid]", "Build one or more restaurant menus from chain menu"
    option :location, aliases: :l, desc: "Path to data repository"
    def build(type, uid = nil, menu_uid = nil)
      Hasmenu::Builder.new(type, options).build(uid, menu_uid)
    end
    map "b" => :build

    desc "report <type>", "Report the status and metrics from the repository"
    option :location, aliases: :l, desc: "Path to data repository"
    def report(type)
      Hasmenu::Reporter.new(type, options).report
    end
    map "r" => :report
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hasmenu-0.1.7 lib/hasmenu.rb
hasmenu-0.1.6 lib/hasmenu.rb