Skip to content

Commit

Permalink
refactored the RealName stuff a bit, thanks mattetti!
Browse files Browse the repository at this point in the history
  • Loading branch information
benburkert committed Sep 9, 2008
1 parent d2c487c commit 749b3bf
Show file tree
Hide file tree
Showing 10 changed files with 6,147 additions and 5,590 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -13,7 +13,7 @@ EMAIL = "ben@benburkert.com"
HOMEPAGE = "http://github.com/benburkert/randexp" HOMEPAGE = "http://github.com/benburkert/randexp"
TITLE = "Randexp Gem" TITLE = "Randexp Gem"
SUMMARY = "Library for generating random strings." SUMMARY = "Library for generating random strings."
FILES = %w(LICENSE README README Rakefile TODO CHANGELOG) + Dir.glob("{lib,spec}/**/*") FILES = %w(LICENSE README README Rakefile TODO CHANGELOG) + Dir.glob("{lib,spec}/**/*") + Dir.glob("wordlists/**/*")
RDOC_FILES = %w(LICENSE README README Rakefile TODO CHANGELOG) + Dir.glob("lib/**/*") RDOC_FILES = %w(LICENSE README README Rakefile TODO CHANGELOG) + Dir.glob("lib/**/*")


RUBYFORGE_USER = "benburkert" RUBYFORGE_USER = "benburkert"
Expand Down
16 changes: 10 additions & 6 deletions lib/randgen.rb
Expand Up @@ -38,16 +38,20 @@ def self.word(options = {})
word word
end end


def self.first_name(gender=nil) def self.first_name(options = {})
RealName.first_name(gender) RealName.first_names(options).pick
end end


def self.last_name(options = {}) def self.surname(options = {})
RealName.last_name RealName.surnames(options).pick
end

class << self
alias_method :last_name, :surname
end end


def self.name(gender=nil) def self.name(options = {})
RealName.name(gender) "#{first_name(options)} #{surname(options)}"
end end


def self.sentence(options = {}) def self.sentence(options = {})
Expand Down

0 comments on commit 749b3bf

Please sign in to comment.