Sha256: 43d9d55798a5e7664f96634945bc6038dba26b8edbbb2ec430a446f1e999dcbf

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

require 'cri'

class Kriterion
  class CLI
    class API
      def self.command
        @cmd ||= Cri::Command.define do
          name        'api'
          usage       'api --standards_dir <uri>'
          summary     'Runs a kriterion API server'

          flag   :h,  :help,  'show help for this command' do |value, cmd|
            puts cmd.help
            exit 0
          end

          option   :u, :standards_dir,            'URI of the RestMQ server', argument: :required
          optional :h, :mongo_hostname, 'Hostname of the MongoDB server to use', default: 'localhost'
          optional :d, :mongo_database, 'Name of the MongoDB database to use', default: 'kriterion'
          optional :p, :mongo_port,     'Port for MongoDB', default: 27017


          run do |opts, args, cmd|
            # TODO: Get log levels working properly
            require 'kriterion/api'
            worker = Kriterion::API.new(opts)
            worker.run
          end
        end
      end
    end
  end
end

Kriterion::CLI.command.add_command(Kriterion::CLI::API.command)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kriterion-0.0.1 lib/kriterion/cli/api.rb