Skip to content

Commit

Permalink
webster extracted from Umbrella Today
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Croak committed Oct 26, 2008
0 parents commit 0471cf8
Show file tree
Hide file tree
Showing 8 changed files with 113,603 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'rake'

begin
require 'rubygems'
require 'jeweler'
Jeweler.gemspec = Gem::Specification.new do |s|
s.name = "webster"
s.summary = "Generate random short words. Good for human-readable confirmation codes."
s.email = "dcroak@thoughtbot.com"
s.homepage = "http://github.com/dancroak/webster"
s.description = "Generate random short words. Good for human-readable confirmation codes."
s.authors = ["Dan Croak"]
s.files = FileList["[A-Z]*", "{lib,test}/**/*"]
end
rescue LoadError
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end

4 changes: 4 additions & 0 deletions VERSION.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
patch: 0
major: 0
minor: 2
Binary file added lib/.webster.rb.swp
Binary file not shown.
15 changes: 15 additions & 0 deletions lib/webster.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Webster

DICTIONARY_FILE = File.join(File.dirname(__FILE__), "words")

attr_accessor :dictionary

def initialize
@dictionary = IO.readlines DICTIONARY_FILE
end

def random
dictionary[rand(dictionary.size)].chomp
end

end
Loading

0 comments on commit 0471cf8

Please sign in to comment.