Created
June 7, 2009 01:56
-
-
Save samvincent/125099 to your computer and use it in GitHub Desktop.
Quickly add friends to an email list you'll set up some day.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'yaml' | |
# Add users quickly from command line to email_list.txt | |
# usage is: | |
# $ ruby email_list.rb [name] [email] | |
name, email = ARGV | |
file_name = 'email_list.txt' | |
if name and email | |
list = YAML.load(File.read(file_name)) || [] | |
list << {:name => name, :email=> email} | |
file = File.open(file_name, 'w+') | |
file.write(list.to_yaml) | |
file.close | |
puts "You have #{list.size} people waiting for your awesome project!" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment