Permalink
Browse files

refactored the RealName stuff a bit, thanks mattetti!

  • Loading branch information...
1 parent d2c487c commit 749b3bf3565fd327994096a56b9cea4d9f5d1a8d @benburkert committed Sep 9, 2008
Showing with 6,147 additions and 5,590 deletions.
  1. +1 −1 Rakefile
  2. +10 −6 lib/randgen.rb
  3. +19 −4,284 lib/wordlists/female_names.rb
  4. +18 −1,228 lib/wordlists/male_names.rb
  5. +22 −20 lib/wordlists/real_name.rb
  6. +14 −51 spec/regression/regexp_spec.rb
  7. +94 −0 spec/unit/randgen_spec.rb
  8. +4,275 −0 wordlists/female_names
  9. +1,219 −0 wordlists/male_names
  10. +475 −0 wordlists/surnames
View
@@ -13,7 +13,7 @@ EMAIL = "ben@benburkert.com"
HOMEPAGE = "http://github.com/benburkert/randexp"
TITLE = "Randexp Gem"
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/**/*")
RUBYFORGE_USER = "benburkert"
View
@@ -38,16 +38,20 @@ def self.word(options = {})
word
end
- def self.first_name(gender=nil)
- RealName.first_name(gender)
+ def self.first_name(options = {})
+ RealName.first_names(options).pick
end
- def self.last_name(options = {})
- RealName.last_name
+ def self.surname(options = {})
+ RealName.surnames(options).pick
+ end
+
+ class << self
+ alias_method :last_name, :surname
end
- def self.name(gender=nil)
- RealName.name(gender)
+ def self.name(options = {})
+ "#{first_name(options)} #{surname(options)}"
end
def self.sentence(options = {})
Oops, something went wrong.

0 comments on commit 749b3bf

Please sign in to comment.