Sha256: 609f37d5108ba92e44321757343deda627c855e6c86026bb2355d36b5dad9525
Contents?: true
Size: 423 Bytes
Versions: 53
Compression:
Stored size: 423 Bytes
Contents
require 'main' ARGV.replace %w( 40 1 1 ) if ARGV.empty? Main { argument('foo'){ arity 3 # foo will given three times cast :int # value cast to Fixnum validate{|foo| [40,1].include? foo} # raises error in failure case description 'the foo param' # shown in --help } def run p params['foo'].given? p params['foo'].values end }
Version data entries
53 entries across 52 versions & 3 rubygems