Sha256: 31a9185f544faaa70104ad7b71a1f8d9434320417576d60073e526ea9aba1416
Contents?: true
Size: 877 Bytes
Versions: 5
Compression:
Stored size: 877 Bytes
Contents
require 'thor' module TaskManager class Cli < Thor include Thor::Actions desc 'add', 'Add a new task to the waiting queue' method_option :name, aliases: '-n', desc: 'Name of the task', type: :string, required: true method_option :score, aliases: '-s', desc: 'Score of the task', type: :integer def add TaskManager.add(options[:name], options[:score]) end desc 'pick', 'Pick a task from the waiting queue' method_option :id, aliases: '-i', desc: 'ID of the task', type: :integer, required: true def pick TaskManager.pick(options[:id]) end desc 'current', 'Current task' def current TaskManager.current end desc 'finish', 'Finish the current task' def finish TaskManager.finish end desc 'stats', 'Statistics of all queues' def stats TaskManager.stats end end end
Version data entries
5 entries across 5 versions & 1 rubygems