Skip to content

Instantly share code, notes, and snippets.

@samvincent
Created June 7, 2009 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samvincent/125099 to your computer and use it in GitHub Desktop.
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.
#!/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