Skip to content
Browse files

Added Generation of Fake Universities

  • Loading branch information...
1 parent 2c9e9e4 commit 09dd6404b18aba94c3ce7cba64c8cd909e080c40 @FernFerret committed Apr 14, 2010
Showing with 250 additions and 141 deletions.
  1. +3 −0 History.txt
  2. +1 −0 Manifest.txt
  3. +3 −3 Rakefile
  4. +1 −0 lib/faker.rb
  5. +43 −0 lib/faker/school.rb
  6. +61 −0 test/test_faker_school.rb
  7. +138 −138 website/stylesheets/screen.css
View
3 History.txt
@@ -1,3 +1,6 @@
+== 0.3.2 2010-04-14
+* 1 major enhancement:
+ * Added School to generate school names[Eric Stokes]
== 0.3.1 2008-04-03
* 1 minor enhancement:
* Added city to Address
View
1 Manifest.txt
@@ -14,6 +14,7 @@ lib/faker/internet.rb
lib/faker/lorem.rb
lib/faker/name.rb
lib/faker/phone_number.rb
+lib/faker/school.rb
lib/faker/version.rb
script/destroy
script/generate
View
6 Rakefile
@@ -1,4 +1,4 @@
-require 'config/requirements'
-require 'config/hoe' # setup Hoe + all gem configuration
-
+require 'config/requirements'
+require 'config/hoe' # setup Hoe + all gem configuration
+
Dir['tasks/**/*.rake'].each { |rake| load rake }
View
1 lib/faker.rb
@@ -6,6 +6,7 @@
require 'faker/lorem'
require 'faker/name'
require 'faker/phone_number'
+require 'faker/school'
require 'faker/version'
require 'extensions/array'
View
43 lib/faker/school.rb
@@ -0,0 +1,43 @@
+module Faker
+ class School
+ class << self
+ def school
+ Formats.rand.call
+ end
+
+ def school_specific(i)
+ Formats[i].call
+ end
+
+ def school_name
+ %w(Rose-Hulman Abbott Abernathy Abshire Adams Altenwerth Anderson Ankunding Armstrong Auer Aufderhar Bahringer Bailey Balistreri Barrows Bartell Bartoletti Barton Bashirian Batz Bauch Baumbach Bayer Beahan Beatty Bechtelar Becker Bednar Beer Beier Berge Bergnaum Bergstrom Bernhard Bernier Bins Blanda Blick Block Bode Boehm Bogan Bogisich Borer Bosco Botsford Boyer Boyle Bradtke Brakus Braun Breitenberg Brekke Brown Bruen Buckridge Carroll Carter Cartwright Casper Cassin Champlin Christiansen Cole Collier Collins Conn Connelly Conroy Considine Corkery Cormier Corwin Cremin Crist Crona Cronin Crooks Cruickshank Cummerata Cummings Dach D'Amore Daniel Dare Daugherty Davis Deckow Denesik Dibbert Dickens Dicki Dickinson Dietrich Donnelly Dooley Douglas Doyle DuBuque Durgan Ebert Effertz Eichmann Emard Emmerich Erdman Ernser Fadel Fahey Farrell Fay Feeney Feest Feil Ferry Fisher Flatley Frami Franecki Friesen Fritsch Funk Gaylord Gerhold Gerlach Gibson Gislason Gleason Gleichner Glover Goldner Goodwin Gorczany Gottlieb Goyette Grady Graham Grant Green Greenfelder Greenholt Grimes Gulgowski Gusikowski Gutkowski Gutmann Haag Hackett Hagenes Hahn Haley Halvorson Hamill Hammes Hand Hane Hansen Harber Harris Hartmann Harvey Hauck Hayes Heaney Heathcote Hegmann Heidenreich Heller Herman Hermann Hermiston Herzog Hessel Hettinger Hickle Hilll Hills Hilpert Hintz Hirthe Hodkiewicz Hoeger Homenick Hoppe Howe Howell Hudson Huel Huels Hyatt Jacobi Jacobs Jacobson Jakubowski Jaskolski Jast Jenkins Jerde Jewess Johns Johnson Johnston Jones Kassulke Kautzer Keebler Keeling Kemmer Kerluke Kertzmann Kessler Kiehn Kihn Kilback King Kirlin Klein Kling Klocko Koch Koelpin Koepp Kohler Konopelski Koss Kovacek Kozey Krajcik Kreiger Kris Kshlerin Kub Kuhic Kuhlman Kuhn Kulas Kunde Kunze Kuphal Kutch Kuvalis Labadie Lakin Lang Langosh Langworth Larkin Larson Leannon Lebsack Ledner Leffler Legros Lehner Lemke Lesch Leuschke Lind Lindgren Littel Little Lockman Lowe Lubowitz Lueilwitz Luettgen Lynch Macejkovic Maggio Mann Mante Marks Marquardt Marvin Mayer Mayert McClure McCullough McDermott McGlynn McKenzie McLaughlin Medhurst Mertz Metz Miller Mills Mitchell Moen Mohr Monahan Moore Morar Morissette Mosciski Mraz Mueller Muller Murazik Murphy Murray Nader Nicolas Nienow Nikolaus Nitzsche Nolan Oberbrunner O'Connell O'Conner O'Hara O'Keefe O'Kon Okuneva Olson Ondricka O'Reilly Orn Ortiz Osinski Pacocha Padberg Pagac Parisian Parker Paucek Pfannerstill Pfeffer Pollich Pouros Powlowski Predovic Price Prohaska Prosacco Purdy Quigley Quitzon Rath Ratke Rau Raynor Reichel Reichert Reilly Reinger Rempel Renner Reynolds Rice Rippin Ritchie Robel Roberts Rodriguez Rogahn Rohan Rolfson Romaguera Roob Rosenbaum Rowe Ruecker Runolfsdottir Runolfsson Runte Russel Rutherford Ryan Sanford Satterfield Sauer Sawayn Schaden Schaefer Schamberger Schiller Schimmel Schinner Schmeler Schmidt Schmitt Schneider Schoen Schowalter Schroeder Schulist Schultz Schumm Schuppe Schuster Senger Shanahan Shields Simonis Sipes Skiles Smith Smitham Spencer Spinka Sporer Stamm Stanton Stark Stehr Steuber Stiedemann Stokes Stoltenberg Stracke Streich Stroman Strosin Swaniawski Swift Terry Thiel Thompson Tillman Torp Torphy Towne Toy Trantow Tremblay Treutel Tromp Turcotte Turner Ullrich Upton Vandervort Veum Volkman Von VonRueden Waelchi Walker Walsh Walter Ward Waters Watsica Weber Wehner Weimann Weissnat Welch West White Wiegand Wilderman Wilkinson Will Williamson Willms Windler Wintheiser Wisoky Wisozk Witting Wiza Wolf Wolff Wuckert Wunsch Wyman Yost Yundt Zboncak Zemlak Ziemann Zieme Zulauf).rand
+ end
+
+ def school_type
+ ["School", "Institute", "College", "University", "Academy"].rand
+ end
+
+ def school_specialty
+ ["Technology", "Science", "Law", "Art", "Engineering"].rand
+ end
+
+ def school_region
+ ["Northern", "Northeastern", "Northwestern", "Southern", "Southeastern", "Southwestern", "Eastern", "Western" ].rand
+ end
+
+ def school_location
+ ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", "Connecticut", "Delaware", "District of Columbia", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma", "Oregon", "Maryland", "Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming"].rand
+ end
+ end
+
+ Formats = [
+ Proc.new { "%s %s of %s" % [ school_name, school_type, school_specialty ] },
+ Proc.new { "%s %s %s of %s" % [ school_region, school_name, school_type, school_specialty ] },
+ Proc.new { "%s State %s" % [ school_name, school_type ] },
+ Proc.new { "%s %s State %s" % [ school_region, school_name, school_type ] },
+ Proc.new { "%s %s" % [ school_name, school_type ] },
+ Proc.new { "%s %s %s" % [ school_region, school_location, school_type ] },
+ Proc.new { "%s %s %s of %s" % [ school_region, school_location, school_type, school_specialty ] }
+ ]
+ end
+end
View
61 test/test_faker_school.rb
@@ -0,0 +1,61 @@
+require File.dirname(__FILE__) + '/test_helper.rb'
+
+class TestFakerSchool < Test::Unit::TestCase
+
+ def setup
+ @tester = Faker::School
+ end
+
+ def test_school_format_0
+ name = @tester.school_specific(0)
+ puts()
+ puts(name)
+ assert name.match(/^[A-Za-z-]+\s[A-Za-z-]+\sof\s[A-Za-z-]+$/)
+ end
+
+ def test_school_format_1
+ name = @tester.school_specific(1)
+ puts()
+ puts(name)
+ assert name.match(/^[A-Za-z-]+\s[A-Za-z-]+\s[A-Za-z-]+\sof\s[A-Za-z-]+$/)
+ end
+
+ def test_school_format_2
+ name = @tester.school_specific(2)
+ puts()
+ puts(name)
+ assert name.match(/^[A-Za-z-]+\sState\s[A-Za-z-]+$/)
+ end
+
+ def test_school_format_3
+ name = @tester.school_specific(3)
+ puts()
+ puts(name)
+ assert name.match(/^[A-Za-z-]+\s[A-Za-z-]+\sState\s[A-Za-z-]+$/)
+ end
+
+ def test_school_format_4
+ name = @tester.school_specific(4)
+ puts()
+ puts(name)
+ assert name.match(/^[A-Za-z-]+\s[A-Za-z-]+$/)
+ end
+
+ def test_school_format_5
+ name = @tester.school_specific(5)
+ puts()
+ puts("5 - "+name)
+ assert name.match(/^([A-Za-z- ]+)\s([A-Za-z-]+)\s([A-Za-z-]+)$/)
+ end
+
+ def test_school_format_6
+ name = @tester.school_specific(6)
+ puts()
+ puts(name)
+ assert name.match(/^([A-Za-z-]+)\s([A-Za-z- ]+)\s([A-Za-z-]+)\sof\s([A-Za-z-]+)$/)
+ end
+
+ def test_100_schools
+ 100.times { |i| puts(@tester.school) }
+ end
+end
View
276 website/stylesheets/screen.css
@@ -1,138 +1,138 @@
-body {
- background-color: #E1D1F1;
- font-family: "Georgia", sans-serif;
- font-size: 16px;
- line-height: 1.6em;
- padding: 1.6em 0 0 0;
- color: #333;
-}
-h1, h2, h3, h4, h5, h6 {
- color: #444;
-}
-h1 {
- font-family: sans-serif;
- font-weight: normal;
- font-size: 4em;
- line-height: 0.8em;
- letter-spacing: -0.1ex;
- margin: 5px;
-}
-li {
- padding: 0;
- margin: 0;
- list-style-type: square;
-}
-a {
- color: #5E5AFF;
- background-color: #DAC;
- font-weight: normal;
- text-decoration: underline;
-}
-blockquote {
- font-size: 90%;
- font-style: italic;
- border-left: 1px solid #111;
- padding-left: 1em;
-}
-.caps {
- font-size: 80%;
-}
-
-#main {
- width: 45em;
- padding: 0;
- margin: 0 auto;
-}
-.coda {
- text-align: right;
- color: #77f;
- font-size: smaller;
-}
-
-table {
- font-size: 90%;
- line-height: 1.4em;
- color: #ff8;
- background-color: #111;
- padding: 2px 10px 2px 10px;
- border-style: dashed;
-}
-
-th {
- color: #fff;
-}
-
-td {
- padding: 2px 10px 2px 10px;
-}
-
-.success {
- color: #0CC52B;
-}
-
-.failed {
- color: #E90A1B;
-}
-
-.unknown {
- color: #995000;
-}
-pre, code {
- font-family: monospace;
- font-size: 90%;
- line-height: 1.4em;
- color: #ff8;
- background-color: #111;
- padding: 2px 10px 2px 10px;
-}
-.comment { color: #aaa; font-style: italic; }
-.keyword { color: #eff; font-weight: bold; }
-.punct { color: #eee; font-weight: bold; }
-.symbol { color: #0bb; }
-.string { color: #6b4; }
-.ident { color: #ff8; }
-.constant { color: #66f; }
-.regex { color: #ec6; }
-.number { color: #F99; }
-.expr { color: #227; }
-
-#version {
- float: right;
- text-align: right;
- font-family: sans-serif;
- font-weight: normal;
- background-color: #B3ABFF;
- color: #141331;
- padding: 15px 20px 10px 20px;
- margin: 0 auto;
- margin-top: 15px;
- border: 3px solid #141331;
-}
-
-#version .numbers {
- display: block;
- font-size: 4em;
- line-height: 0.8em;
- letter-spacing: -0.1ex;
- margin-bottom: 15px;
-}
-
-#version p {
- text-decoration: none;
- color: #141331;
- background-color: #B3ABFF;
- margin: 0;
- padding: 0;
-}
-
-#version a {
- text-decoration: none;
- color: #141331;
- background-color: #B3ABFF;
-}
-
-.clickable {
- cursor: pointer;
- cursor: hand;
-}
-
+body {
+ background-color: #E1D1F1;
+ font-family: "Georgia", sans-serif;
+ font-size: 16px;
+ line-height: 1.6em;
+ padding: 1.6em 0 0 0;
+ color: #333;
+}
+h1, h2, h3, h4, h5, h6 {
+ color: #444;
+}
+h1 {
+ font-family: sans-serif;
+ font-weight: normal;
+ font-size: 4em;
+ line-height: 0.8em;
+ letter-spacing: -0.1ex;
+ margin: 5px;
+}
+li {
+ padding: 0;
+ margin: 0;
+ list-style-type: square;
+}
+a {
+ color: #5E5AFF;
+ background-color: #DAC;
+ font-weight: normal;
+ text-decoration: underline;
+}
+blockquote {
+ font-size: 90%;
+ font-style: italic;
+ border-left: 1px solid #111;
+ padding-left: 1em;
+}
+.caps {
+ font-size: 80%;
+}
+
+#main {
+ width: 45em;
+ padding: 0;
+ margin: 0 auto;
+}
+.coda {
+ text-align: right;
+ color: #77f;
+ font-size: smaller;
+}
+
+table {
+ font-size: 90%;
+ line-height: 1.4em;
+ color: #ff8;
+ background-color: #111;
+ padding: 2px 10px 2px 10px;
+ border-style: dashed;
+}
+
+th {
+ color: #fff;
+}
+
+td {
+ padding: 2px 10px 2px 10px;
+}
+
+.success {
+ color: #0CC52B;
+}
+
+.failed {
+ color: #E90A1B;
+}
+
+.unknown {
+ color: #995000;
+}
+pre, code {
+ font-family: monospace;
+ font-size: 90%;
+ line-height: 1.4em;
+ color: #ff8;
+ background-color: #111;
+ padding: 2px 10px 2px 10px;
+}
+.comment { color: #aaa; font-style: italic; }
+.keyword { color: #eff; font-weight: bold; }
+.punct { color: #eee; font-weight: bold; }
+.symbol { color: #0bb; }
+.string { color: #6b4; }
+.ident { color: #ff8; }
+.constant { color: #66f; }
+.regex { color: #ec6; }
+.number { color: #F99; }
+.expr { color: #227; }
+
+#version {
+ float: right;
+ text-align: right;
+ font-family: sans-serif;
+ font-weight: normal;
+ background-color: #B3ABFF;
+ color: #141331;
+ padding: 15px 20px 10px 20px;
+ margin: 0 auto;
+ margin-top: 15px;
+ border: 3px solid #141331;
+}
+
+#version .numbers {
+ display: block;
+ font-size: 4em;
+ line-height: 0.8em;
+ letter-spacing: -0.1ex;
+ margin-bottom: 15px;
+}
+
+#version p {
+ text-decoration: none;
+ color: #141331;
+ background-color: #B3ABFF;
+ margin: 0;
+ padding: 0;
+}
+
+#version a {
+ text-decoration: none;
+ color: #141331;
+ background-color: #B3ABFF;
+}
+
+.clickable {
+ cursor: pointer;
+ cursor: hand;
+}
+

0 comments on commit 09dd640

Please sign in to comment.
Something went wrong with that request. Please try again.