This is my work through of the Jumpstart Labs Ruby exericse Event Reporter.
The approach I am taking for this is to try some BDD using Cucumber and RSpec.
Erase any loaded data and parse the specified file. If no filename is given, default to event_attendees.csv
.
Output a listing of the available individual commands
Output a description of how to use the specific command. For example:
help queue clear
help find
Output how many records are in the current queue
Empty the queue
Print out a tab-delimited data table with a header row following this format:
LAST NAME FIRST NAME EMAIL ZIPCODE CITY STATE ADDRESS PHONE
Print the data table sorted by the specified attribute
like zipcode
.
Export the current queue to the specified filename as a CSV. The file should should include data and headers for last name, first name, email, zipcode, city, state, address, and phone number.
Load the queue with all records matching the criteria for the given attribute. Example usages:
find zipcode 20011
find last_name Johnson
find state VA
The comparison should:
- Be insensitive to case, so
"Mary"
and"mary"
would be found in the same search - Be insensitive to internal whitespace, but not external:
"John"
and"John "
are considered matches"John Paul"
and"Johnpaul"
are not matches
- Not do substring matches, so a
find first_name Mary
does not find a record with first name"marybeth"