File: enum.thor

package info (click to toggle)
ruby-thor 1.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 924 kB
  • sloc: ruby: 9,491; makefile: 8; sh: 1
file content (10 lines) | stat: -rw-r--r-- 200 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
class Enum < Thor::Group
  include Thor::Actions

  desc "snack"
  class_option "fruit", :aliases => "-f", :type => :string, :enum => %w(apple banana)
  def snack
    puts options['fruit']
  end

end