roman_names 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +67 -0
- data/Rakefile +11 -0
- data/assets/names.yml +478 -0
- data/lib/roman_names.rb +21 -0
- data/lib/roman_names/version.rb +3 -0
- data/roman_names.gemspec +31 -0
- data/spec/lib/roman_names_spec.rb +88 -0
- data/spec/spec_helper.rb +1 -0
- metadata +108 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 05a6caf64de4af75ff83bc2798be3397456ce1ed
|
4
|
+
data.tar.gz: 6ebdcfbf9a69ff82f75c57a13048a805f088ae35
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 114e47af5008345d2903af5a03d20875d7fb1f5bd20e31bd72af3b6e01ab83285a22fdbf3a1b30bcee770a008ab0cdc8248758e424910c9f69b805080d3b6358
|
7
|
+
data.tar.gz: 2da55de7e0be4098379b0bb1c7ee9342d6ec4615a0b951552b24eac1adf52f23eb8d8115a6adc50b29a5c2984d263fb198ac7d365288e846109b98fe20d6ed96
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Nick Aschenbach
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
# RomanNames
|
2
|
+
|
3
|
+
A rewrite of the roman-name-generator gem with a simplified interface
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'roman_names'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install roman_names
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'roman_names'
|
25
|
+
|
26
|
+
generator = RomanNames::Generator.new
|
27
|
+
|
28
|
+
# Generate a male name string
|
29
|
+
generator.male
|
30
|
+
|
31
|
+
# Generate a female name string
|
32
|
+
generate.female
|
33
|
+
```
|
34
|
+
|
35
|
+
Here is a sample of generated male names:
|
36
|
+
|
37
|
+
"Caius Apusti Clarus"
|
38
|
+
"Tiberius Muci Verus"
|
39
|
+
"Mamercus Opimi Marcellus"
|
40
|
+
"Quintus Sosi Blaesus"
|
41
|
+
"Marcus Didi Carbo"
|
42
|
+
"Sextus Mari Corvus"
|
43
|
+
"Titus Anni Maximus"
|
44
|
+
"Gnaeus Acci Gracchus"
|
45
|
+
"Sextus Flavi Caligula"
|
46
|
+
"Gnaeus Rupili Lupus"
|
47
|
+
|
48
|
+
Here is a sample of generated female names:
|
49
|
+
|
50
|
+
"Larci Faustina"
|
51
|
+
"Atili Sabina"
|
52
|
+
"Macci Flacilla"
|
53
|
+
"Duili Porcia"
|
54
|
+
"Popilli Euphemia"
|
55
|
+
"Caedici Mamaea"
|
56
|
+
"Nauti Baebiana"
|
57
|
+
"Hortensi Alfidia"
|
58
|
+
"Pompili Orbiana"
|
59
|
+
"Virgili Porcia"
|
60
|
+
|
61
|
+
## Contributing
|
62
|
+
|
63
|
+
1. Fork it ( https://github.com/[my-github-username]/roman_names/fork )
|
64
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
65
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
66
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
67
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/assets/names.yml
ADDED
@@ -0,0 +1,478 @@
|
|
1
|
+
---
|
2
|
+
praenomens:
|
3
|
+
- Appius
|
4
|
+
- Aulus
|
5
|
+
- Caius
|
6
|
+
- Gnaeus
|
7
|
+
- Decimus
|
8
|
+
- Kaeso
|
9
|
+
- Lucius
|
10
|
+
- Marcus
|
11
|
+
- Manius
|
12
|
+
- Mamercus
|
13
|
+
- Numerius
|
14
|
+
- Publius
|
15
|
+
- Quintus
|
16
|
+
- Servius
|
17
|
+
- Sextus
|
18
|
+
- Spurius
|
19
|
+
- Titus
|
20
|
+
- Tiberius
|
21
|
+
- Vibius
|
22
|
+
nomens:
|
23
|
+
male:
|
24
|
+
- Acci
|
25
|
+
- Acili
|
26
|
+
- Aeli
|
27
|
+
- Aemili
|
28
|
+
- Afrani
|
29
|
+
- Anni
|
30
|
+
- Annae
|
31
|
+
- Antoni
|
32
|
+
- Appulei
|
33
|
+
- Apusti
|
34
|
+
- Aquilli
|
35
|
+
- Atili
|
36
|
+
- Atti
|
37
|
+
- Aufidi
|
38
|
+
- Aureli
|
39
|
+
- Caecili
|
40
|
+
- Caedici
|
41
|
+
- Calpurni
|
42
|
+
- Carvili
|
43
|
+
- Cassi
|
44
|
+
- Claudi
|
45
|
+
- Clodi
|
46
|
+
- Coccei
|
47
|
+
- Coeli
|
48
|
+
- Corneli
|
49
|
+
- Cornifici
|
50
|
+
- Coruncani
|
51
|
+
- Cremuti
|
52
|
+
- Curi
|
53
|
+
- Deci
|
54
|
+
- Didi
|
55
|
+
- Domiti
|
56
|
+
- Duili
|
57
|
+
- Enni
|
58
|
+
- Fabi
|
59
|
+
- Fabrici
|
60
|
+
- Fanni
|
61
|
+
- Flamini
|
62
|
+
- Flavi
|
63
|
+
- Fufi
|
64
|
+
- Fulvi
|
65
|
+
- Fundani
|
66
|
+
- Furi
|
67
|
+
- Gelli
|
68
|
+
- Genuci
|
69
|
+
- Gracch
|
70
|
+
- Helividi
|
71
|
+
- Hermini
|
72
|
+
- Hirti
|
73
|
+
- Horati
|
74
|
+
- Hortensi
|
75
|
+
- Hostili
|
76
|
+
- Iuli
|
77
|
+
- Iuni
|
78
|
+
- Iuventi
|
79
|
+
- Labien
|
80
|
+
- Laeli
|
81
|
+
- Larci
|
82
|
+
- Licini
|
83
|
+
- Livi
|
84
|
+
- Lucreti
|
85
|
+
- Lutati
|
86
|
+
- Macci
|
87
|
+
- Mamili
|
88
|
+
- Manli
|
89
|
+
- Marci
|
90
|
+
- Mari
|
91
|
+
- Minuci
|
92
|
+
- Muci
|
93
|
+
- Mummi
|
94
|
+
- Munati
|
95
|
+
- Nauti
|
96
|
+
- Norban
|
97
|
+
- Octavi
|
98
|
+
- Opeli
|
99
|
+
- Opimi
|
100
|
+
- Otacili
|
101
|
+
- Ovidi
|
102
|
+
- Papiri
|
103
|
+
- Petilli
|
104
|
+
- Petroni
|
105
|
+
- Plini
|
106
|
+
- Pompei
|
107
|
+
- Pompili
|
108
|
+
- Popilli
|
109
|
+
- Pomponi
|
110
|
+
- Porci
|
111
|
+
- Postumi
|
112
|
+
- Pupi
|
113
|
+
- Quincti
|
114
|
+
- Rupili
|
115
|
+
- Rutili
|
116
|
+
- Salvi
|
117
|
+
- Scriboni
|
118
|
+
- Semproni
|
119
|
+
- Sergi
|
120
|
+
- Servili
|
121
|
+
- Sosi
|
122
|
+
- Sulpici
|
123
|
+
- Tarquini
|
124
|
+
- Terenti
|
125
|
+
- Tituri
|
126
|
+
- Tulli
|
127
|
+
- Ulpi
|
128
|
+
- Valeri
|
129
|
+
- Vatini
|
130
|
+
- Vibi
|
131
|
+
- Vipsani
|
132
|
+
- Virgili
|
133
|
+
- Volcaci
|
134
|
+
- Volumni
|
135
|
+
- Volusi
|
136
|
+
female:
|
137
|
+
- Acci
|
138
|
+
- Acili
|
139
|
+
- Aeli
|
140
|
+
- Aemili
|
141
|
+
- Afrani
|
142
|
+
- Anni
|
143
|
+
- Annae
|
144
|
+
- Antoni
|
145
|
+
- Appulei
|
146
|
+
- Apusti
|
147
|
+
- Aquilli
|
148
|
+
- Atili
|
149
|
+
- Atti
|
150
|
+
- Aufidi
|
151
|
+
- Aureli
|
152
|
+
- Caecili
|
153
|
+
- Caedici
|
154
|
+
- Calpurni
|
155
|
+
- Carvili
|
156
|
+
- Cassi
|
157
|
+
- Claudi
|
158
|
+
- Clodi
|
159
|
+
- Coccei
|
160
|
+
- Coeli
|
161
|
+
- Corneli
|
162
|
+
- Cornifici
|
163
|
+
- Coruncani
|
164
|
+
- Cremuti
|
165
|
+
- Curi
|
166
|
+
- Deci
|
167
|
+
- Didi
|
168
|
+
- Domiti
|
169
|
+
- Duili
|
170
|
+
- Enni
|
171
|
+
- Fabi
|
172
|
+
- Fabrici
|
173
|
+
- Fanni
|
174
|
+
- Flamini
|
175
|
+
- Flavi
|
176
|
+
- Fufi
|
177
|
+
- Fulvi
|
178
|
+
- Fundani
|
179
|
+
- Furi
|
180
|
+
- Gelli
|
181
|
+
- Genuci
|
182
|
+
- Gracch
|
183
|
+
- Helividi
|
184
|
+
- Hermini
|
185
|
+
- Hirti
|
186
|
+
- Horati
|
187
|
+
- Hortensi
|
188
|
+
- Hostili
|
189
|
+
- Iuli
|
190
|
+
- Iuni
|
191
|
+
- Iuventi
|
192
|
+
- Labien
|
193
|
+
- Laeli
|
194
|
+
- Larci
|
195
|
+
- Licini
|
196
|
+
- Livi
|
197
|
+
- Lucreti
|
198
|
+
- Lutati
|
199
|
+
- Macci
|
200
|
+
- Mamili
|
201
|
+
- Manli
|
202
|
+
- Marci
|
203
|
+
- Mari
|
204
|
+
- Minuci
|
205
|
+
- Muci
|
206
|
+
- Mummi
|
207
|
+
- Munati
|
208
|
+
- Nauti
|
209
|
+
- Norban
|
210
|
+
- Octavi
|
211
|
+
- Opeli
|
212
|
+
- Opimi
|
213
|
+
- Otacili
|
214
|
+
- Ovidi
|
215
|
+
- Papiri
|
216
|
+
- Petilli
|
217
|
+
- Petroni
|
218
|
+
- Plini
|
219
|
+
- Pompei
|
220
|
+
- Pompili
|
221
|
+
- Popilli
|
222
|
+
- Pomponi
|
223
|
+
- Porci
|
224
|
+
- Postumi
|
225
|
+
- Pupi
|
226
|
+
- Quincti
|
227
|
+
- Rupili
|
228
|
+
- Rutili
|
229
|
+
- Salvi
|
230
|
+
- Scriboni
|
231
|
+
- Semproni
|
232
|
+
- Sergi
|
233
|
+
- Servili
|
234
|
+
- Sosi
|
235
|
+
- Sulpici
|
236
|
+
- Tarquini
|
237
|
+
- Terenti
|
238
|
+
- Tituri
|
239
|
+
- Tulli
|
240
|
+
- Ulpi
|
241
|
+
- Valeri
|
242
|
+
- Vatini
|
243
|
+
- Vibi
|
244
|
+
- Vipsani
|
245
|
+
- Virgili
|
246
|
+
- Volcaci
|
247
|
+
- Volumni
|
248
|
+
- Volusi
|
249
|
+
cognomens:
|
250
|
+
male:
|
251
|
+
- Aemilianus
|
252
|
+
- Afer
|
253
|
+
- Africanus
|
254
|
+
- Agrippa
|
255
|
+
- Ahenobarbus
|
256
|
+
- Albinus
|
257
|
+
- Alexander
|
258
|
+
- Aquila
|
259
|
+
- Arbiter
|
260
|
+
- Asina
|
261
|
+
- Atilius
|
262
|
+
- Atticus
|
263
|
+
- Balbinus
|
264
|
+
- Barbula
|
265
|
+
- Bassianus
|
266
|
+
- Bassus
|
267
|
+
- Blaesus
|
268
|
+
- Blandus
|
269
|
+
- Britannicus
|
270
|
+
- Brutus
|
271
|
+
- Caecus
|
272
|
+
- Caepio
|
273
|
+
- Caesar
|
274
|
+
- Caesoninus
|
275
|
+
- Caligula
|
276
|
+
- Calvus
|
277
|
+
- Capito
|
278
|
+
- Carus
|
279
|
+
- Caracalla
|
280
|
+
- Carausius
|
281
|
+
- Carbo
|
282
|
+
- Catalina
|
283
|
+
- Cato
|
284
|
+
- Catullus
|
285
|
+
- Catulus
|
286
|
+
- Caudinus
|
287
|
+
- Celer
|
288
|
+
- Censorinus
|
289
|
+
- Centumalus
|
290
|
+
- Cethegus
|
291
|
+
- Cicero
|
292
|
+
- Cinna
|
293
|
+
- Classicus
|
294
|
+
- Clarus
|
295
|
+
- Clodianus
|
296
|
+
- Constantinus
|
297
|
+
- Corvus
|
298
|
+
- Cotta
|
299
|
+
- Crassus
|
300
|
+
- Crispinus
|
301
|
+
- Cunctator
|
302
|
+
- Curio
|
303
|
+
- Cursor
|
304
|
+
- Dentatus
|
305
|
+
- Diadematus
|
306
|
+
- Drusus
|
307
|
+
- Eburnus
|
308
|
+
- Etruscus
|
309
|
+
- Fabatus
|
310
|
+
- Falco
|
311
|
+
- Ferox
|
312
|
+
- Flaccus
|
313
|
+
- Flaminius
|
314
|
+
- Firmus
|
315
|
+
- Fundulus
|
316
|
+
- Galba
|
317
|
+
- Gallus
|
318
|
+
- Geminus
|
319
|
+
- Germanicus
|
320
|
+
- Geta
|
321
|
+
- Glabrio
|
322
|
+
- Gracchus
|
323
|
+
- Hadrianus
|
324
|
+
- Hispallus
|
325
|
+
- Hypsaeus
|
326
|
+
- Iunior
|
327
|
+
- Iustus
|
328
|
+
- Labeo
|
329
|
+
- Laevinus
|
330
|
+
- Lentulus
|
331
|
+
- Lepidus
|
332
|
+
- Libo
|
333
|
+
- Licinius
|
334
|
+
- Ligus
|
335
|
+
- Livianus
|
336
|
+
- Longinus
|
337
|
+
- Longus
|
338
|
+
- Lucanus
|
339
|
+
- Lucullus
|
340
|
+
- Lupus
|
341
|
+
- Luscinus
|
342
|
+
- Macrinus
|
343
|
+
- Magnus
|
344
|
+
- Malleolus
|
345
|
+
- Mancinus
|
346
|
+
- Marcellus
|
347
|
+
- Martialis
|
348
|
+
- Maro
|
349
|
+
- Maximus
|
350
|
+
- Megellus
|
351
|
+
- Merula
|
352
|
+
- Messalla
|
353
|
+
- Metellus
|
354
|
+
- Milo
|
355
|
+
- Murena
|
356
|
+
- Nasica
|
357
|
+
- Naso
|
358
|
+
- Nepos
|
359
|
+
- Nero
|
360
|
+
- Nerva
|
361
|
+
- Nobilior
|
362
|
+
- Octavianus
|
363
|
+
- Otho
|
364
|
+
- Pacilus
|
365
|
+
- Paetinus
|
366
|
+
- Paetus
|
367
|
+
- Pansa
|
368
|
+
- Paterculus
|
369
|
+
- Paulus
|
370
|
+
- Philippus
|
371
|
+
- Philo
|
372
|
+
- Pictor
|
373
|
+
- Piso
|
374
|
+
- Pius
|
375
|
+
- Plancus
|
376
|
+
- Plautus
|
377
|
+
- Pollio
|
378
|
+
- Porcina
|
379
|
+
- Priscus
|
380
|
+
- Pulcher
|
381
|
+
- Pullus
|
382
|
+
- Purpurio
|
383
|
+
- Quietus
|
384
|
+
- Ravilla
|
385
|
+
- Regulus
|
386
|
+
- Rufinus
|
387
|
+
- Rufus
|
388
|
+
- Rullianus
|
389
|
+
- Ruso
|
390
|
+
- Sabinus
|
391
|
+
- Salinator
|
392
|
+
- Saturninus
|
393
|
+
- Scaevola
|
394
|
+
- Scipio
|
395
|
+
- Secundus
|
396
|
+
- Seneca
|
397
|
+
- Severus
|
398
|
+
- Servilianus
|
399
|
+
- Silanus
|
400
|
+
- Sophus
|
401
|
+
- Sparsus
|
402
|
+
- Spurinus
|
403
|
+
- Strabo
|
404
|
+
- Sulla
|
405
|
+
- Sura
|
406
|
+
- Tacitus
|
407
|
+
- Tamphilus
|
408
|
+
- Tappulus
|
409
|
+
- Tertullus
|
410
|
+
- Tiro
|
411
|
+
- Torquatus
|
412
|
+
- Trajanus
|
413
|
+
- Tremulus
|
414
|
+
- Tranquillus
|
415
|
+
- Tullus
|
416
|
+
- Turrinus
|
417
|
+
- Ursus
|
418
|
+
- Varro
|
419
|
+
- Varus
|
420
|
+
- Valens
|
421
|
+
- Verus
|
422
|
+
- Vespasianus
|
423
|
+
- Victorinus
|
424
|
+
- Vulso
|
425
|
+
female:
|
426
|
+
- Agrippina
|
427
|
+
- Alfidia
|
428
|
+
- Alypia
|
429
|
+
- Attica
|
430
|
+
- Atia
|
431
|
+
- Aurelia
|
432
|
+
- Baebiana
|
433
|
+
- Clara
|
434
|
+
- Caesonia
|
435
|
+
- Crispina
|
436
|
+
- Cornificia
|
437
|
+
- Domitia
|
438
|
+
- Domitilla
|
439
|
+
- Domna
|
440
|
+
- Etruscilla
|
441
|
+
- Euphemia
|
442
|
+
- Eutropia
|
443
|
+
- Fadilla
|
444
|
+
- Faustina
|
445
|
+
- Fausta
|
446
|
+
- Fannia
|
447
|
+
- Flacilla
|
448
|
+
- Fundania
|
449
|
+
- Galeria
|
450
|
+
- Lepida
|
451
|
+
- Longina
|
452
|
+
- Lucilla
|
453
|
+
- Mamaea
|
454
|
+
- Matidia
|
455
|
+
- Metella
|
456
|
+
- Messalina
|
457
|
+
- Orbiana
|
458
|
+
- Paulina
|
459
|
+
- Paetina
|
460
|
+
- Placidia
|
461
|
+
- Plancina
|
462
|
+
- Popillia
|
463
|
+
- Poppaea
|
464
|
+
- Porcia
|
465
|
+
- Prisca
|
466
|
+
- Proba
|
467
|
+
- Primia
|
468
|
+
- Quintilla
|
469
|
+
- Roscia
|
470
|
+
- Sabina
|
471
|
+
- Secundia
|
472
|
+
- Severa
|
473
|
+
- Severina
|
474
|
+
- Supera
|
475
|
+
- Terentia
|
476
|
+
- Tertia
|
477
|
+
- Tertulla
|
478
|
+
- Titiana
|
data/lib/roman_names.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'roman_names/version'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
module RomanNames
|
5
|
+
class Generator
|
6
|
+
ROOT_PATH = File.dirname(__dir__)
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
path = File.join(ROOT_PATH, 'assets', 'names.yml')
|
10
|
+
@data = YAML::load(File.open(path, 'r'))
|
11
|
+
end
|
12
|
+
|
13
|
+
def male
|
14
|
+
"#{@data['praenomens'].sample} #{@data['nomens']['male'].sample} #{@data['cognomens']['male'].sample}"
|
15
|
+
end
|
16
|
+
|
17
|
+
def female
|
18
|
+
"#{@data['nomens']['female'].sample} #{@data['cognomens']['female'].sample}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/roman_names.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'roman_names/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'roman_names'
|
8
|
+
spec.version = RomanNames::VERSION
|
9
|
+
spec.authors = ['Nick Aschenbach', 'James OKelly']
|
10
|
+
spec.email = ['nick.aschenbach@gmail.com', 'james@rubyloves.me']
|
11
|
+
spec.description = %q{A fun generator to generate ancient roman names}
|
12
|
+
spec.summary = <<-EOF
|
13
|
+
This is a rewrite of the roman-name-generator gem with a simplified interface and a small bug fix.
|
14
|
+
Here is a sample of generated male names:
|
15
|
+
"Caius Apusti Clarus" "Tiberius Muci Verus" "Mamercus Opimi Marcellus" "Quintus Sosi Blaesus" "Marcus Didi Carbo" "Sextus Mari Corvus" "Titus Anni Maximus" "Gnaeus Acci Gracchus" "Sextus Flavi Caligula" "Gnaeus Rupili Lupus"
|
16
|
+
Here is a sample of generated female names:
|
17
|
+
"Larci Faustina" "Atili Sabina" "Macci Flacilla" "Duili Porcia" "Popilli Euphemia" "Caedici Mamaea" "Nauti Baebiana" "Hortensi Alfidia" "Pompili Orbiana" "Virgili Porcia"}
|
18
|
+
EOF
|
19
|
+
spec.homepage = 'https://github.com/nick-aschenbach/roman-names'
|
20
|
+
spec.license = 'MIT'
|
21
|
+
|
22
|
+
spec.files = `git ls-files -z`.split("\x0")
|
23
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
24
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
25
|
+
spec.require_paths = ['lib']
|
26
|
+
|
27
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
28
|
+
spec.add_development_dependency 'rake', '~> 10.4'
|
29
|
+
|
30
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
31
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe RomanNames::Generator do
|
4
|
+
subject { RomanNames::Generator.new }
|
5
|
+
let(:data) {
|
6
|
+
{
|
7
|
+
'praenomens' =>
|
8
|
+
['Tiberius'],
|
9
|
+
'nomens' => {
|
10
|
+
'male' =>
|
11
|
+
['Hermini'],
|
12
|
+
'female' =>
|
13
|
+
['Semproni']
|
14
|
+
},
|
15
|
+
'cognomens' => {
|
16
|
+
'male' =>
|
17
|
+
['Octavianus'],
|
18
|
+
'female' =>
|
19
|
+
['Terentia']
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
describe '.initialize' do
|
25
|
+
before do
|
26
|
+
stub_const('RomanNames::Generator::ROOT_PATH', 'foobar')
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'assigns the ROOT_PATH' do
|
30
|
+
expect(RomanNames::Generator::ROOT_PATH).to eq('foobar')
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'joins the path' do
|
34
|
+
allow(File).to receive(:open).and_return('---')
|
35
|
+
expect(File).to receive(:join).with('foobar', 'assets', 'names.yml')
|
36
|
+
|
37
|
+
subject
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'opens the correct file' do
|
41
|
+
expect(File).to receive(:open).with('foobar/assets/names.yml', 'r')
|
42
|
+
allow(YAML).to receive(:load)
|
43
|
+
|
44
|
+
subject
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'assigns the yaml file to the data instance variable' do
|
48
|
+
allow(File).to receive(:open).with('foobar/assets/names.yml', 'r')
|
49
|
+
allow(YAML).to receive(:load).and_return(data)
|
50
|
+
|
51
|
+
expect(subject.instance_variable_get('@data')).to eq(data)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe 'name generation' do
|
56
|
+
before do
|
57
|
+
allow(File).to receive(:open)
|
58
|
+
allow(YAML).to receive(:load).and_return(data)
|
59
|
+
end
|
60
|
+
|
61
|
+
describe '#male' do
|
62
|
+
it 'assigns the correct name' do
|
63
|
+
expect(subject.male).to eq('Tiberius Hermini Octavianus')
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'samples the right parts of the name hash' do
|
67
|
+
expect(data['praenomens']).to receive(:sample)
|
68
|
+
expect(data['nomens']['male']).to receive(:sample)
|
69
|
+
expect(data['cognomens']['male']).to receive(:sample)
|
70
|
+
|
71
|
+
subject.male
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
describe '#female' do
|
76
|
+
it 'assigns the correct name' do
|
77
|
+
expect(subject.female).to eq('Semproni Terentia')
|
78
|
+
end
|
79
|
+
|
80
|
+
it 'samples the right parts of the name hash' do
|
81
|
+
expect(data['nomens']['female']).to receive(:sample)
|
82
|
+
expect(data['cognomens']['female']).to receive(:sample)
|
83
|
+
|
84
|
+
subject.female
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'roman_names'
|
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: roman_names
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nick Aschenbach
|
8
|
+
- James OKelly
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.7'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.7'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '10.4'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '10.4'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rspec
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '3.0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '3.0'
|
56
|
+
description: A fun generator to generate ancient roman names
|
57
|
+
email:
|
58
|
+
- nick.aschenbach@gmail.com
|
59
|
+
- james@rubyloves.me
|
60
|
+
executables: []
|
61
|
+
extensions: []
|
62
|
+
extra_rdoc_files: []
|
63
|
+
files:
|
64
|
+
- ".gitignore"
|
65
|
+
- Gemfile
|
66
|
+
- LICENSE.txt
|
67
|
+
- README.md
|
68
|
+
- Rakefile
|
69
|
+
- assets/names.yml
|
70
|
+
- lib/roman_names.rb
|
71
|
+
- lib/roman_names/version.rb
|
72
|
+
- roman_names.gemspec
|
73
|
+
- spec/lib/roman_names_spec.rb
|
74
|
+
- spec/spec_helper.rb
|
75
|
+
homepage: https://github.com/nick-aschenbach/roman-names
|
76
|
+
licenses:
|
77
|
+
- MIT
|
78
|
+
metadata: {}
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 2.4.5
|
96
|
+
signing_key:
|
97
|
+
specification_version: 4
|
98
|
+
summary: 'This is a rewrite of the roman-name-generator gem with a simplified interface
|
99
|
+
and a small bug fix. Here is a sample of generated male names: "Caius Apusti Clarus"
|
100
|
+
"Tiberius Muci Verus" "Mamercus Opimi Marcellus" "Quintus Sosi Blaesus" "Marcus
|
101
|
+
Didi Carbo" "Sextus Mari Corvus" "Titus Anni Maximus" "Gnaeus Acci Gracchus" "Sextus
|
102
|
+
Flavi Caligula" "Gnaeus Rupili Lupus" Here is a sample of generated female names:
|
103
|
+
"Larci Faustina" "Atili Sabina" "Macci Flacilla" "Duili Porcia" "Popilli Euphemia"
|
104
|
+
"Caedici Mamaea" "Nauti Baebiana" "Hortensi Alfidia" "Pompili Orbiana" "Virgili
|
105
|
+
Porcia"}'
|
106
|
+
test_files:
|
107
|
+
- spec/lib/roman_names_spec.rb
|
108
|
+
- spec/spec_helper.rb
|