faker 1.4.2 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21f18c21bf5f25337091e950534111e7c9c02d55
4
- data.tar.gz: 5d00fceede0cb6fc670f6864791f1c27d333e773
3
+ metadata.gz: 9d9ae16e743b75883bfa74a32a7bf9e8d61003bb
4
+ data.tar.gz: 14f3e9cf81df8486916540f7e87f4adb7c4510d1
5
5
  SHA512:
6
- metadata.gz: e13c2231dfc562013daef8ffa82d10988ab2a9f88ba22dad44bf39a83c6381466ebb82bc9af5a03f361c0d6881ecd0c900b21ce929ffe250d39df033ebaad8b6
7
- data.tar.gz: f9d554b682f4b9d61470c8aeb86549552468ffc61d56bb6aa9cb9b708e19f850e8cdda7373f864411b2c46ae05bce61555e1746ad15b4dce72101f220b832523
6
+ metadata.gz: c2c98f8d6edc8c068b9671cdb1426b51e194e8e1f9648e4c0c1a62ece721457e0d53fefc449fa5006a8dc52985e6ae42c0f0318811190b0e1e5d1719d64d3fc2
7
+ data.tar.gz: c8fd7c213d18954544d406d733c3c4304cbce9d9998dfe34f09d987e46b42682259ef20da2284f015fd53bfa54d9e18591240793b32ccdbc685776250b2e8aed
@@ -1,3 +1,10 @@
1
+ == 1.4.3 2014-08-15
2
+ * Updated Russian locale
3
+ * Added EIN generator
4
+ * Fixed Swedish locale
5
+ * Added birthday to Faker::Date
6
+ * Added Faker::App
7
+
1
8
  == 1.4.2 2014-07-15
2
9
  * Added Swedish locale
3
10
  * README update
data/README.md CHANGED
@@ -103,7 +103,10 @@ Faker::Code.ean #=> "4600051000057"
103
103
 
104
104
  Faker::Commerce.color #=> "lavender"
105
105
 
106
+ # Optional arguments max=3, fixed_amount=false
106
107
  Faker::Commerce.department #=> "Grocery, Health & Beauty"
108
+ Faker::Commerce.department(5) #=> "Grocery, Books, Health & Beauty"
109
+ Faker::Commerce.department(2, true) #=> "Books & Tools"
107
110
 
108
111
  Faker::Commerce.product_name #=> "Practical Granite Shirt"
109
112
 
@@ -126,6 +129,8 @@ Faker::Company.catch_phrase #=> "Business-focused coherent parallelism"
126
129
  # When a straight answer won't do, BS to the rescue!
127
130
  Faker::Company.bs #=> "empower one-to-one web-readiness"
128
131
 
132
+ Faker::Company.ein #=> "34-8488813"
133
+
129
134
  Faker::Company.duns_number #=> "08-341-3736"
130
135
 
131
136
  # Get a random company logo url in GIF format.
@@ -294,7 +299,7 @@ Faker::PhoneNumber.cell_phone #=> "(186)285-7925"
294
299
 
295
300
  # NOTE NOTE NOTE NOTE
296
301
  # For the 'US only' methods below, first you must do the following:
297
- Faker::Config.locale = 'en-us'
302
+ Faker::Config.locale = 'en-US'
298
303
 
299
304
  # US only
300
305
  Faker::PhoneNumber.area_code #=> "201"
@@ -336,8 +341,18 @@ Faker::Hacker.verb #=> "bypass"
336
341
  Faker::Hacker.ingverb #=> "synthesizing"
337
342
  ```
338
343
 
344
+ ###Faker::App
345
+ -----------------
346
+
347
+ ```ruby
339
348
 
349
+ Faker::App.name #=> "Treeflex"
340
350
 
351
+ Faker::App.version #=> "0.7.9"
352
+
353
+ Faker::App.author #=> "Daphne Swift"
354
+
355
+ ```
341
356
 
342
357
  Customization
343
358
  ------------
@@ -349,6 +364,23 @@ allowing you to get different formats by switching locales. Just set
349
364
  Faker::Config.locale to the locale you want, and Faker will take care of the
350
365
  rest.
351
366
 
367
+ If your locale doesn't already exist, create it in the \lib\locales\ directory
368
+ and you can then override or add elements to suit
369
+
370
+ ```yaml
371
+
372
+ en-au-ocker:
373
+ faker:
374
+ name:
375
+ # Exiting faker field, new data
376
+ first_name: [Charlotte, Ava, Chloe, Emily]
377
+
378
+ # New faker fields
379
+ ocker_first_name: [Bazza, Bluey, Davo, Johno, Shano, Shazza]
380
+ region: [South East Queensland, Wide Bay Burnett, Margaret River, Port Pirie, Gippsland, Elizabeth, Barossa]
381
+
382
+ ```
383
+
352
384
  Contributing
353
385
  ------------
354
386
  See [CONTRIBUTING.md](https://github.com/stympy/faker/blob/master/CONTRIBUTING.md).
@@ -7,7 +7,11 @@ rescue LoadError
7
7
  end
8
8
 
9
9
  require 'i18n'
10
- I18n.enforce_available_locales = true
10
+ require 'set' # Fixes a bug in i18n 0.6.11
11
+
12
+ if I18n.respond_to?(:enforce_available_locales=)
13
+ I18n.enforce_available_locales = true
14
+ end
11
15
  I18n.load_path += Dir[File.join(mydir, 'locales', '*.yml')]
12
16
 
13
17
 
@@ -172,6 +176,7 @@ require 'faker/date'
172
176
  require 'faker/time'
173
177
  require 'faker/number'
174
178
  require 'faker/hacker'
179
+ require 'faker/app'
175
180
 
176
181
  require 'extensions/array'
177
182
  require 'extensions/symbol'
@@ -23,8 +23,12 @@ module Faker
23
23
  bothify(fetch('address.building_number'))
24
24
  end
25
25
 
26
- def zip_code
27
- bothify(fetch('address.postcode'))
26
+ def zip_code(state_abbreviation = '')
27
+ return bothify(fetch('address.postcode')) if state_abbreviation === ''
28
+
29
+ # provide a zip code that is valid for the state provided
30
+ # see http://www.fincen.gov/forms/files/us_state_territory_zip_codes.pdf
31
+ bothify(fetch('address.postcode_by_state.' + state_abbreviation))
28
32
  end
29
33
 
30
34
  def time_zone
@@ -0,0 +1,22 @@
1
+ module Faker
2
+ class App < Base
3
+ class << self
4
+
5
+ def name
6
+ fetch('app.name')
7
+ end
8
+
9
+ def version
10
+ if parse('app.version') == ""
11
+ numerify(fetch('app.version'))
12
+ else
13
+ parse('app.version')
14
+ end
15
+ end
16
+
17
+ def author
18
+ parse('app.author')
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,9 +1,13 @@
1
1
  module Faker
2
2
  class Avatar < Base
3
3
  class << self
4
- def image(slug=nil)
4
+ SUPPORTED_FORMATS = %w(png jpg bmp)
5
+
6
+ def image(slug = nil, size = '300x300', format = 'png')
7
+ raise ArgumentError, "Size should be specified in format 300x300" unless size.match(/^[0-9]+x[0-9]+$/)
8
+ raise ArgumentError, "Supported formats are #{SUPPORTED_FORMATS.join(', ')}" unless SUPPORTED_FORMATS.include?(format)
5
9
  slug ||= Faker::Lorem.words.join
6
- "http://robohash.org/#{slug}"
10
+ "http://robohash.org/#{slug}.#{format}?size=#{size}"
7
11
  end
8
12
  end
9
13
  end
@@ -1,11 +1,12 @@
1
1
  require 'digest'
2
+ require 'securerandom'
2
3
 
3
4
  module Faker
4
5
  class Bitcoin < Base
5
6
  class << self
6
7
 
7
8
  def address
8
- hash = rand(2**160).to_s(16)
9
+ hash = SecureRandom.hex(20)
9
10
  version = 0
10
11
  packed = version.chr + [hash].pack("H*")
11
12
  checksum = Digest::SHA2.digest(Digest::SHA2.digest(packed))[0..3]
@@ -6,8 +6,17 @@ module Faker
6
6
  fetch('commerce.color')
7
7
  end
8
8
 
9
- def department
10
- fetch('commerce.department')
9
+ def department(max = 3, fixed_amount = false)
10
+ num = max if fixed_amount
11
+ num ||= 1 + rand(max)
12
+
13
+ categories = categories(num)
14
+
15
+ if num > 1
16
+ merge_categories(categories)
17
+ else
18
+ categories[0]
19
+ end
11
20
  end
12
21
 
13
22
  def product_name
@@ -18,6 +27,25 @@ module Faker
18
27
  random = Random.new
19
28
  (random.rand(0..100.0) * 100).floor/100.0
20
29
  end
30
+
31
+ private
32
+
33
+ def categories(num)
34
+ categories = []
35
+ while categories.length < num do
36
+ category = fetch('commerce.department')
37
+ categories << category unless categories.include?(category)
38
+ end
39
+
40
+ categories
41
+ end
42
+
43
+ def merge_categories(categories)
44
+ separator = fetch('separator')
45
+ comma_separated = categories.slice!(0...-1).join(', ')
46
+
47
+ [comma_separated, categories[0]].join(separator)
48
+ end
21
49
  end
22
50
  end
23
51
  end
@@ -21,6 +21,10 @@ module Faker
21
21
  translate('faker.company.bs').collect {|list| list.sample }.join(' ')
22
22
  end
23
23
 
24
+ def ein
25
+ ('%09d' % rand(10 ** 9)).gsub(/(\d\d)(\d\d\d\d\d\d\d)/, '\\1-\\2')
26
+ end
27
+
24
28
  def duns_number
25
29
  ('%09d' % rand(10 ** 9)).gsub(/(\d\d)(\d\d\d)(\d\d\d\d)/, '\\1-\\2-\\3')
26
30
  end
@@ -22,6 +22,14 @@ module Faker
22
22
  between(from, to).to_date
23
23
  end
24
24
 
25
+ def birthday(min_age = 18, max_age = 65)
26
+ t = ::Date.today
27
+ from = ::Date.new(t.year - min_age, t.month, t.day)
28
+ to = ::Date.new(t.year - max_age, t.month, t.day)
29
+
30
+ between(from, to).to_date
31
+ end
32
+
25
33
  private
26
34
 
27
35
  def get_date_object(date)
@@ -16,6 +16,10 @@ module Faker
16
16
  word_list.shuffle[0, resolved_num]
17
17
  end
18
18
 
19
+ def character
20
+ characters(1)
21
+ end
22
+
19
23
  def characters(char_count = 255)
20
24
  return '' if char_count.respond_to?(:to_i) && char_count.to_i < 1
21
25
  char_count = resolve(char_count)
@@ -1,3 +1,3 @@
1
1
  module Faker #:nodoc:
2
- VERSION = "1.4.2"
2
+ VERSION = "1.4.3"
3
3
  end
@@ -4,6 +4,59 @@ en-US:
4
4
  domain_suffix: [com, us, biz, info, name, net, org]
5
5
  address:
6
6
  default_country: [United States, United States of America, USA]
7
+ postcode_by_state:
8
+ AL: '350##'
9
+ AK: '995##'
10
+ AS: '967##'
11
+ AZ: '850##'
12
+ AR: '717##'
13
+ CA: '900##'
14
+ CO: '800##'
15
+ CT: '061##'
16
+ DC: '204##'
17
+ DE: '198##'
18
+ FL: '322##'
19
+ GA: '301##'
20
+ HI: '967##'
21
+ ID: '832##'
22
+ IL: '600##'
23
+ IN: '463##'
24
+ IA: '510##'
25
+ KS: '666##'
26
+ KY: '404##'
27
+ LA: '701##'
28
+ ME: '042##'
29
+ MD: '210##'
30
+ MA: '026##'
31
+ MI: '480##'
32
+ MN: '555##'
33
+ MS: '387##'
34
+ MO: '650##'
35
+ MT: '590##'
36
+ NE: '688##'
37
+ NV: '898##'
38
+ NH: '036##'
39
+ NJ: '076##'
40
+ NM: '880##'
41
+ NY: '122##'
42
+ NC: '288##'
43
+ ND: '586##'
44
+ OH: '444##'
45
+ OK: '730##'
46
+ OR: '979##'
47
+ PA: '186##'
48
+ RI: '029##'
49
+ SC: '299##'
50
+ SD: '577##'
51
+ TN: '383##'
52
+ TX: '798##'
53
+ UT: '847##'
54
+ VT: '050##'
55
+ VA: '222##'
56
+ WA: '990##'
57
+ WV: '247##'
58
+ WI: '549##'
59
+ WY: '831##'
7
60
  phone_number:
8
61
  area_code: ["201", "202", "203", "205", "206", "207", "208", "209", "210", "212", "213", "214", "215", "216", "217", "218", "219", "224", "225", "227", "228", "229", "231", "234", "239", "240", "248", "251", "252", "253", "254", "256", "260", "262", "267", "269", "270", "276", "281", "283", "301", "302", "303", "304", "305", "307", "308", "309", "310", "312", "313", "314", "315", "316", "317", "318", "319", "320", "321", "323", "330", "331", "334", "336", "337", "339", "347", "351", "352", "360", "361", "386", "401", "402", "404", "405", "406", "407", "408", "409", "410", "412", "413", "414", "415", "417", "419", "423", "424", "425", "434", "435", "440", "443", "445", "464", "469", "470", "475", "478", "479", "480", "484", "501", "502", "503", "504", "505", "507", "508", "509", "510", "512", "513", "515", "516", "517", "518", "520", "530", "540", "541", "551", "557", "559", "561", "562", "563", "564", "567", "570", "571", "573", "574", "580", "585", "586", "601", "602", "603", "605", "606", "607", "608", "609", "610", "612", "614", "615", "616", "617", "618", "619", "620", "623", "626", "630", "631", "636", "641", "646", "650", "651", "660", "661", "662", "667", "678", "682", "701", "702", "703", "704", "706", "707", "708", "712", "713", "714", "715", "716", "717", "718", "719", "720", "724", "727", "731", "732", "734", "737", "740", "754", "757", "760", "763", "765", "770", "772", "773", "774", "775", "781", "785", "786", "801", "802", "803", "804", "805", "806", "808", "810", "812", "813", "814", "815", "816", "817", "818", "828", "830", "831", "832", "835", "843", "845", "847", "848", "850", "856", "857", "858", "859", "860", "862", "863", "864", "865", "870", "872", "878", "901", "903", "904", "906", "907", "908", "909", "910", "912", "913", "914", "915", "916", "917", "918", "919", "920", "925", "928", "931", "936", "937", "940", "941", "947", "949", "952", "954", "956", "959", "970", "971", "972", "973", "975", "978", "979", "980", "984", "985", "989"]
9
62
  exchange_code: ["201", "202", "203", "205", "206", "207", "208", "209", "210", "212", "213", "214", "215", "216", "217", "218", "219", "224", "225", "227", "228", "229", "231", "234", "239", "240", "248", "251", "252", "253", "254", "256", "260", "262", "267", "269", "270", "276", "281", "283", "301", "302", "303", "304", "305", "307", "308", "309", "310", "312", "313", "314", "315", "316", "317", "318", "319", "320", "321", "323", "330", "331", "334", "336", "337", "339", "347", "351", "352", "360", "361", "386", "401", "402", "404", "405", "406", "407", "408", "409", "410", "412", "413", "414", "415", "417", "419", "423", "424", "425", "434", "435", "440", "443", "445", "464", "469", "470", "475", "478", "479", "480", "484", "501", "502", "503", "504", "505", "507", "508", "509", "510", "512", "513", "515", "516", "517", "518", "520", "530", "540", "541", "551", "557", "559", "561", "562", "563", "564", "567", "570", "571", "573", "574", "580", "585", "586", "601", "602", "603", "605", "606", "607", "608", "609", "610", "612", "614", "615", "616", "617", "618", "619", "620", "623", "626", "630", "631", "636", "641", "646", "650", "651", "660", "661", "662", "667", "678", "682", "701", "702", "703", "704", "706", "707", "708", "712", "713", "714", "715", "716", "717", "718", "719", "720", "724", "727", "731", "732", "734", "737", "740", "754", "757", "760", "763", "765", "770", "772", "773", "774", "775", "781", "785", "786", "801", "802", "803", "804", "805", "806", "808", "810", "812", "813", "814", "815", "816", "817", "818", "828", "830", "831", "832", "835", "843", "845", "847", "848", "850", "856", "857", "858", "859", "860", "862", "863", "864", "865", "870", "872", "878", "901", "903", "904", "906", "907", "908", "909", "910", "912", "913", "914", "915", "916", "917", "918", "919", "920", "925", "928", "931", "936", "937", "940", "941", "947", "949", "952", "954", "956", "959", "970", "971", "972", "973", "975", "978", "979", "980", "984", "985", "989"]
@@ -0,0 +1,31 @@
1
+ # Australian Slang, and ocker names for a bit of fun, as well as
2
+ # Aussie specific terms and references
3
+ # Took the lead of previous contributors of en-au as a baseline
4
+ # regular names are top 50 names from 2013
5
+
6
+ en-au-ocker:
7
+ faker:
8
+ name:
9
+ first_name: [Charlotte, Ava, Chloe, Emily, Olivia, Zoe, Lily, Sophie, Amelia, Sofia, Ella, Isabella, Ruby, Sienna, Mia+3, Grace, Emma, Ivy, Layla, Abigail, Isla, Hannah, Zara, Lucy, Evie, Annabelle, Madison, Alice, Georgia, Maya, Madeline, Audrey, Scarlett, Isabelle, Chelsea, Mila, Holly, Indiana, Poppy, Harper, Sarah, Alyssa, Jasmine, Imogen, Hayley, Pheobe, Eva, Evelyn, Mackenzie, Ayla, Oliver, Jack, Jackson, William, Ethan, Charlie, Lucas, Cooper, Lachlan, Noah, Liam, Alexander, Max, Isaac, Thomas, Xavier, Oscar, Benjamin, Aiden, Mason, Samuel, James, Levi, Riley, Harrison, Ryan, Henry, Jacob, Joshua, Leo, Zach, Harry, Hunter, Flynn, Archie, Tyler, Elijah, Hayden, Jayden, Blake, Archer, Ashton, Sebastian, Zachery, Lincoln, Mitchell, Luca, Nathan, Kai, Connor, Tom, Nigel, Matt, Sean]
10
+ last_name: [Smith, Jones, Williams, Brown, Wilson, Taylor, Morton, White, Martin, Anderson, Thompson, Nguyen, Thomas, Walker, Harris, Lee, Ryan, Robinson, Kelly, King, Rausch, Ridge, Connolly, LeQuesne]
11
+ ocker_first_name: [Bazza, Bluey, Davo, Johno, Shano, Shazza]
12
+ company:
13
+ suffix: [Pty Ltd, and Sons, Corp, Group, Brothers, Partners]
14
+ internet:
15
+ domain_suffix: [com.au, com, net.au, net, org.au, org]
16
+ address:
17
+ street_root: [Ramsay Street, Bonnie Doon, Cavill Avenue, Queen Street]
18
+ street_name:
19
+ - "#{street_root}"
20
+ city_prefix: [Bondi, Burleigh Heads, Carlton, Fitzroy, Fremantle, Glenelg, Manly, Noosa, Stones Corner, St Kilda, Surry Hills, Yarra Valley]
21
+ city:
22
+ - "#{city_prefix}"
23
+ state_abbr: [NSW, QLD, NT, SA, WA, TAS, ACT, VIC]
24
+ region: [South East Queensland, Wide Bay Burnett, Margaret River, Port Pirie, Gippsland, Elizabeth, Barossa]
25
+ state: [New South Wales, Queensland, Northern Territory, South Australia, Western Australia, Tasmania, Australian Capital Territory, Victoria]
26
+ postcode: ['0###', '2###', '3###', '4###', '5###', '6###', '7###']
27
+ building_number: ['####', '###', '##']
28
+ street_suffix: [Avenue, Boulevard, Circle, Circuit, Court, Crescent, Crest, Drive, Estate Dr, Grove, Hill, Island, Junction, Knoll, Lane, Loop, Mall, Manor, Meadow, Mews, Parade, Parkway, Pass, Place, Plaza, Ridge, Road, Run, Square, Station St, Street, Summit, Terrace, Track, Trail, View Rd, Way]
29
+ default_country: [Australia]
30
+ phone_number:
31
+ formats: ['0# #### ####', '+61 # #### ####', '04## ### ###', '+61 4## ### ###'] #iOS AUS phone formats
@@ -1,15 +1,17 @@
1
1
  en:
2
2
  faker:
3
+ separator: ' & '
3
4
  address:
4
5
  city_prefix: [North, East, West, South, New, Lake, Port]
5
6
  city_suffix: [town, ton, land, ville, berg, burgh, borough, bury, view, port, mouth, stad, furt, chester, mouth, fort, haven, side, shire]
6
7
  country: [Afghanistan, Albania, Algeria, American Samoa, Andorra, Angola, Anguilla, Antarctica (the territory South of 60 deg S), Antigua and Barbuda, Argentina, Armenia, Aruba, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bermuda, Bhutan, Bolivia, Bosnia and Herzegovina, Botswana, Bouvet Island (Bouvetoya), Brazil, British Indian Ocean Territory (Chagos Archipelago), Brunei Darussalam, Bulgaria, Burkina Faso, Burundi, Cambodia, Cameroon, Canada, Cape Verde, Cayman Islands, Central African Republic, Chad, Chile, China, Christmas Island, Cocos (Keeling) Islands, Colombia, Comoros, Congo, Congo, Cook Islands, Costa Rica, Cote d'Ivoire, Croatia, Cuba, Cyprus, Czech Republic, Denmark, Djibouti, Dominica, Dominican Republic, Ecuador, Egypt, El Salvador, Equatorial Guinea, Eritrea, Estonia, Ethiopia, Faroe Islands, Falkland Islands (Malvinas), Fiji, Finland, France, French Guiana, French Polynesia, French Southern Territories, Gabon, Gambia, Georgia, Germany, Ghana, Gibraltar, Greece, Greenland, Grenada, Guadeloupe, Guam, Guatemala, Guernsey, Guinea, Guinea-Bissau, Guyana, Haiti, Heard Island and McDonald Islands, Holy See (Vatican City State), Honduras, Hong Kong, Hungary, Iceland, India, Indonesia, Iran, Iraq, Ireland, Isle of Man, Israel, Italy, Jamaica, Japan, Jersey, Jordan, Kazakhstan, Kenya, Kiribati, Democratic People's Republic of Korea, Republic of Korea, Kuwait, Kyrgyz Republic, Lao People's Democratic Republic, Latvia, Lebanon, Lesotho, Liberia, Libyan Arab Jamahiriya, Liechtenstein, Lithuania, Luxembourg, Macao, Macedonia, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, Marshall Islands, Martinique, Mauritania, Mauritius, Mayotte, Mexico, Micronesia, Moldova, Monaco, Mongolia, Montenegro, Montserrat, Morocco, Mozambique, Myanmar, Namibia, Nauru, Nepal, Netherlands Antilles, Netherlands, New Caledonia, New Zealand, Nicaragua, Niger, Nigeria, Niue, Norfolk Island, Northern Mariana Islands, Norway, Oman, Pakistan, Palau, Palestinian Territory, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Pitcairn Islands, Poland, Portugal, Puerto Rico, Qatar, Reunion, Romania, Russian Federation, Rwanda, Saint Barthelemy, Saint Helena, Saint Kitts and Nevis, Saint Lucia, Saint Martin, Saint Pierre and Miquelon, Saint Vincent and the Grenadines, Samoa, San Marino, Sao Tome and Principe, Saudi Arabia, Senegal, Serbia, Seychelles, Sierra Leone, Singapore, Slovakia (Slovak Republic), Slovenia, Solomon Islands, Somalia, South Africa, South Georgia and the South Sandwich Islands, Spain, Sri Lanka, Sudan, Suriname, Svalbard & Jan Mayen Islands, Swaziland, Sweden, Switzerland, Syrian Arab Republic, Taiwan, Tajikistan, Tanzania, Thailand, Timor-Leste, Togo, Tokelau, Tonga, Trinidad and Tobago, Tunisia, Turkey, Turkmenistan, Turks and Caicos Islands, Tuvalu, Uganda, Ukraine, United Arab Emirates, United Kingdom, United States of America, United States Minor Outlying Islands, Uruguay, Uzbekistan, Vanuatu, Venezuela, Vietnam, 'Virgin Islands, British', 'Virgin Islands, U.S.', Wallis and Futuna, Western Sahara, Yemen, Zambia, Zimbabwe]
7
- country_code: [AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, YE, YT, ZA, ZM, ZW]
8
+ country_code: ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"]
8
9
  building_number: ['#####', '####', '###']
9
10
  street_suffix: [Alley, Avenue, Branch, Bridge, Brook, Brooks, Burg, Burgs, Bypass, Camp, Canyon, Cape, Causeway, Center, Centers, Circle, Circles, Cliff, Cliffs, Club, Common, Corner, Corners, Course, Court, Courts, Cove, Coves, Creek, Crescent, Crest, Crossing, Crossroad, Curve, Dale, Dam, Divide, Drive, Drive, Drives, Estate, Estates, Expressway, Extension, Extensions, Fall, Falls, Ferry, Field, Fields, Flat, Flats, Ford, Fords, Forest, Forge, Forges, Fork, Forks, Fort, Freeway, Garden, Gardens, Gateway, Glen, Glens, Green, Greens, Grove, Groves, Harbor, Harbors, Haven, Heights, Highway, Hill, Hills, Hollow, Inlet, Inlet, Island, Island, Islands, Islands, Isle, Isle, Junction, Junctions, Key, Keys, Knoll, Knolls, Lake, Lakes, Land, Landing, Lane, Light, Lights, Loaf, Lock, Locks, Locks, Lodge, Lodge, Loop, Mall, Manor, Manors, Meadow, Meadows, Mews, Mill, Mills, Mission, Mission, Motorway, Mount, Mountain, Mountain, Mountains, Mountains, Neck, Orchard, Oval, Overpass, Park, Parks, Parkway, Parkways, Pass, Passage, Path, Pike, Pine, Pines, Place, Plain, Plains, Plains, Plaza, Plaza, Point, Points, Port, Port, Ports, Ports, Prairie, Prairie, Radial, Ramp, Ranch, Rapid, Rapids, Rest, Ridge, Ridges, River, Road, Road, Roads, Roads, Route, Row, Rue, Run, Shoal, Shoals, Shore, Shores, Skyway, Spring, Springs, Springs, Spur, Spurs, Square, Square, Squares, Squares, Station, Station, Stravenue, Stravenue, Stream, Stream, Street, Street, Streets, Summit, Summit, Terrace, Throughway, Trace, Track, Trafficway, Trail, Trail, Tunnel, Tunnel, Turnpike, Turnpike, Underpass, Union, Unions, Valley, Valleys, Via, Viaduct, View, Views, Village, Village, Villages, Ville, Vista, Vista, Walk, Walks, Wall, Way, Ways, Well, Wells]
10
11
  secondary_address: ['Apt. ###', 'Suite ###']
11
12
  # Though these are US-specific, they are here (in the default locale) for backwards compatibility
12
13
  postcode: ['#####', '#####-####']
14
+ postcode_by_state: ['#####', '#####-####']
13
15
  state: [Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware, Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana, Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina, North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina, South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia, Wisconsin, Wyoming]
14
16
  state_abbr: [AL, AK, AZ, AR, CA, CO, CT, DE, FL, GA, HI, ID, IL, IN, IA, KS, KY, LA, ME, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY]
15
17
  time_zone: [Pacific/Midway, Pacific/Pago_Pago, Pacific/Honolulu, America/Juneau, America/Los_Angeles, America/Tijuana, America/Denver, America/Phoenix, America/Chihuahua, America/Mazatlan, America/Chicago, America/Regina, America/Mexico_City, America/Mexico_City, America/Monterrey, America/Guatemala, America/New_York, America/Indiana/Indianapolis, America/Bogota, America/Lima, America/Lima, America/Halifax, America/Caracas, America/La_Paz, America/Santiago, America/St_Johns, America/Sao_Paulo, America/Argentina/Buenos_Aires, America/Guyana, America/Godthab, Atlantic/South_Georgia, Atlantic/Azores, Atlantic/Cape_Verde, Europe/Dublin, Europe/London, Europe/Lisbon, Europe/London, Africa/Casablanca, Africa/Monrovia, Etc/UTC, Europe/Belgrade, Europe/Bratislava, Europe/Budapest, Europe/Ljubljana, Europe/Prague, Europe/Sarajevo, Europe/Skopje, Europe/Warsaw, Europe/Zagreb, Europe/Brussels, Europe/Copenhagen, Europe/Madrid, Europe/Paris, Europe/Amsterdam, Europe/Berlin, Europe/Berlin, Europe/Rome, Europe/Stockholm, Europe/Vienna, Africa/Algiers, Europe/Bucharest, Africa/Cairo, Europe/Helsinki, Europe/Kiev, Europe/Riga, Europe/Sofia, Europe/Tallinn, Europe/Vilnius, Europe/Athens, Europe/Istanbul, Europe/Minsk, Asia/Jerusalem, Africa/Harare, Africa/Johannesburg, Europe/Moscow, Europe/Moscow, Europe/Moscow, Asia/Kuwait, Asia/Riyadh, Africa/Nairobi, Asia/Baghdad, Asia/Tehran, Asia/Muscat, Asia/Muscat, Asia/Baku, Asia/Tbilisi, Asia/Yerevan, Asia/Kabul, Asia/Yekaterinburg, Asia/Karachi, Asia/Karachi, Asia/Tashkent, Asia/Kolkata, Asia/Kolkata, Asia/Kolkata, Asia/Kolkata, Asia/Kathmandu, Asia/Dhaka, Asia/Dhaka, Asia/Colombo, Asia/Almaty, Asia/Novosibirsk, Asia/Rangoon, Asia/Bangkok, Asia/Bangkok, Asia/Jakarta, Asia/Krasnoyarsk, Asia/Shanghai, Asia/Chongqing, Asia/Hong_Kong, Asia/Urumqi, Asia/Kuala_Lumpur, Asia/Singapore, Asia/Taipei, Australia/Perth, Asia/Irkutsk, Asia/Ulaanbaatar, Asia/Seoul, Asia/Tokyo, Asia/Tokyo, Asia/Tokyo, Asia/Yakutsk, Australia/Darwin, Australia/Adelaide, Australia/Melbourne, Australia/Melbourne, Australia/Sydney, Australia/Brisbane, Australia/Hobart, Asia/Vladivostok, Pacific/Guam, Pacific/Port_Moresby, Asia/Magadan, Asia/Magadan, Pacific/Noumea, Pacific/Fiji, Asia/Kamchatka, Pacific/Majuro, Pacific/Auckland, Pacific/Auckland, Pacific/Tongatapu, Pacific/Fakaofo, Pacific/Apia]
@@ -89,7 +91,7 @@ en:
89
91
  - "#{Name.last_name} #{suffix}"
90
92
  - "#{Name.last_name}-#{Name.last_name}"
91
93
  - "#{Name.last_name}, #{Name.last_name} and #{Name.last_name}"
92
-
94
+
93
95
  internet:
94
96
  free_email: [gmail.com, yahoo.com, hotmail.com]
95
97
  domain_suffix: [com, biz, info, name, net, org]
@@ -127,10 +129,10 @@ en:
127
129
 
128
130
  commerce:
129
131
  color: [red, green, blue, yellow, purple, mint green, teal, white, black, orange, pink, grey, maroon, violet, turquoise, tan, sky blue, salmon, plum, orchid, olive, magenta, lime, ivory, indigo, gold, fuchsia, cyan, azure, lavender, silver]
130
- department: ["Books", "Movies, Music & Games", "Electronics & Computers", "Home, Garden & Tools", "Grocery, Health & Beauty", "Toys, Kids & Baby", "Clothing, Shoes & Jewelery", "Sports & Outdoors", "Automotive & Industrial"]
132
+ department: ["Books", "Movies", "Music", "Games", "Electronics", "Computers", "Home", "Garden", "Tools", "Grocery", "Health", "Beauty", "Toys", "Kids", "Baby", "Clothing", "Shoes", "Jewelery", "Sports", "Outdoors", "Automotive", "Industrial"]
131
133
  product_name:
132
134
  adjective: [Small, Ergonomic, Rustic, Intelligent, Gorgeous, Incredible, Fantastic, Practical, Sleek, Awesome]
133
- material: [Steel, Wooden, Concrete, Plastic, Cotton, Granite, Rubber]
135
+ material: [Steel, Wooden, Concrete, Plastic, Cotton, Granite, Rubber]
134
136
  product: [Chair, Car, Computer, Gloves, Pants, Shirt, Table, Shoes, Hat]
135
137
 
136
138
  team:
@@ -139,8 +141,15 @@ en:
139
141
  - "#{Address.state} #{creature}"
140
142
 
141
143
  hacker:
142
- abbreviation: [TCP,HTTP,SDD,RAM,GB,CSS,SSL,AGP,SQL,FTP,PCI,AI,ADP,RSS,XML,EXE,COM,HDD,THX,SMTP,SMS,USB, PNG]
144
+ abbreviation: [TCP,HTTP,SDD,RAM,GB,CSS,SSL,AGP,SQL,FTP,PCI,AI,ADP,RSS,XML,EXE,COM,HDD,THX,SMTP,SMS,USB,PNG,SAS,IB,SCSI,JSON,XSS,JBOD]
143
145
  adjective: [auxiliary,primary,back-end,digital,open-source,virtual,cross-platform,redundant,online,haptic,multi-byte,bluetooth,wireless,1080p,neural, optical,solid state,mobile]
144
146
  noun: [driver,protocol,bandwidth,panel,microchip,program,port,card,array, interface,system,sensor,firewall,hard drive,pixel,alarm,feed,monitor,application,transmitter,bus,circuit,capacitor,matrix]
145
147
  verb: [back up,bypass,hack,override,compress,copy,navigate,index,connect,generate,quantify,calculate,synthesize,input,transmit,program,reboot,parse]
146
148
  ingverb: [backing up,bypassing,hacking,overriding,compressing,copying, navigating,indexing,connecting,generating,quantifying,calculating, synthesizing,transmitting,programming,parsing]
149
+
150
+ app:
151
+ name: ['Redhold', 'Treeflex', 'Trippledex', 'Kanlam', 'Bigtax', 'Daltfresh', 'Toughjoyfax', 'Mat Lam Tam', 'Otcom', 'Tres-Zap', 'Y-Solowarm', 'Tresom', 'Voltsillam', 'Biodex', 'Greenlam', 'Viva', 'Matsoft', 'Temp', 'Zoolab', 'Subin', 'Rank', 'Job', 'Stringtough', 'Tin', 'It', 'Home Ing', 'Zamit', 'Sonsing', 'Konklab', 'Alpha', 'Latlux', 'Voyatouch', 'Alphazap', 'Holdlamis', 'Zaam-Dox', 'Sub-Ex', 'Quo Lux', 'Bamity', 'Ventosanzap', 'Lotstring', 'Hatity', 'Tempsoft', 'Overhold', 'Fixflex', 'Konklux', 'Zontrax', 'Tampflex', 'Span', 'Namfix', 'Transcof', 'Stim', 'Fix San', 'Sonair', 'Stronghold', 'Fintone', 'Y-find', 'Opela', 'Lotlux', 'Ronstring', 'Zathin', 'Duobam', 'Keylex']
152
+ version: ['0.#.#', '0.##', '#.##', '#.#', '#.#.#']
153
+ author:
154
+ - "#{Name.name}"
155
+ - "#{Company.name}"
@@ -1,5 +1,6 @@
1
1
  ru:
2
2
  faker:
3
+ separator: " и "
3
4
  address:
4
5
  country: [Австралия, Австрия, Азербайджан, Албания, Алжир, Американское Самоа (не признана), Ангилья, Ангола, Андорра, Антарктика (не признана), Антигуа и Барбуда, Антильские Острова (не признана), Аомынь (не признана), Аргентина, Армения, Афганистан, Багамские Острова, Бангладеш, Барбадос, Бахрейн, Беларусь, Белиз, Бельгия, Бенин, Болгария, Боливия, Босния и Герцеговина, Ботсвана, Бразилия, Бруней, Буркина-Фасо, Бурунди, Бутан, Вануату, Ватикан, Великобритания, Венгрия, Венесуэла, Восточный Тимор, Вьетнам, Габон, Гаити, Гайана, Гамбия, Гана, Гваделупа (не признана), Гватемала, Гвиана (не признана), Гвинея, Гвинея-Бисау, Германия, Гондурас, Гренада, Греция, Грузия, Дания, Джибути, Доминика, Доминиканская Республика, Египет, Замбия, Зимбабве, Израиль, Индия, Индонезия, Иордания, Ирак, Иран, Ирландия, Исландия, Испания, Италия, Йемен, Кабо-Верде, Казахстан, Камбоджа, Камерун, Канада, Катар, Кения, Кипр, Кирибати, Китай, Колумбия, Коморские Острова, Конго, Демократическая Республика, Корея (Северная), Корея (Южная), Косово, Коста-Рика, Кот-д'Ивуар, Куба, Кувейт, Кука острова, Кыргызстан, Лаос, Латвия, Лесото, Либерия, Ливан, Ливия, Литва, Лихтенштейн, Люксембург, Маврикий, Мавритания, Мадагаскар, Македония, Малави, Малайзия, Мали, Мальдивы, Мальта, Маршалловы Острова, Мексика, Микронезия, Мозамбик, Молдова, Монако, Монголия, Марокко, Мьянма, Намибия, Науру, Непал, Нигер, Нигерия, Нидерланды, Никарагуа, Новая Зеландия, Норвегия, Объединенные Арабские Эмираты, Оман, Пакистан, Палау, Панама, Папуа — Новая Гвинея, Парагвай, Перу, Польша, Португалия, Республика Конго, Россия, Руанда, Румыния, Сальвадор, Самоа, Сан-Марино, Сан-Томе и Принсипи, Саудовская Аравия, Свазиленд, Сейшельские острова, Сенегал, Сент-Винсент и Гренадины, Сент-Киттс и Невис, Сент-Люсия, Сербия, Сингапур, Сирия, Словакия, Словения, Соединенные Штаты Америки, Соломоновы Острова, Сомали, Судан, Суринам, Сьерра-Леоне, Таджикистан, Таиланд, Тайвань (не признана), Тамил-Илам (не признана), Танзания, Тёркс и Кайкос (не признана), Того, Токелау (не признана), Тонга, Тринидад и Тобаго, Тувалу, Тунис, Турецкая Республика Северного Кипра (не признана), Туркменистан, Турция, Уганда, Узбекистан, Украина, Уругвай, Фарерские Острова (не признана), Фиджи, Филиппины, Финляндия, Франция, Французская Полинезия (не признана), Хорватия, Центральноафриканская Республика, Чад, Черногория, Чехия, Чили, Швейцария, Швеция, Шри-Ланка, Эквадор, Экваториальная Гвинея, Эритрея, Эстония, Эфиопия, Южно-Африканская Республика, Ямайка, Япония]
5
6
  building_number: ['###']
@@ -44,9 +45,21 @@ ru:
44
45
 
45
46
  commerce:
46
47
  color: [красный, зеленый, синий, желтый, багровый, мятный, зеленовато-голубой, белый, черный, оранжевый, розовый, серый, красно-коричневый, фиолетовый, бирюзовый, желто-коричневый, небесно голубой, оранжево-розовый, темно-фиолетовый, орхидный, оливковый, пурпурный, лимонный, кремовый, сине-фиолетовый, золотой, красно-пурпурный, голубой, лазурный, лиловый, серебряный]
47
- department: ["Книги", "Фильмы, музыка и игры", "Электроника и компьютеры", "Дом, сад и инструмент", "Бакалея, здоровье и красота", "Игрушки, детское и для малышей", "Одежда, обувь и украшения", "Спорт и туризм", "Автомобильное и промышленное"]
48
+ department: ["Книги", "Фильмы", "музыка", "игры", "Электроника", "компьютеры", "Дом", "садинструмент", "Бакалея", "здоровье", "красота", "Игрушки", "детское", "для малышей", "Одежда", "обувь", "украшения", "Спорт", "туризм", "Автомобильное", "промышленное"]
48
49
  product_name:
49
50
  adjective: [Маленький, Эргономичный, Грубый, Интеллектуальный, Великолепный, Невероятный, Фантастический, Практчиный, Лоснящийся, Потрясающий]
50
51
  material: [Стальной, Деревянный, Бетонный, Пластиковый, Хлопковый, Гранитный, Резиновый]
51
52
  product: [Стул, Автомобиль, Компьютер, Берет, Кулон, Стол, Свитер, Ремень, Ботинок]
52
53
 
54
+ company:
55
+ prefix: [ИП, ООО, ЗАО, ОАО, НКО, ТСЖ, ОП]
56
+ suffix: [Снаб, Торг, Пром, Трейд, Сбыт]
57
+ name:
58
+ - "#{prefix} #{Name.female_first_name}"
59
+ - "#{prefix} #{Name.male_first_name}"
60
+ - "#{prefix} #{Name.male_last_name}"
61
+ - "#{prefix} #{suffix}#{suffix}"
62
+ - "#{prefix} #{suffix}#{suffix}#{suffix}"
63
+ - "#{prefix} #{Address.city_name}#{suffix}"
64
+ - "#{prefix} #{Address.city_name}#{suffix}#{suffix}"
65
+ - "#{prefix} #{Address.city_name}#{suffix}#{suffix}#{suffix}"
@@ -31,14 +31,14 @@ sv:
31
31
  name:
32
32
  - "#{Name.last_name} #{suffix}"
33
33
  - "#{Name.last_name}-#{Name.last_name}"
34
- - "#{Name.last_name}, #{Name.last_name} #{suffix}"
34
+ - "#{Name.last_name}, #{Name.last_name} #{suffix}"
35
35
 
36
36
  internet:
37
37
  domain_suffix: [se, nu, info, com, org]
38
38
 
39
39
  name:
40
40
  first_name_women: [Maria, Anna, Margareta, Elisabeth, Eva, Birgitta, Kristina, Karin, Elisabet, Marie]
41
- fiest_name_men: [Erik, Lars, Karl, Anders, Per, Johan, Nils, Lennart, Emil, Hans ]
41
+ first_name_men: [Erik, Lars, Karl, Anders, Per, Johan, Nils, Lennart, Emil, Hans ]
42
42
  last_name: [Johansson, Andersson, Karlsson, Nilsson, Eriksson, Larsson, Olsson, Persson, Svensson, Gustafsson]
43
43
  prefix: [Dr., Prof., PhD.]
44
44
 
@@ -64,10 +64,10 @@ sv:
64
64
 
65
65
  commerce:
66
66
  color: [vit, silver, grå, svart, röd, grön, blå, gul, lila, indigo, guld, brun, rosa, purpur, korall]
67
- department: ["Böcker", "Filmer, Musik & Spel", "Elektronik & Datorer", "Hem, Trädgård & Verktyg", "Livsmedel", "Hälsa & Skönhet", "Leksaker", "Klädsel, Skor & Smycken", "Sport"]
67
+ department: ["Böcker", "Filmer", "Musik", "Spel", "Elektronik", "Datorer", "Hem", "Trädgård", "Verktyg", "Livsmedel", "Hälsa", "Skönhet", "Leksaker", "Klädsel", "Skor", "Smycken", "Sport"]
68
68
  product_name:
69
69
  adjective: [Liten, Ergonomisk, Robust, Intelligent, Söt, Otrolig, Fatastisk, Praktisk, Slimmad, Grym]
70
- material: [Stål, Metall, Trä, Betong, Plast, Bomul, Grnit, Gummi, Latex]
70
+ material: [Stål, Metall, Trä, Betong, Plast, Bomul, Grnit, Gummi, Latex]
71
71
  product: [Stol, Bil, Dator, Handskar, Pants, Shirt, Table, Shoes, Hat]
72
72
 
73
73
  team:
@@ -6,10 +6,31 @@ class TestFakerAvatar < Test::Unit::TestCase
6
6
  end
7
7
 
8
8
  def test_avatar
9
- assert @tester.image.match(/http:\/\/robohash\.org\/(.+)/)[1] != nil
9
+ assert @tester.image.match(/http:\/\/robohash\.org\/(.+)\.png/)[1] != nil
10
10
  end
11
11
 
12
12
  def test_avatar_with_param
13
- assert @tester.image('faker').match(/http:\/\/robohash\.org\/(.+)/)[1] == 'faker'
13
+ assert @tester.image('faker').match(/http:\/\/robohash\.org\/(.+)\.png/)[1] == 'faker'
14
14
  end
15
- end
15
+
16
+ def test_avatar_with_correct_size
17
+ assert @tester.image('faker', '150x320').match(/http:\/\/robohash\.org\/faker\.png\?size=(.+)/)[1] == '150x320'
18
+ end
19
+
20
+ def test_avatar_with_incorrect_size
21
+ assert_raise ArgumentError do
22
+ @tester.image(nil, '150x320z')
23
+ end
24
+ end
25
+
26
+ def test_avatar_with_supported_format
27
+ assert @tester.image('faker', '300x300', 'jpg').match(/http:\/\/robohash\.org\/faker\.jpg/)
28
+ end
29
+
30
+ def test_avatar_with_incorrect_format
31
+ assert_raise ArgumentError do
32
+ @tester.image(nil, '300x300', 'wrong_format')
33
+ end
34
+ end
35
+
36
+ end
@@ -0,0 +1,23 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')
2
+
3
+ class TestEnUsLocale < Test::Unit::TestCase
4
+ def setup
5
+ Faker::Config.locale = nil
6
+ end
7
+
8
+ def teardown
9
+ Faker::Config.locale = nil
10
+ end
11
+
12
+ def test_au_ocker_methods_with_en_au_ocker_locale
13
+ Faker::Config.locale = 'en-au-ocker'
14
+
15
+ assert Faker::Name.first_name.is_a? String
16
+ assert Faker::Name.last_name.is_a? String
17
+ assert Faker::Name.ocker_first_name.is_a? String
18
+ assert Faker::Address.street_name.is_a? String
19
+ assert Faker::Address.city.is_a? String
20
+ assert Faker::Address.region.is_a? String
21
+ end
22
+
23
+ end
@@ -15,4 +15,11 @@ class TesetEnLocale < Test::Unit::TestCase
15
15
  assert_equal LoadedYaml['en']['address']['state_abbr'].size, 50
16
16
  assert_equal LoadedYaml['en']['address']['state_abbr'], ['AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'FL', 'GA', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY']
17
17
  end
18
+
19
+ def test_us_zip_codes
20
+ Faker::Config.locale = 'en-US'
21
+ expected = /\d{5}(\-\d{4})?/
22
+ assert_match(expected, Faker::Address.zip_code)
23
+ end
24
+
18
25
  end
@@ -40,4 +40,40 @@ class TesetEnUsLocale < Test::Unit::TestCase
40
40
  us_number_validation_regex = /^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$/
41
41
  assert_match(us_number_validation_regex, Faker::PhoneNumber.phone_number)
42
42
  end
43
+
44
+ def test_us_invalid_state_raises_exception
45
+ Faker::Config.locale = 'en-US'
46
+ assert_raise I18n::MissingTranslationData do Faker::Address.zip_code('NA') end
47
+ end
48
+
49
+ def test_us_zip_codes_match_state
50
+
51
+ Faker::Config.locale = 'en-US'
52
+
53
+ state_abbr = 'AZ'
54
+ expected = /^850\d\d$/
55
+ assert_match(expected, Faker::Address.zip_code(state_abbr))
56
+
57
+ # disjointed ranges for these states
58
+ # http://www.fincen.gov/forms/files/us_state_territory_zip_codes.pdf
59
+ state_abbr = 'AR'
60
+ expected = /^717\d\d$/
61
+ assert_match(expected, Faker::Address.zip_code(state_abbr))
62
+ state_abbr = 'GA'
63
+ expected = /^301\d\d$/
64
+ assert_match(expected, Faker::Address.zip_code(state_abbr))
65
+ state_abbr = 'MA'
66
+ expected = /^026\d\d$/
67
+ assert_match(expected, Faker::Address.zip_code(state_abbr))
68
+ state_abbr = 'NY'
69
+ expected = /^122\d\d$/
70
+ assert_match(expected, Faker::Address.zip_code(state_abbr))
71
+ state_abbr = 'TX'
72
+ expected = /^798\d\d$/
73
+ assert_match(expected, Faker::Address.zip_code(state_abbr))
74
+ state_abbr = 'VA'
75
+ expected = /^222\d\d$/
76
+ assert_match(expected, Faker::Address.zip_code(state_abbr))
77
+
78
+ end
43
79
  end
@@ -0,0 +1,12 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')
2
+
3
+ class TestFakerApp < Test::Unit::TestCase
4
+ def setup
5
+ @tester = Faker::App
6
+ end
7
+
8
+ def test_name
9
+ assert @tester.author.match(/(\w+\.? ?){2,3}/)
10
+ end
11
+
12
+ end
@@ -14,6 +14,47 @@ class TestFakerCommerce < Test::Unit::TestCase
14
14
  assert @tester.department.match(/[A-Z][a-z]+\.?/)
15
15
  end
16
16
 
17
+ def test_single_department_should_not_contain_separators
18
+ assert_match(/\A[A-Za-z]+\z/, @tester.department(1))
19
+ end
20
+
21
+ def test_department_should_have_ampersand_as_default_separator
22
+ assert_match ' & ', @tester.department(2, true)
23
+ end
24
+
25
+ def test_department_should_accept_localized_separator
26
+ data = {
27
+ :faker => {
28
+ :separator => ' + ',
29
+ :commerce => {
30
+ :department => ['Books', 'Movies']
31
+ }
32
+ }
33
+ }
34
+
35
+ I18n.backend.store_translations(:xy, data)
36
+ I18n.with_locale(:xy) do
37
+ assert_match ' + ', @tester.department(2, true)
38
+ end
39
+ end
40
+
41
+ def test_department_should_have_exact_number_of_categories_when_fixed_amount
42
+ assert_match(/\A([A-Za-z]+, ){8}[A-Za-z]+ & [A-Za-z]+\z/, @tester.department(10, true))
43
+ end
44
+
45
+ def test_department_should_never_exceed_the_max_number_of_categories_when_random_amount
46
+ 100.times do
47
+ assert_match(/\A([A-Za-z]+(, | & )){0,5}[A-Za-z]+\z/, @tester.department(6))
48
+ end
49
+ end
50
+
51
+ def test_department_should_have_no_duplicate_categories
52
+ department = @tester.department(10, true)
53
+
54
+ departments = department.split(/[,& ]+/)
55
+ assert_equal departments, departments.uniq
56
+ end
57
+
17
58
  def test_product_name
18
59
  assert @tester.product_name.match(/[A-Z][a-z]+\.?/)
19
60
  end
@@ -5,6 +5,10 @@ class TestFakerCompany < Test::Unit::TestCase
5
5
  @tester = Faker::Company
6
6
  end
7
7
 
8
+ def test_ein
9
+ assert @tester.ein.match(/\d\d-\d\d\d\d\d\d\d/)
10
+ end
11
+
8
12
  def test_duns_number
9
13
  assert @tester.duns_number.match(/\d\d-\d\d\d-\d\d\d\d/)
10
14
  end
@@ -49,4 +49,29 @@ class TestFakerDate < Test::Unit::TestCase
49
49
  @tester.between("9999-99-99", "9999-99-99")
50
50
  end
51
51
  end
52
+
53
+ def test_birthday
54
+ min = 40
55
+ max = 90
56
+ 100.times do
57
+ t = Date.today
58
+ date_min = Date.new(t.year - min, t.month, t.day)
59
+ date_max = Date.new(t.year - max, t.month, t.day)
60
+ birthday = @tester.birthday(min, max)
61
+ assert birthday > date_max, "Expect > \"#{date_max}\", but got #{birthday}"
62
+ assert birthday < date_min, "Expect > \"#{date_max}\", but got #{birthday}"
63
+ end
64
+ end
65
+ def test_default_birthday
66
+ min = 10
67
+ max = 65
68
+ 100.times do
69
+ t = Date.today
70
+ date_min = Date.new(t.year - min, t.month, t.day)
71
+ date_max = Date.new(t.year - max, t.month, t.day)
72
+ birthday = @tester.birthday
73
+ assert birthday > date_max, "Expect > \"#{date_max}\", but got #{birthday}"
74
+ assert birthday < date_min, "Expect > \"#{date_max}\", but got #{birthday}"
75
+ end
76
+ end
52
77
  end
@@ -9,6 +9,14 @@ class TestFakerLorem < Test::Unit::TestCase
9
9
  @standard_wordlist + I18n.translate('faker.lorem.supplemental')
10
10
  end
11
11
 
12
+ def test_character
13
+ assert @tester.character.length == 1
14
+ end
15
+
16
+ def test_character_type
17
+ assert @tester.character.class == String
18
+ end
19
+
12
20
  def test_characters
13
21
  assert @tester.characters.length == 255
14
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Curtis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-15 00:00:00.000000000 Z
11
+ date: 2014-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -39,6 +39,7 @@ files:
39
39
  - lib/extensions/symbol.rb
40
40
  - lib/faker.rb
41
41
  - lib/faker/address.rb
42
+ - lib/faker/app.rb
42
43
  - lib/faker/avatar.rb
43
44
  - lib/faker/bitcoin.rb
44
45
  - lib/faker/business.rb
@@ -66,6 +67,7 @@ files:
66
67
  - lib/locales/en-IND.yml
67
68
  - lib/locales/en-NEP.yml
68
69
  - lib/locales/en-US.yml
70
+ - lib/locales/en-au-ocker.yml
69
71
  - lib/locales/en.yml
70
72
  - lib/locales/es.yml
71
73
  - lib/locales/fa.yml
@@ -84,10 +86,12 @@ files:
84
86
  - lib/locales/zh-CN.yml
85
87
  - test/test_array_sample_method_compat.rb
86
88
  - test/test_avatar.rb
89
+ - test/test_en_au_ocker_locale.rb
87
90
  - test/test_en_locale.rb
88
91
  - test/test_en_us_locale.rb
89
92
  - test/test_es_locale.rb
90
93
  - test/test_faker.rb
94
+ - test/test_faker_app.rb
91
95
  - test/test_faker_bitcoin.rb
92
96
  - test/test_faker_business.rb
93
97
  - test/test_faker_city.rb
@@ -134,10 +138,12 @@ summary: Easily generate fake data
134
138
  test_files:
135
139
  - test/test_array_sample_method_compat.rb
136
140
  - test/test_avatar.rb
141
+ - test/test_en_au_ocker_locale.rb
137
142
  - test/test_en_locale.rb
138
143
  - test/test_en_us_locale.rb
139
144
  - test/test_es_locale.rb
140
145
  - test/test_faker.rb
146
+ - test/test_faker_app.rb
141
147
  - test/test_faker_bitcoin.rb
142
148
  - test/test_faker_business.rb
143
149
  - test/test_faker_city.rb