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 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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007 Mike Subelsky, subelsky.com
1
+ Copyright (c) 2008 Mike Subelsky, subelsky.com
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -9,9 +9,11 @@ module RandomData
9
9
  ('A'..'Z').to_a.rand
10
10
  end
11
11
 
12
-
13
- @@lastnames = %w( SMITH JOHNSON WILLIAMS JONES BROWN DAVIS MILLER WILSON MOORE TAYLOR ANDERSON THOMAS JACKSON WHITE HARRIS MARTIN THOMPSON GARCIA MARTINEZ
14
- ROBINSON CLARK RODRIGUEZ LEWIS LEE WALKER )
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
- @@firstnames = %w(JAMES JOHN ROBERT MICHAEL WILLIAM DAVID RICHARD CHARLES JOSEPH THOMAS CHRISTOPHER DANIEL PAUL MARK DONALD GEORGE KENNETH STEVEN EDWARD BRIAN
27
- RONALD ANTHONY KEVIN JASON MARY PATRICIA LINDA BARBARA ELIZABETH JENNIFER MARIA SUSAN MARGARET DOROTHY LISA NANCY KAREN BETTY HELEN SANDRA
28
- DONNA CAROL RUTH SHARON MICHELLE LAURA SARAH KIMBERLY DEBORAH)
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
- @@firstnames.rand.capitalize
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
@@ -2,7 +2,7 @@ module RandomData #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 3
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -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 "iwalker@webmail.com", Random.email
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 "Joseph", Random.firstname
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 "Moore", Random.lastname
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.0
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-05-25 00:00:00 -04:00
12
+ date: 2008-06-06 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15