random_data 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/License.txt +1 -1
- data/lib/random_data/names.rb +39 -7
- data/lib/random_data/version.rb +1 -1
- data/test/test_random_data.rb +11 -3
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 1.3.1 2008-06--06
|
2
|
+
|
3
|
+
* 2 minor enhancements:
|
4
|
+
* Added added more last and firstnames (courtesy of Hugh Sasse)
|
5
|
+
* Added firstname_male and firstname_female (courtesy of Hugh Sasse)
|
6
|
+
|
1
7
|
== 1.3.0 2008-05-25
|
2
8
|
|
3
9
|
All these enhancements are from Hugh Sasse. Thanks Hugh!
|
data/License.txt
CHANGED
data/lib/random_data/names.rb
CHANGED
@@ -9,9 +9,11 @@ module RandomData
|
|
9
9
|
('A'..'Z').to_a.rand
|
10
10
|
end
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
@@lastnames = %w(ABEL ANDERSON ANDREWS ANTHONY BAKER BROWN BURROWS CLARK CLARKE CLARKSON DAVIDSON DAVIES DAVIS \
|
13
|
+
DENT EDWARDS GARCIA GRANT HALL HARRIS HARRISON JACKSON JEFFRIES JEFFERSON JOHNSON JONES \
|
14
|
+
KIRBY KIRK LAKE LEE LEWIS MARTIN MARTINEZ MAJOR MILLER MOORE OATES PETERS PETERSON ROBERTSON \
|
15
|
+
ROBINSON RODRIGUEZ SMITH SMYTHE STEVENS TAYLOR THATCHER THOMAS THOMPSON WALKER WASHINGTON WHITE \
|
16
|
+
WILLIAMS WILSON YORKE)
|
15
17
|
|
16
18
|
# Returns a random lastname
|
17
19
|
#
|
@@ -23,9 +25,17 @@ module RandomData
|
|
23
25
|
@@lastnames.rand.capitalize
|
24
26
|
end
|
25
27
|
|
26
|
-
@@
|
27
|
-
|
28
|
-
|
28
|
+
@@male_first_names = %w(ADAM ANTHONY ARTHUR BRIAN CHARLES CHRISTOPHER DANIEL DAVID DONALD EDGAR EDWARD EDWIN \
|
29
|
+
GEORGE HAROLD HERBERT HUGH JAMES JASON JOHN JOSEPH KENNETH KEVIN MARCUS MARK MATTHEW \
|
30
|
+
MICHAEL PAUL PHILIP RICHARD ROBERT ROGER RONALD SIMON STEVEN TERRY THOMAS WILLIAM)
|
31
|
+
|
32
|
+
@@female_first_names = %w(ALISON ANN ANNA ANNE BARBARA BETTY BERYL CAROL CHARLOTTE CHERYL DEBORAH DIANA DONNA \
|
33
|
+
DOROTHY ELIZABETH EVE FELICITY FIONA HELEN HELENA JENNIFER JESSICA JUDITH KAREN KIMBERLY \
|
34
|
+
LAURA LINDA LISA LUCY MARGARET MARIA MARY MICHELLE NANCY PATRICIA POLLY ROBYN RUTH SANDRA \
|
35
|
+
SARAH SHARON SUSAN TABITHA URSULA VICTORIA WENDY)
|
36
|
+
|
37
|
+
@@first_names = @@male_first_names + @@female_first_names
|
38
|
+
|
29
39
|
|
30
40
|
# Returns a random firstname
|
31
41
|
#
|
@@ -34,7 +44,29 @@ module RandomData
|
|
34
44
|
# "Sandra"
|
35
45
|
|
36
46
|
def firstname
|
37
|
-
@@
|
47
|
+
@@first_names.rand.capitalize
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
# Returns a random male firstname
|
52
|
+
#
|
53
|
+
# >> Random.firstname_male
|
54
|
+
#
|
55
|
+
# "James"
|
56
|
+
|
57
|
+
def firstname_male
|
58
|
+
@@male_first_names.rand.capitalize
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
# Returns a random female firstname
|
63
|
+
#
|
64
|
+
# >> Random.firstname_female
|
65
|
+
#
|
66
|
+
# "Mary"
|
67
|
+
|
68
|
+
def firstname_female
|
69
|
+
@@female_first_names.rand.capitalize
|
38
70
|
end
|
39
71
|
|
40
72
|
end
|
data/lib/random_data/version.rb
CHANGED
data/test/test_random_data.rb
CHANGED
@@ -16,7 +16,7 @@ class TestRandomData < Test::Unit::TestCase
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_should_return_random_email
|
19
|
-
assert_equal "
|
19
|
+
assert_equal "ijohnson@webmail.com", Random.email
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_should_return_random_date
|
@@ -62,7 +62,15 @@ class TestRandomData < Test::Unit::TestCase
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_should_return_random_firstname
|
65
|
-
assert_equal "
|
65
|
+
assert_equal "Donald", Random.firstname
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_should_return_random_firstnamemale
|
69
|
+
assert_equal "Donald", Random.firstname_male
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_should_return_random_firstnamefemale
|
73
|
+
assert_equal "Charlotte", Random.firstname_female
|
66
74
|
end
|
67
75
|
|
68
76
|
def test_should_return_random_initial
|
@@ -70,7 +78,7 @@ class TestRandomData < Test::Unit::TestCase
|
|
70
78
|
end
|
71
79
|
|
72
80
|
def test_should_return_random_lastname
|
73
|
-
assert_equal "
|
81
|
+
assert_equal "Clarke", Random.lastname
|
74
82
|
end
|
75
83
|
|
76
84
|
def test_should_return_random_alphanumeric
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: random_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Subelsky
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-06-06 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|