Sha256: 3e821525dffc10145432ffbd68e3a7e13f72ec959a766e096e5e43435739b5f6
Contents?: true
Size: 691 Bytes
Versions: 1
Compression:
Stored size: 691 Bytes
Contents
require 'thor' require 'foodie/food' module Foodie class CLI < Thor # bundle exec exe/foodie portray broccoli => "Gross!" desc 'portray ITEM', 'Determines if a piece of food is gross or delicious' def portray(name) puts Foodie::Food.portray(name) end # bundle exec exe/foodie pluralize -w Tomato => "Tomatoes" desc 'pluralize', 'Pluralize a word' method_option :word, aliases: '-w' # Here there’s the new method_option method we use which defines, well, a method option. # It takes a hash which indicates the details of an option how they should be returned to our task. def pluralize puts Foodie::Food.pluralize(options[:word]) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
foodie-ingmarsk-0.1.0 | lib/foodie/cli.rb |