Sha256: f25828379f80d6df2f2efefea3ae5db53e5935900bf2be25e23de1e61817c9f6
Contents?: true
Size: 635 Bytes
Versions: 19
Compression:
Stored size: 635 Bytes
Contents
require 'guignol/commands/base' require 'uuidtools' Guignol::Shell.class_eval do desc 'uuid [COUNT]', 'Print random UUIDs' method_option :count, :aliases => %w(-c), :type => :numeric, :default => 1, :desc => 'Number of UUIDs to print' def uuid unless options[:count].kind_of?(Fixnum) && options[:count] > 0 raise Thor::Error.new('Count should be a positive integer') end Guignol::Commands::UUID.new.run(options[:count]) end end module Guignol::Commands class UUID def run(count = 1) count.times do puts UUIDTools::UUID.random_create.to_s.upcase end end end end
Version data entries
19 entries across 19 versions & 1 rubygems