Sha256: eb7c435e59ef195809414ee8a349ca256d66e703596857a9b666d6ba8c5de2fd
Contents?: true
Size: 634 Bytes
Versions: 42
Compression:
Stored size: 634 Bytes
Contents
require 'shellwords' module Vmail class Query # args is an array like ARGV def self.parse(args) if args.is_a?(String) args = Shellwords.shellwords args end query = if args.empty? [100, 'ALL'] elsif args.size == 1 && args[0] =~ /^\d+/ [args.shift, "ALL"] elsif args[0] =~ /^\d+/ args else [100] + args end query end def self.args2string(array) array.map {|x| x.to_s.split(/\s+/).size > 1 ? "\"#{x}\"" : x.to_s }.join(' ') end end end
Version data entries
42 entries across 42 versions & 1 rubygems
Version | Path |
---|---|
vmail-1.2.5 | lib/vmail/query.rb |
vmail-1.2.4 | lib/vmail/query.rb |