-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webster extracted from Umbrella Today
- Loading branch information
Dan Croak
committed
Oct 26, 2008
0 parents
commit 0471cf8
Showing
8 changed files
with
113,603 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
patch: 0 | ||
major: 0 | ||
minor: 2 |
Binary file not shown.
This file contains 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
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 |
Oops, something went wrong.