randomperson 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +1 -0
- data/Manifest +17 -1
- data/README +25 -0
- data/Rakefile +4 -2
- data/gem-public_cert.pem +20 -0
- data/lib/Choice.rb +1 -1
- data/lib/CommonFormatsFirstName.rb +38 -0
- data/lib/Formatter.rb +31 -0
- data/lib/Generator.rb +1 -1
- data/lib/Name.rb +22 -0
- data/lib/NameFiles/AmericanLast.rb +14 -25
- data/lib/NameFiles/AmericanMaleFirst.rb +12 -22
- data/lib/NameFiles/AmericanSuffix.rb +7 -6
- data/lib/NameFiles/AnyLast.rb +13 -10
- data/lib/NameFiles/BasqueLast.rb +6 -24
- data/lib/NameFiles/BritishPrefix.rb +29 -0
- data/lib/NameFiles/BritishSuffix.rb +30 -0
- data/lib/NameFiles/EnglishFemaleFirst.rb +14 -11
- data/lib/NameFiles/EnglishLast.rb +7 -18
- data/lib/NameFiles/EnglishMaleFirst.rb +21 -0
- data/lib/NameFiles/ScottishFemaleFirst.rb +21 -0
- data/lib/NameFiles/ScottishLast.rb +22 -0
- data/lib/NameFiles/ScottishMaleFirst.rb +21 -0
- data/lib/NameFiles/SpanishFemaleFirst.rb +20 -17
- data/lib/NameFiles/SpanishLast.rb +6 -23
- data/lib/NameFiles/SpanishMaleFirst.rb +19 -17
- data/lib/NameFiles/SwedishFemaleFirst.rb +22 -0
- data/lib/NameFiles/SwedishLast.rb +21 -0
- data/lib/NameFiles/SwedishMaleFirst.rb +20 -0
- data/lib/NameFiles/ThaiFirst.rb +5 -22
- data/lib/NameFiles/ThaiRomanisedFemaleFirst.rb +5 -22
- data/lib/NameFiles/ThaiRomanisedLast.rb +5 -23
- data/lib/NameFiles/ThaiRomanisedMaleFirst.rb +4 -22
- data/lib/NameFiles/WelshFemaleFirst.rb +22 -0
- data/lib/NameFiles/WelshLast.rb +23 -0
- data/lib/NameFiles/WelshMaleFirst.rb +22 -0
- data/randomperson.gemspec +4 -4
- data/t/Generator.t +23 -10
- data.tar.gz.sig +0 -0
- metadata +36 -5
- metadata.gz.sig +0 -0
- data/lib/NameFiles/EnglishPrefix.rb +0 -26
@@ -2,13 +2,8 @@
|
|
2
2
|
|
3
3
|
module RandomPerson
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
class ThaiRomanisedLast
|
8
|
-
include Names
|
9
|
-
|
10
|
-
#def names() NAMES; end
|
11
|
-
|
5
|
+
class ThaiRomanisedLast < Name
|
6
|
+
|
12
7
|
def initialize
|
13
8
|
@formats = {
|
14
9
|
:single => ->(n) { n.rand },
|
@@ -17,22 +12,9 @@ module RandomPerson
|
|
17
12
|
|
18
13
|
@formats_ratiod = [ 0..49, 50..99 ]
|
19
14
|
end
|
20
|
-
|
21
|
-
attr_accessor :formats, :formats_ratiod
|
22
|
-
|
23
|
-
def execute( person, format=nil )
|
24
|
-
if @formats.length > 1
|
25
|
-
r = rand(@formats_ratiod.last.end)
|
26
|
-
i = @formats_ratiod.index_in_range( r )
|
27
|
-
f = @formats.by_index(i).last
|
28
|
-
else
|
29
|
-
f = @formats[:single]
|
30
|
-
end
|
31
|
-
Names.execute( NAMES, f )
|
32
|
-
end
|
33
|
-
|
34
15
|
|
35
|
-
|
36
|
-
|
16
|
+
def setupnames
|
17
|
+
@names = %w{ Aromdee Atitarn Bunyasarn Chaiprasit Chaisurivirat Jetatikarn Jetjirawat Juntasa Kadesadayurat Kaewburesai Kaouthai Kasamsun Kitjakarn Kongkatitum Kongpaisarn Kongsangchai Kraiputra Kunakorn Kunchai Kurusarttra Leekpai Leelapun Lertkunakorn Maleenon Maneerattana Meesang Narkbunnum Narkhirunkanok Nimitwanitch Ornlamai Paowsong Parnpradub Parnthong Pornpipatpong Prasongsanti Puntasrima Punyawong Rojjanasukchai Rojumanong Saenamuang Sakda Sangsorn Shinawatra Sirisopa Somchai Somwan Songprawati Sripituksakul Srisati Sriwarunyu Sukbunsung Suntornnitikul Suppamongkon Suttirat Tawisuwan Thumying Tuntayakul Udomprecha Vipavakit Visalyaputra Wattanapanit Wattanasin Yongjaiyut Yuvaves }
|
37
18
|
end
|
19
|
+
end
|
38
20
|
end
|
@@ -2,12 +2,7 @@
|
|
2
2
|
|
3
3
|
module RandomPerson
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
class ThaiRomanisedMaleFirst
|
8
|
-
include Names
|
9
|
-
|
10
|
-
#def names() NAMES; end
|
5
|
+
class ThaiRomanisedMaleFirst < Name
|
11
6
|
|
12
7
|
def initialize
|
13
8
|
@formats = {
|
@@ -16,22 +11,9 @@ module RandomPerson
|
|
16
11
|
|
17
12
|
@formats_ratiod = [ (0..99)]
|
18
13
|
end
|
19
|
-
|
20
|
-
attr_accessor :formats, :formats_ratiod
|
21
|
-
|
22
|
-
def execute( person, format=nil )
|
23
|
-
if @formats.length > 1
|
24
|
-
r = rand(@formats_ratiod.last.end)
|
25
|
-
i = @formats_ratiod.index_in_range( r )
|
26
|
-
f = @formats.by_index(i).last
|
27
|
-
else
|
28
|
-
f = @formats[:single]
|
29
|
-
end
|
30
|
-
Names.execute( NAMES, f )
|
31
|
-
end
|
32
14
|
|
33
|
-
|
34
|
-
|
35
|
-
|
15
|
+
def setupnames
|
16
|
+
@names = %w{ Alak Ananda Annan Anuia Anuman Anurak Badinton Baharn Bahn Bapit Baroma Bhakdi Bhumipol Boon-Mee Boon-Nam Burimas Burut Cha Chai Chairat Chaiyanuchit Chaiyo Chakri Chalerm Chalermchai Changsai Chanthara Chao-Khun-Sa Chao-Tak Charoen Charoensom Charong Chatchalerm Chatchom Chatri Chaturon Chavalit Chesda Chomanan Chompoo Chongrak Choochai Choonhavan Choonhavon Chuachai Chuanchen Chuia Chula Chulalongkorn Chulamai Churai Chuthamani Daeng Darin Deng Dhipyamongkol Disnadda Ditaka Dithakar Dok Duchanee Emjaroen Erawan Fah Fufanwonich Gee Hainad Hanuman Intradit Ittiporn Jaidee Jao Jarunsuk Jatukamramthep Jayavarman Kamnan Kanda Karmatha Kasem Kasemchai Kasemsan Keetau Khakanang Khun Kiet Kit Kitti Kittibun Kittichai Kittichat Kittikchorn Kob Komalat Kongsampong Korn Kovit Kraisee Kraisingha Krarayoon Kriengsak Kris Krita Krom-Luang Kukrit Kusa Kwanchai Kwanjai Lamom Lamon Lap Leekpai Leekpie Lek Loesan Luk Maha Mahidol Malian Manitho Mee Mengrai Metananda Mok Mokkhavesa Mongkut Monyakul Muoi Nadee Nai-Thim Nak Nang-Klao Narai Naresuan Naris Narisa Net Ngam Nikom Nikon Nintau Niran Nit Noi Nongchai Noppadon Norachai Nuananong Nui Nung Nuta-Laya Obb Othong Pairat Paitoon Pakhdi Palat Panyarachun Paramendr Parnchand Pattama Pet Petchara Petchra Phaibun Phara Phinihan Phraisong Phrom-Borirak Phya Pichai Pichit Pira Pra Prachuab Pramoj Prasong Pravat Praves Praya Pricha Prisna Proi Pu Rachotai Rak Ramkamhaeng Rangsan Ratanankorn Ratsami Sajja Sanouk Santichai Sanun Sap Sarawong Sarit Sataheep Satrud Sawat Seni Si Siam Sinn Sombat Somchai Somdet-Ong-Yai Somdetch Sompron Son Songgram Soo Sook Sophuk Sri Srimuang Su Suda Sudarak Suk Sulak Sum Sumatra Sunan Sundaravej Suntarankul Sunti Sup Suphatra Suphayok Supoj Supp Supsampantuwongse Suriwongse Suriyawong Sutep Tai Tak-Sin Tam Tau Tep Tham-Boon Thammaraja Thanarat Thanit Thawanya Thawi Thongkon Thurdchai Ti Tiloka Ting Tinsulaananda Tinsulanonda Ton Tong Totsakan Toy Ubol Udom Unakan Vajiralongkorn Vajiravudh Vessandan Vidura Wasi Wattana Wiset Witsanunat Wongsa Xuwicha Yai Yhukon Yindee Yod Yongchaiyudh Yongchaiyuth Yubamrung }
|
36
17
|
end
|
18
|
+
end
|
37
19
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby -wKU
|
2
|
+
|
3
|
+
module RandomPerson
|
4
|
+
|
5
|
+
class WelshFemaleFirst < Name
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@formats = {
|
9
|
+
:single => ->(n) { n.rand },
|
10
|
+
}
|
11
|
+
|
12
|
+
@formats_ratiod = [ (0..99) ]
|
13
|
+
setupnames
|
14
|
+
end
|
15
|
+
|
16
|
+
def setupnames
|
17
|
+
@names = %w{ Aberfa Abertha Adain Adara Addfwyn Addiena Adyna Aelwyd Aeron Amser Angharad Anna Annwyl Argel Arglwyddes Argoel Argraff Arial Ariana Arianell Ariene Aranrhod Arianrhod Arianwen Arlais Armes Arthes Arwydd Asgre Auron Avenable Banon Berth Berthog Bethan Blanchfleur Blodeuwedd Blodwen Braith Brandgaine Branwen Bregus Briallen Brisen Bronwen Buddug Brynn Cadwyn Caethes Cafell Canaid Cari Caron Carys Cate Cath Catrin Ceri Ceridwen Cerwen Cigfa Clarisant Cordelia Corsen Cragen Creiddylad Creirwy Cymreiges Daron Dee Del Dera Derwen Deryn Deverell Dicra Dierdre Difyr Dilys Don Druantia Drysi Dwyn Dylis Ebrill Efa Eheubryd Eira Eirianwen Eiriol Elaine Elen Eleri Ellylw Eluned Eneuawy Enfys Enid Enrhydreg Epona Erdudvyl Eres Essyllt Eurneid Eurolwyn Eyslk Ffanci Ffion Fflur Ffraid Gaenor Ganieda Garan Genevieve Gladys Glenna Glenys Glynis Goewin Goleuddydd Gorawen Guinevere Gwaeddan Gwanwyn Gwawr Gwen Gwenda Gwendolyn Gwener Gweneth Gwenhwyfar Gwenledyr Gwenith Gwenllian Gwenn Gwenno Gwerfyl Gwladys Gwyneira Gwyneth Hafgan Hafren Heledd Hellawes Heulwen Heulyn Hywela Idelle Igerna Iola Isolde Jenifer Kelemon Kigva Lilybet Linette Llinos Llio Lowri Lysanor Mab Mabli Mair Maledisant Mali Marged Meghan Melangell Meleri Meredith Meriel Modlen Modron Mon Morfudd Morgan Morgana Morgause Morvudd Morwen Myfanwy Nerys Nesta Neued Nia Nimue Nona Olwen Owena Penarddun Petra Ragnell Rathtyen Rhan Rhawn Rhedyn Rhiamon Rhian Rhiannon Rhianwen Rhonda Rhonwen Rhosyn Rowena Saeth Saffir Sarff Seren Sian Sioned Siwan Taffy Talaith Talar Tanwen Tarian Tarran Tegan Tegau Tegeirian Tegwen Teleri Telyn Terrwyn Toreth Torlan Torri Trevina Tristan Una Vala Vanora Vivian Wenda Winnifred Wynne Ysbail Yseult }
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/usr/bin/env ruby -wKU
|
2
|
+
|
3
|
+
module RandomPerson
|
4
|
+
|
5
|
+
class WelshLast < Name
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@formats = {
|
9
|
+
:single => ->(n) { n.rand },
|
10
|
+
:double_barrelled_hyphenated => ->(n) { n.rand + '-' + n.rand },
|
11
|
+
}
|
12
|
+
|
13
|
+
@formats_ratiod = [ (0..99) ]
|
14
|
+
setupnames
|
15
|
+
end
|
16
|
+
|
17
|
+
def setupnames
|
18
|
+
@names = %w{ Ace Adams Adda Ajax Alban Allen Andrew Anthony Anwyl Arthur Ashton Astley Augustus Austin Awbrey Bach Bamford Barry Baskerville Bateman Baugh Bebb Bedward Beedle Belth Benbow Bengough Benjamin Bennett Bevan Beynon Bidder Blackwell Blayney Bonner Bonsall Boulter Bound Bowdler Bowen Bown Brace Breese Brigstocke Brooks Brown Bufton Bulkeley Button Bythell Caddock Cadogan Cadwalader Cantington Canton Cardiff Cardigan Carew Charles Christmas Clayton Clement Clocker Clougher Cole Connah Conway Coslett Craddock Crowther Crunn Cunnick Daniel David Dawkins Deere Devonald Dodd Edmunds Edwards Elias Ellis Emanuel Ephraim Esau Evans Eynon Faithfull Felix Fenna Folland Foulkes Francis Gabriel Gadarn Games Geonor George Gethin Gibbs Gittins Goodwin Gough Gravenor Griffiths Gronow Gunter Guy Gwalchmai Gwilt Gynne Gwyther Haines Hall Hamer Harries Harry Hatfield Hathaway Havard Heilyn Herbert Hier Hooson Hopkins Hoskin Howard Howe Howells Hughes Hullin Humphreys Husband Hussey Issac Ithell Jacob James Jarman Jasper Jeffreys Jehu Jervis Job John Jones Joseph Kendrick Kinsey Kneath Knethell Kyffin Landeg Laugharne Lewis Leyshon Llewelyn Lloyd Llywarch Lodwick Lougher Lucas Lumley Mabe Maddocks Mason Matthews Maybery Mendus Meredith Meyler Meyrick Michael Miles Mills Morgan Morris Mortimer Mostyn Nanney Narberth Nash Nevett Newell Nicholas Nock Nuttall Oliver Owen Parker Parry Pask Paskin Peate Peregrine Perkins Peters Phillips Picton Pierce Powell Price Pritchard Probert Probyn Profit Prosser Prothero Pugh Rees Reynolds Rhydderch Richards Roberts Roch Roderick Rogers Rowlands Salmon Salusbury Sambrook Samuel Savage Sayce Sheen Sheldon Smith Smout Stephens Stradling Swancott Tannatt Taylor Teague Tew Thomas Tibbot Timothy Treharne Trevor Trewent Trow Tucker Tudor Turner Vaughan Voyle Walbeoff Walters Warlow Warren Watkins Watts Weal Weaver Whittal Wigley Wild Wilding Williams Wogan Woosencraft Woosnam Worthing Wynne Yorath Young Yong Yonge Yongue }
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby -wKU
|
2
|
+
|
3
|
+
module RandomPerson
|
4
|
+
|
5
|
+
class WelshMaleFirst < Name
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@formats = {
|
9
|
+
:single => ->(n) { n.rand },
|
10
|
+
}
|
11
|
+
|
12
|
+
@formats_ratiod = [ (0..99) ]
|
13
|
+
setupnames
|
14
|
+
end
|
15
|
+
|
16
|
+
def setupnames
|
17
|
+
@names = %w{ Aberthol Accalon Adda Addolgar Adwr Aedd Aeddan Aglovale Alawn Albanwr Aled Alwyn Amaethon Amerawdwr Amhar Amlawdd Amren Amynedd Andras Andreas Aneirin Anfri Angawdd Angor Anir Anwar Anwas Anwell Anwir Anynnawg Anyon Ap Arawn Ardwyad Arglwydd Arian Arianwyn Arthur Arvel Avagdu Avaon Awstin Baddon Barri Barris Baudwin Beda Bedwyr Bedyw Beli Bellieus Benedigeidfram Bercelak Berth Berwyn Beven Blair Blaise Blathaon Bleddyn Bledri Bleidd Bleiddian Bogart Bors Bowen Brac Brad Bradwen Bradwr Braen Bran Brastias Brathach Brian Brice Broderick Bryn Brys Bwlch Cadarn Caddoc Cadell Cadellin Cadeyrn Cadfael Cadfan Cadman Cadoc Cadwaladr Cadwallen Cadwgawn Cadwr Cadyryeith Caer Caerwyn Cai Cain Cairn Calcas Calder Caledvwich Cant Caradawg Caradoc Carey Carnedyr Cas Casnar Casswallawn Caw Cedric Ceithin Celyn Cerdic Ceri Cerwyn Cian Clud Clust Clyde Cnychwr Coed Colgrevance Collen Colwyn Conwy Corryn Cradelmass Crist Cubert Culhwch Culvanawd Custenhin Cymry Cynan Cynbal Cystennin Dafydd Dagonet Dalldav Daned Davis Deiniol Deverell Dewey Digon Dillan Dillus Dilwyn Dinadan Dirmyg Drem Dremidydd Drew Druce Drudwas Drwst Drych Drystan Duach Dylan Dyvynarth Dyvyr Dywel Earwine Ector Edern Edmyg Ehangwen Eiddoel Eiddyl Eiladar Einion Eiryn Eivyonydd Elis Elphin Emhyr Emlyn Emrys Ennissyen Eoin Erbin Ergyryad Ermid Eryi Eudav Eurosswydd Eus Evan Evnissyen Evrawg Evrei Fercos Fflam Fflergant Fflewdwr Ffodor Ffowc Ffransis Fychan Fyrsil Galahad Galehodin Gamon Gandwy Garanhon Gareth Garnock Garselid Garwyli Garym Gavin Gawain Geraint Gerallt Gerwin Gethin Gilbert Gildas Gilvaethwy Gleis Glendower Glew Glewlwyd Glinyeu Glyn Glythvyr Gobrwy Gofannon Gogyvwlch Goreu Gorlois Gormant Goronwy Gorsedd Govan Govannon Govynyon Gowerr Gowther Granwen Greid Greidyawl Griffin Griffith Griflet Gromer Gronw Gruddyeu Gruffen Guinglain Gusg Gwalchmei Gwalhaved Gwallawg Gwallter Gwarthegydd Gwawl Gwern Gwevyl Gwilym Gwion Gwitart Gwrddywall Gwres Gwyddawg Gwyddno Gwydion Gwydre Gwyglet Gwyn Gwyneira Gwynn Gwyr Gwythyr Hafgan Heddwyn Hefaidd Heilyn Hen Hen Hen Heulfryn Heulyn Howell Huw Hydd Hywel Iago Iau Iddawg Idris Iestyn Ieuan Ifor Inek Iolo Iona Iowerth Irvin Ithel Iustig Jestin Jones Kai Kane Keith Kelli Kelyn Kenn Kent Kenyon Kevyn Kian Kilydd Kim Kynan Kyndrwyn Kynedyr Kynlas Kynon Kynwal Kynwyl Lancelot Lavaine Leodegrance Lionel Llacheu Llara Lleu Llevelys Lloyd Lludd Llwch Llwybyr Llwyd Llwydeu Llwyr Llyn Llyr Llywelyn Lot Lovel Lug Mabon Mabsant Macsen Madawg Maddock Maddox Madoc Mael Maelgwn Maelogan Maelwys Mallolwch Malvern Manawydan March Marrock Math Mawrth Maxen Medyr Meical Melkin Menw Mercher Meredith Merlin Meurig Mil Modred Moesen Mordwywr Morgan Morgannwg Morthwyl Morvran Mostyn Myrddin Naw Neb Nentres Nerth Nerthach Neued Newlin Nissyen Nodens Nynnyaw Odgar Ofydd Ol Olwydd Oswallt Owein Padrig Parry Pasgen Pawl Pedr Peissawg Pelles Pellinore Pellyn Pembroke Penn Pennar Penvro Perceval Peredur Powell Price Pryderi Prydwen Prys Puw Pwyll Pyrs Reese Ren Renfrew Rhain Rheged Rhett Rhionganedd Rhisiart Rhobert Rhodri Rhun Rhuvawn Rhyawdd Rhychdir Rhyd Rhydderch Rhys Robat Romney Sayer Seith Sel Selwyn Selyf Selyv Seren Siam Siarl Siawn Siencyn Sinnoch Sion Sior Steffan Sugyn Sulien Sulyen Syvwlch Tad Taffy Taliesin Tarrant Tegid Tegvan Teilo Teithi Teregud Teryrnon Timotheus Tomos Tor Trahern Trefor Tremayne Trent Trevelyan Tringad Tristan Tristram Tudur Twm Twrgadarn Tywysog Uchdryd Urien Vaddon Vaughn Wadu Waljan Weyland Wmffre Wren Wynn Yale Yestin Ysberin Ysgawyn Yspadaden Pencawr }
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
data/randomperson.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{randomperson}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Iain Barnett"]
|
9
9
|
s.cert_chain = ["/Users/iainuser/.ssh/gem-public_cert.pem"]
|
10
|
-
s.date = %q{2010-08-
|
10
|
+
s.date = %q{2010-08-24}
|
11
11
|
s.description = %q{A gem for generating random persons}
|
12
12
|
s.email = %q{iainspeed @nospam@ gmail.com}
|
13
|
-
s.extra_rdoc_files = ["README", "lib/Choice.rb", "lib/Generator.rb", "lib/NameFiles/AmericanLast.rb", "lib/NameFiles/AmericanMaleFirst.rb", "lib/NameFiles/AmericanSuffix.rb", "lib/NameFiles/AnyLast.rb", "lib/NameFiles/BasqueLast.rb", "lib/NameFiles/EnglishFemaleFirst.rb", "lib/NameFiles/EnglishLast.rb", "lib/NameFiles/
|
14
|
-
s.files = ["Manifest", "README", "Rakefile", "lib/Choice.rb", "lib/Generator.rb", "lib/NameFiles/AmericanLast.rb", "lib/NameFiles/AmericanMaleFirst.rb", "lib/NameFiles/AmericanSuffix.rb", "lib/NameFiles/AnyLast.rb", "lib/NameFiles/BasqueLast.rb", "lib/NameFiles/EnglishFemaleFirst.rb", "lib/NameFiles/EnglishLast.rb", "lib/NameFiles/
|
13
|
+
s.extra_rdoc_files = ["CHANGELOG", "README", "lib/Choice.rb", "lib/CommonFormatsFirstName.rb", "lib/Formatter.rb", "lib/Generator.rb", "lib/Name.rb", "lib/NameFiles/AmericanLast.rb", "lib/NameFiles/AmericanMaleFirst.rb", "lib/NameFiles/AmericanSuffix.rb", "lib/NameFiles/AnyLast.rb", "lib/NameFiles/BasqueLast.rb", "lib/NameFiles/BritishPrefix.rb", "lib/NameFiles/BritishSuffix.rb", "lib/NameFiles/EnglishFemaleFirst.rb", "lib/NameFiles/EnglishLast.rb", "lib/NameFiles/EnglishMaleFirst.rb", "lib/NameFiles/ScottishFemaleFirst.rb", "lib/NameFiles/ScottishLast.rb", "lib/NameFiles/ScottishMaleFirst.rb", "lib/NameFiles/SpanishFemaleFirst.rb", "lib/NameFiles/SpanishLast.rb", "lib/NameFiles/SpanishMaleFirst.rb", "lib/NameFiles/SwedishFemaleFirst.rb", "lib/NameFiles/SwedishLast.rb", "lib/NameFiles/SwedishMaleFirst.rb", "lib/NameFiles/ThaiFirst.rb", "lib/NameFiles/ThaiRomanisedFemaleFirst.rb", "lib/NameFiles/ThaiRomanisedLast.rb", "lib/NameFiles/ThaiRomanisedMaleFirst.rb", "lib/NameFiles/WelshFemaleFirst.rb", "lib/NameFiles/WelshLast.rb", "lib/NameFiles/WelshMaleFirst.rb", "lib/Names.rb", "lib/Person.rb", "lib/Ratio.rb", "lib/ext/Array.rb", "lib/ext/Date.rb", "lib/ext/Enumerable.rb", "lib/ext/Hash.rb", "lib/ext/Kernel.rb", "lib/ext/Set.rb", "lib/randomperson.rb"]
|
14
|
+
s.files = ["CHANGELOG", "Manifest", "README", "Rakefile", "gem-public_cert.pem", "lib/Choice.rb", "lib/CommonFormatsFirstName.rb", "lib/Formatter.rb", "lib/Generator.rb", "lib/Name.rb", "lib/NameFiles/AmericanLast.rb", "lib/NameFiles/AmericanMaleFirst.rb", "lib/NameFiles/AmericanSuffix.rb", "lib/NameFiles/AnyLast.rb", "lib/NameFiles/BasqueLast.rb", "lib/NameFiles/BritishPrefix.rb", "lib/NameFiles/BritishSuffix.rb", "lib/NameFiles/EnglishFemaleFirst.rb", "lib/NameFiles/EnglishLast.rb", "lib/NameFiles/EnglishMaleFirst.rb", "lib/NameFiles/ScottishFemaleFirst.rb", "lib/NameFiles/ScottishLast.rb", "lib/NameFiles/ScottishMaleFirst.rb", "lib/NameFiles/SpanishFemaleFirst.rb", "lib/NameFiles/SpanishLast.rb", "lib/NameFiles/SpanishMaleFirst.rb", "lib/NameFiles/SwedishFemaleFirst.rb", "lib/NameFiles/SwedishLast.rb", "lib/NameFiles/SwedishMaleFirst.rb", "lib/NameFiles/ThaiFirst.rb", "lib/NameFiles/ThaiRomanisedFemaleFirst.rb", "lib/NameFiles/ThaiRomanisedLast.rb", "lib/NameFiles/ThaiRomanisedMaleFirst.rb", "lib/NameFiles/WelshFemaleFirst.rb", "lib/NameFiles/WelshLast.rb", "lib/NameFiles/WelshMaleFirst.rb", "lib/Names.rb", "lib/Person.rb", "lib/Ratio.rb", "lib/ext/Array.rb", "lib/ext/Date.rb", "lib/ext/Enumerable.rb", "lib/ext/Hash.rb", "lib/ext/Kernel.rb", "lib/ext/Set.rb", "lib/randomperson.rb", "t/Generator.t", "randomperson.gemspec"]
|
15
15
|
s.homepage = %q{http://github.com/yb66/RandomPerson}
|
16
16
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Randomperson", "--main", "README"]
|
17
17
|
s.require_paths = ["lib"]
|
data/t/Generator.t
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby -wKU
|
2
2
|
|
3
3
|
require 'generator'
|
4
|
+
# require 'choice'
|
4
5
|
require 'test/unit'
|
5
6
|
|
6
7
|
class TestTask < Test::Unit::TestCase
|
@@ -33,18 +34,30 @@ class TestTask < Test::Unit::TestCase
|
|
33
34
|
assert_equal( RandomPerson::Generator.pick_gender([0,10]), 'f' )
|
34
35
|
end
|
35
36
|
|
36
|
-
def
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
37
|
+
def test_reset
|
38
|
+
choice = RandomPerson::Choice.new
|
39
|
+
choice2 = RandomPerson::Choice.new
|
40
|
+
g = RandomPerson::Generator.new
|
41
|
+
g.make_generator choice
|
42
|
+
g.make_generator choice2
|
43
|
+
assert_equal( 2, g.generators.length )
|
44
|
+
g.reset
|
45
|
+
assert_equal( 2, g.generators.length )
|
46
|
+
assert( g.generators.empty? )
|
46
47
|
end
|
47
48
|
|
49
|
+
# def test_pick_age
|
50
|
+
# n = 1000
|
51
|
+
# while n > 0
|
52
|
+
# r1 = rand(100)
|
53
|
+
# r2 = rand(100) + r1
|
54
|
+
# age = RandomPerson::Generator.pick_age(r1, r2)
|
55
|
+
# assert_not_nil( age )
|
56
|
+
# assert( r1..r2, age )
|
57
|
+
# n = n - 1
|
58
|
+
# end
|
59
|
+
# end
|
60
|
+
|
48
61
|
def test_pick_dob
|
49
62
|
n = 1000
|
50
63
|
while n > 0
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Iain Barnett
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
YK13fiGcldY=
|
36
36
|
-----END CERTIFICATE-----
|
37
37
|
|
38
|
-
date: 2010-08-
|
38
|
+
date: 2010-08-24 00:00:00 +01:00
|
39
39
|
default_executable:
|
40
40
|
dependencies: []
|
41
41
|
|
@@ -46,24 +46,39 @@ executables: []
|
|
46
46
|
extensions: []
|
47
47
|
|
48
48
|
extra_rdoc_files:
|
49
|
+
- CHANGELOG
|
49
50
|
- README
|
50
51
|
- lib/Choice.rb
|
52
|
+
- lib/CommonFormatsFirstName.rb
|
53
|
+
- lib/Formatter.rb
|
51
54
|
- lib/Generator.rb
|
55
|
+
- lib/Name.rb
|
52
56
|
- lib/NameFiles/AmericanLast.rb
|
53
57
|
- lib/NameFiles/AmericanMaleFirst.rb
|
54
58
|
- lib/NameFiles/AmericanSuffix.rb
|
55
59
|
- lib/NameFiles/AnyLast.rb
|
56
60
|
- lib/NameFiles/BasqueLast.rb
|
61
|
+
- lib/NameFiles/BritishPrefix.rb
|
62
|
+
- lib/NameFiles/BritishSuffix.rb
|
57
63
|
- lib/NameFiles/EnglishFemaleFirst.rb
|
58
64
|
- lib/NameFiles/EnglishLast.rb
|
59
|
-
- lib/NameFiles/
|
65
|
+
- lib/NameFiles/EnglishMaleFirst.rb
|
66
|
+
- lib/NameFiles/ScottishFemaleFirst.rb
|
67
|
+
- lib/NameFiles/ScottishLast.rb
|
68
|
+
- lib/NameFiles/ScottishMaleFirst.rb
|
60
69
|
- lib/NameFiles/SpanishFemaleFirst.rb
|
61
70
|
- lib/NameFiles/SpanishLast.rb
|
62
71
|
- lib/NameFiles/SpanishMaleFirst.rb
|
72
|
+
- lib/NameFiles/SwedishFemaleFirst.rb
|
73
|
+
- lib/NameFiles/SwedishLast.rb
|
74
|
+
- lib/NameFiles/SwedishMaleFirst.rb
|
63
75
|
- lib/NameFiles/ThaiFirst.rb
|
64
76
|
- lib/NameFiles/ThaiRomanisedFemaleFirst.rb
|
65
77
|
- lib/NameFiles/ThaiRomanisedLast.rb
|
66
78
|
- lib/NameFiles/ThaiRomanisedMaleFirst.rb
|
79
|
+
- lib/NameFiles/WelshFemaleFirst.rb
|
80
|
+
- lib/NameFiles/WelshLast.rb
|
81
|
+
- lib/NameFiles/WelshMaleFirst.rb
|
67
82
|
- lib/Names.rb
|
68
83
|
- lib/Person.rb
|
69
84
|
- lib/Ratio.rb
|
@@ -75,26 +90,42 @@ extra_rdoc_files:
|
|
75
90
|
- lib/ext/Set.rb
|
76
91
|
- lib/randomperson.rb
|
77
92
|
files:
|
93
|
+
- CHANGELOG
|
78
94
|
- Manifest
|
79
95
|
- README
|
80
96
|
- Rakefile
|
97
|
+
- gem-public_cert.pem
|
81
98
|
- lib/Choice.rb
|
99
|
+
- lib/CommonFormatsFirstName.rb
|
100
|
+
- lib/Formatter.rb
|
82
101
|
- lib/Generator.rb
|
102
|
+
- lib/Name.rb
|
83
103
|
- lib/NameFiles/AmericanLast.rb
|
84
104
|
- lib/NameFiles/AmericanMaleFirst.rb
|
85
105
|
- lib/NameFiles/AmericanSuffix.rb
|
86
106
|
- lib/NameFiles/AnyLast.rb
|
87
107
|
- lib/NameFiles/BasqueLast.rb
|
108
|
+
- lib/NameFiles/BritishPrefix.rb
|
109
|
+
- lib/NameFiles/BritishSuffix.rb
|
88
110
|
- lib/NameFiles/EnglishFemaleFirst.rb
|
89
111
|
- lib/NameFiles/EnglishLast.rb
|
90
|
-
- lib/NameFiles/
|
112
|
+
- lib/NameFiles/EnglishMaleFirst.rb
|
113
|
+
- lib/NameFiles/ScottishFemaleFirst.rb
|
114
|
+
- lib/NameFiles/ScottishLast.rb
|
115
|
+
- lib/NameFiles/ScottishMaleFirst.rb
|
91
116
|
- lib/NameFiles/SpanishFemaleFirst.rb
|
92
117
|
- lib/NameFiles/SpanishLast.rb
|
93
118
|
- lib/NameFiles/SpanishMaleFirst.rb
|
119
|
+
- lib/NameFiles/SwedishFemaleFirst.rb
|
120
|
+
- lib/NameFiles/SwedishLast.rb
|
121
|
+
- lib/NameFiles/SwedishMaleFirst.rb
|
94
122
|
- lib/NameFiles/ThaiFirst.rb
|
95
123
|
- lib/NameFiles/ThaiRomanisedFemaleFirst.rb
|
96
124
|
- lib/NameFiles/ThaiRomanisedLast.rb
|
97
125
|
- lib/NameFiles/ThaiRomanisedMaleFirst.rb
|
126
|
+
- lib/NameFiles/WelshFemaleFirst.rb
|
127
|
+
- lib/NameFiles/WelshLast.rb
|
128
|
+
- lib/NameFiles/WelshMaleFirst.rb
|
98
129
|
- lib/Names.rb
|
99
130
|
- lib/Person.rb
|
100
131
|
- lib/Ratio.rb
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,26 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby -wKU
|
2
|
-
|
3
|
-
module RandomPerson
|
4
|
-
require 'Names'
|
5
|
-
class EnglishPrefix
|
6
|
-
include Names
|
7
|
-
|
8
|
-
TITLES = %w(Mr. Dr. Mrs. Ms. Miss )
|
9
|
-
TITLES_ratiod = [ 0..47, 48..50, 51..52, 53..81, 82..99]
|
10
|
-
|
11
|
-
def execute( person, format=nil)
|
12
|
-
|
13
|
-
if person.age < 17
|
14
|
-
return 'Miss' if person.gender == 'f'
|
15
|
-
return 'Mr.'
|
16
|
-
end
|
17
|
-
|
18
|
-
r = rand(51) #0..50
|
19
|
-
r += 49 if person.gender == 'f' #give 50% chance of being a Dr
|
20
|
-
|
21
|
-
i = TITLES_ratiod.index_in_range( r )
|
22
|
-
return TITLES[i]
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|