Draw is command-line app written in ruby as a little project to test gli.
It lets you build a list of guests which you’ll use to organize a gift draw.
To be able to run the application, you need to have ruby 1.9.3 or above installed.
To install the appplication you can click on the ‘Download Zip’ button on the right and unzip the file in a location of your choice.
Or, in a terminal, type:
git clone https://github.com/pantoniotti/draw.git
Then
cd draw bundle install
First, to avoid typing “bundle exec …” everytime, may I suggest creating an alias for the terminal session, so that you only have to type “draw do_this”, instead of the whole “bundle exec draw do_this” :
alias draw='bundle exec draw'
If you choose to do this, just replace all “bundle exec draw” part of the commands below by “draw”.
Once the application is installed and gems bundled, run:
bundle exec draw init
This will command will create a guests list containing the host and his wife name: Mr and Mrs Brault. From there, all familly members can add their own name (with their spouses/companion if they have one) When all members have entered their names in the guest list, Mr Brault can run the draw.
To simplify the guest loading process, you can edit the guests.txt file to add as many guests as you want. Each line must be in the format : “MyName,MySpouseName”, or “MyName” only if single.
To make sure all participants spouses/friend who did not yet entered their information are also in the list, run the “match” command (see below).
The result of the draw is a table containing the list of all the participants and the person they should give a present to.
Hope you find this usefull.
~ The draw team ~
Add a guest to the list:
Note: ‘-n’ flag is mandatory, ‘-j’ is not (a guest can be single)
bundle exec draw guests add -n "My name" -j "My spouse or friend name if any"
Clear the guests list.
bundle exec draw guests clear
Seed the guests list to batch add guests from a text file values (guests.txt).
bundle exec draw guests seed
Aumatically create new guests from existing guests spouse/friend names:
Note: All existing ones will be ignored.
bundle exec draw guests match
Show the guests list:
bundle exec draw guests list
Show the guests list filtered by name:
Note: The filter can be case insensitive partial name: e.g. “bra” for “Mr Brault”.
bundle exec draw guests add -n "My Name" -j "My Spouse/Friend Name"
Starts the draw and outputs the gifts list:
bundle exec draw run"
Clear the gift draw list:
bundle exec draw clear
Show the gifts list:
bundle exec draw list
Show the gifts table filtered by guest name:
Note: The filter can be case insensitive partial name: e.g. “bra” for “Mr Brault”.
bundle exec draw list "My Name"
Show the help:
bundle exec draw --help
Run all tests:
bundle exec rake wip