babynames 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +2 -0
- data/README.md +128 -0
- data/Rakefile +17 -2
- data/VERSION +1 -1
- data/babynames.gemspec +7 -4
- metadata +10 -6
- data/README.rdoc +0 -19
data/.rvmrc
ADDED
data/README.md
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
BabyNames
|
2
|
+
=========
|
3
|
+
|
4
|
+
Quickly and easily create seed data for your ruby application. Names, first and last, female and male. Randomly generate users with appropriate names and matching email addresses.
|
5
|
+
|
6
|
+
It works by combining a couple of lists of names and providing a simple way to retrieve personas.
|
7
|
+
|
8
|
+
Install
|
9
|
+
-------
|
10
|
+
|
11
|
+
Using bundler just
|
12
|
+
|
13
|
+
gem "babynames"
|
14
|
+
|
15
|
+
Or otherwise
|
16
|
+
|
17
|
+
gem install babynames
|
18
|
+
|
19
|
+
Then you are good to go
|
20
|
+
|
21
|
+
**Example**
|
22
|
+
|
23
|
+
person = BabyNames.person
|
24
|
+
User.create(:first_name => person.first_name, :last_name => person.last_name, :email => person.email, :male => person.male?)
|
25
|
+
|
26
|
+
**Ruby Versions**
|
27
|
+
|
28
|
+
Tested with 1.8.7 and 1.9.2. Should work on most others too.
|
29
|
+
|
30
|
+
**Making it repeatable with seeds**
|
31
|
+
|
32
|
+
If you want to make sure that the seed data is always the same when run (still random, but the same random sequence when rerun) you can keep the seed number and use it again
|
33
|
+
|
34
|
+
BabyNames.seed
|
35
|
+
3890
|
36
|
+
BabyNames.name
|
37
|
+
"Thelma"
|
38
|
+
BabyNames.name
|
39
|
+
"Ronnie"
|
40
|
+
BabyNames.name
|
41
|
+
"Joanna"
|
42
|
+
BabyNames.seed(3890)
|
43
|
+
3890
|
44
|
+
BabyNames.name
|
45
|
+
"Thelma"
|
46
|
+
BabyNames.name
|
47
|
+
"Ronnie"
|
48
|
+
BabyNames.name
|
49
|
+
"Joanna"
|
50
|
+
|
51
|
+
|
52
|
+
Demo
|
53
|
+
---
|
54
|
+
> require "rubygems"
|
55
|
+
=> true
|
56
|
+
|
57
|
+
> require "babynames"
|
58
|
+
=> true
|
59
|
+
|
60
|
+
> BabyNames.name
|
61
|
+
=> "Mickey"
|
62
|
+
|
63
|
+
> BabyNames.female_name
|
64
|
+
=> "Valarie"
|
65
|
+
|
66
|
+
> BabyNames.male_name
|
67
|
+
=> "Julius"
|
68
|
+
|
69
|
+
> BabyNames.persons_name
|
70
|
+
=> ["Darin", "Odonnell"]
|
71
|
+
|
72
|
+
> BabyNames.persons_name(:male)
|
73
|
+
=> ["Brad", "Downs"]
|
74
|
+
|
75
|
+
> BabyNames.persons_name(:female)
|
76
|
+
=> ["Karen", "House"]
|
77
|
+
|
78
|
+
> BabyNames.email
|
79
|
+
=> "agnes.rutledge@yahoo.com"
|
80
|
+
|
81
|
+
> BabyNames.email(:male)
|
82
|
+
=> "w.downs@yahoo.com"
|
83
|
+
|
84
|
+
> BabyNames.email(:demale)
|
85
|
+
=> "k.anthony@yahoo.com"
|
86
|
+
|
87
|
+
> person = BabyNames.person
|
88
|
+
=> #<BabyNames::Person:0x100612668 @gender=:male, @middle_name="Carmine", @email="e.c.mcdonald@yahoo.com", @last_name="Mcdonald", @first_name="Edwin">
|
89
|
+
|
90
|
+
> person.first_name
|
91
|
+
=> "Edwin"
|
92
|
+
|
93
|
+
> person.last_name
|
94
|
+
=> "Mcdonald"
|
95
|
+
|
96
|
+
> person.email
|
97
|
+
=> "e.c.mcdonald@yahoo.com"
|
98
|
+
|
99
|
+
> person.middle_name
|
100
|
+
=> "Carmine"
|
101
|
+
|
102
|
+
> person.male?
|
103
|
+
=> true
|
104
|
+
|
105
|
+
> person.female?
|
106
|
+
=> false
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
Contributing to babynames
|
113
|
+
-------------------------
|
114
|
+
|
115
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
116
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
117
|
+
* Fork the project
|
118
|
+
* Start a feature/bugfix branch
|
119
|
+
* Commit and push until you are happy with your contribution
|
120
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
121
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
122
|
+
|
123
|
+
Copyright
|
124
|
+
---------
|
125
|
+
|
126
|
+
Copyright (c) 2011 Jordan Carter. See LICENSE.txt for
|
127
|
+
further details.
|
128
|
+
|
data/Rakefile
CHANGED
@@ -18,7 +18,9 @@ Jeweler::Tasks.new do |gem|
|
|
18
18
|
gem.homepage = "http://github.com/jordandcarter/babynames"
|
19
19
|
gem.license = "MIT"
|
20
20
|
gem.summary = "Quickly and easily get random names for things like test"
|
21
|
-
gem.description = "Easily name your baby! Or if you're a dev, make some tests with names better than test1, test2, testy
|
21
|
+
gem.description = "Easily name your baby! Or if you're a dev, make some tests with names better than test1, test2, testy.
|
22
|
+
|
23
|
+
This gem gives you the ability to randomly create plausable usernames, names, emails without any hassle. Useful for seeding development data."
|
22
24
|
gem.email = "jordan.d.carter@gmail.com"
|
23
25
|
gem.authors = ["Jordan Carter"]
|
24
26
|
# dependencies defined in Gemfile
|
@@ -40,7 +42,20 @@ Rcov::RcovTask.new do |test|
|
|
40
42
|
test.rcov_opts << '--exclude "gems/*"'
|
41
43
|
end
|
42
44
|
|
43
|
-
task :default => :
|
45
|
+
task :default => :test_rubies
|
46
|
+
|
47
|
+
desc "Runs tests on Ruby 1.8.7 and 1.9.2"
|
48
|
+
task :test_rubies do
|
49
|
+
versions = %w( 1.8.7 1.9.2)
|
50
|
+
versions.each do |version|
|
51
|
+
system <<-BASH
|
52
|
+
bash -c 'source ~/.rvm/scripts/rvm;
|
53
|
+
rvm use #{version};
|
54
|
+
echo "-------- `ruby -v` ---------\n";
|
55
|
+
rake -s test'
|
56
|
+
BASH
|
57
|
+
end
|
58
|
+
end
|
44
59
|
|
45
60
|
require 'rake/rdoctask'
|
46
61
|
Rake::RDocTask.new do |rdoc|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/babynames.gemspec
CHANGED
@@ -5,23 +5,26 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{babynames}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jordan Carter"]
|
12
12
|
s.date = %q{2011-06-12}
|
13
|
-
s.description = %q{Easily name your baby! Or if you're a dev, make some tests with names better than test1, test2, testy
|
13
|
+
s.description = %q{Easily name your baby! Or if you're a dev, make some tests with names better than test1, test2, testy.
|
14
|
+
|
15
|
+
This gem gives you the ability to randomly create plausable usernames, names, emails without any hassle. Useful for seeding development data.}
|
14
16
|
s.email = %q{jordan.d.carter@gmail.com}
|
15
17
|
s.extra_rdoc_files = [
|
16
18
|
"LICENSE.txt",
|
17
|
-
"README.
|
19
|
+
"README.md"
|
18
20
|
]
|
19
21
|
s.files = [
|
20
22
|
".document",
|
23
|
+
".rvmrc",
|
21
24
|
"Gemfile",
|
22
25
|
"Gemfile.lock",
|
23
26
|
"LICENSE.txt",
|
24
|
-
"README.
|
27
|
+
"README.md",
|
25
28
|
"Rakefile",
|
26
29
|
"VERSION",
|
27
30
|
"babynames.gemspec",
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: babynames
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jordan Carter
|
@@ -78,7 +78,10 @@ dependencies:
|
|
78
78
|
version: "0"
|
79
79
|
name: rcov
|
80
80
|
version_requirements: *id004
|
81
|
-
description:
|
81
|
+
description: |-
|
82
|
+
Easily name your baby! Or if you're a dev, make some tests with names better than test1, test2, testy.
|
83
|
+
|
84
|
+
This gem gives you the ability to randomly create plausable usernames, names, emails without any hassle. Useful for seeding development data.
|
82
85
|
email: jordan.d.carter@gmail.com
|
83
86
|
executables: []
|
84
87
|
|
@@ -86,13 +89,14 @@ extensions: []
|
|
86
89
|
|
87
90
|
extra_rdoc_files:
|
88
91
|
- LICENSE.txt
|
89
|
-
- README.
|
92
|
+
- README.md
|
90
93
|
files:
|
91
94
|
- .document
|
95
|
+
- .rvmrc
|
92
96
|
- Gemfile
|
93
97
|
- Gemfile.lock
|
94
98
|
- LICENSE.txt
|
95
|
-
- README.
|
99
|
+
- README.md
|
96
100
|
- Rakefile
|
97
101
|
- VERSION
|
98
102
|
- babynames.gemspec
|
data/README.rdoc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
= babynames
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Contributing to babynames
|
6
|
-
|
7
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
9
|
-
* Fork the project
|
10
|
-
* Start a feature/bugfix branch
|
11
|
-
* Commit and push until you are happy with your contribution
|
12
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2011 Jordan Carter. See LICENSE.txt for
|
18
|
-
further details.
|
19
|
-
|