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

Version Path
main-6.3.0 samples/b.rb
main-6.2.3 samples/b.rb
main-6.2.2 samples/b.rb
main-6.2.1 samples/b.rb
main-6.2.0 samples/b.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/main-6.1.0/samples/b.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/main-6.0.0/samples/b.rb
main-6.1.0 samples/b.rb
ahoward-main-2.9.0 samples/b.rb
main-6.0.0 samples/b.rb
main-5.3.2 samples/b.rb
main-5.3.1 samples/b.rb
main-5.2.0 samples/b.rb
main-5.1.1 samples/b.rb
main-5.1.0 samples/b.rb
main-5.0.1 samples/b.rb
main-5.0.0 samples/b.rb
main-4.8.1 samples/b.rb
main-4.8.0 samples/b.rb
main-4.7.7 samples/b.rb