ffaker 2.10.0 → 2.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +217 -15
- data/Gemfile +17 -0
- data/README.md +43 -10
- data/REFERENCE.md +1681 -1241
- data/Rakefile +20 -55
- data/bin/console +9 -0
- data/ffaker.gemspec +17 -23
- data/lib/ffaker/address.rb +7 -7
- data/lib/ffaker/address_au.rb +8 -10
- data/lib/ffaker/address_br.rb +16 -4
- data/lib/ffaker/address_ca.rb +3 -3
- data/lib/ffaker/address_ch.rb +1 -3
- data/lib/ffaker/address_ch_de.rb +1 -3
- data/lib/ffaker/address_ch_fr.rb +1 -3
- data/lib/ffaker/address_ch_it.rb +1 -3
- data/lib/ffaker/address_da.rb +1 -3
- data/lib/ffaker/address_de.rb +1 -3
- data/lib/ffaker/address_fi.rb +1 -3
- data/lib/ffaker/address_fr.rb +9 -9
- data/lib/ffaker/address_gr.rb +1 -3
- data/lib/ffaker/address_id.rb +0 -3
- data/lib/ffaker/address_in.rb +5 -3
- data/lib/ffaker/address_it.rb +33 -0
- data/lib/ffaker/address_ja.rb +0 -3
- data/lib/ffaker/address_kr.rb +0 -1
- data/lib/ffaker/address_mx.rb +3 -471
- data/lib/ffaker/address_nl.rb +2 -6
- data/lib/ffaker/address_pl.rb +0 -2
- data/lib/ffaker/address_ru.rb +1 -3
- data/lib/ffaker/address_se.rb +1 -3
- data/lib/ffaker/address_sn.rb +1 -4
- data/lib/ffaker/address_ua.rb +3 -5
- data/lib/ffaker/address_uk.rb +1 -3
- data/lib/ffaker/address_us.rb +23 -5
- data/lib/ffaker/airline.rb +1 -1
- data/lib/ffaker/animal.rb +14 -0
- data/lib/ffaker/{animals.rb → animal_br.rb} +2 -2
- data/lib/ffaker/animal_cn.rb +12 -0
- data/lib/ffaker/animal_es.rb +12 -0
- data/lib/ffaker/animal_pl.rb +15 -0
- data/lib/ffaker/animal_us.rb +12 -0
- data/lib/ffaker/avatar.rb +32 -6
- data/lib/ffaker/aws.rb +1 -1
- data/lib/ffaker/bacon_ipsum.rb +1 -3
- data/lib/ffaker/bank.rb +118 -0
- data/lib/ffaker/bank_us.rb +33 -0
- data/lib/ffaker/book.rb +16 -8
- data/lib/ffaker/boolean.rb +1 -1
- data/lib/ffaker/cheesy_lingo.rb +5 -8
- data/lib/ffaker/code.rb +17 -1
- data/lib/ffaker/color.rb +7 -7
- data/lib/ffaker/color_pl.rb +14 -0
- data/lib/ffaker/color_ua.rb +1 -1
- data/lib/ffaker/company.rb +6 -9
- data/lib/ffaker/company_cn.rb +1 -1
- data/lib/ffaker/company_fr.rb +35 -0
- data/lib/ffaker/company_it.rb +4 -2
- data/lib/ffaker/company_ja.rb +24 -0
- data/lib/ffaker/company_se.rb +1 -1
- data/lib/ffaker/conference.rb +1 -1
- data/lib/ffaker/{courses.rb → courses_fr.rb} +3 -1
- data/lib/ffaker/crypto.rb +14 -0
- data/lib/ffaker/currency.rb +1 -1
- data/lib/ffaker/data/address/city_suffixes +1 -1
- data/lib/ffaker/data/address/country +1 -1
- data/lib/ffaker/data/address/country_code +1 -1
- data/lib/ffaker/data/address/neighborhood +1 -1
- data/lib/ffaker/data/address/street_suffix +1 -1
- data/lib/ffaker/data/address_br/city +0 -1
- data/lib/ffaker/data/address_br/complement +3 -0
- data/lib/ffaker/data/address_br/neighborhood_prefixes +3 -0
- data/lib/ffaker/data/address_br/state +1 -1
- data/lib/ffaker/data/address_ca/city +99 -99
- data/lib/ffaker/data/address_ca/province +1 -1
- data/lib/ffaker/data/address_de/city +1 -1
- data/lib/ffaker/data/address_de/state +2 -1
- data/lib/ffaker/data/address_fr/city +1 -1
- data/lib/ffaker/data/address_fr/region +27 -0
- data/lib/ffaker/data/address_gr/city +1 -1
- data/lib/ffaker/data/address_gr/region +1 -1
- data/lib/ffaker/data/address_gr/street +1 -1
- data/lib/ffaker/data/address_in/city +24 -0
- data/lib/ffaker/data/address_it/city +111 -0
- data/lib/ffaker/data/address_it/region +20 -0
- data/lib/ffaker/data/address_ja/city +0 -23
- data/lib/ffaker/data/address_mx/ags +11 -0
- data/lib/ffaker/data/address_mx/bc +5 -0
- data/lib/ffaker/data/address_mx/bcs +5 -0
- data/lib/ffaker/data/address_mx/camp +11 -0
- data/lib/ffaker/data/address_mx/chih +67 -0
- data/lib/ffaker/data/address_mx/chis +118 -0
- data/lib/ffaker/data/address_mx/coah +38 -0
- data/lib/ffaker/data/address_mx/col +10 -0
- data/lib/ffaker/data/address_mx/df +16 -0
- data/lib/ffaker/data/address_mx/dgo +39 -0
- data/lib/ffaker/data/address_mx/gro +81 -0
- data/lib/ffaker/data/address_mx/gto +46 -0
- data/lib/ffaker/data/address_mx/hgo +84 -0
- data/lib/ffaker/data/address_mx/jal +125 -0
- data/lib/ffaker/data/address_mx/mex +125 -0
- data/lib/ffaker/data/address_mx/mich +113 -0
- data/lib/ffaker/data/address_mx/mor +33 -0
- data/lib/ffaker/data/address_mx/nay +20 -0
- data/lib/ffaker/data/address_mx/nl +51 -0
- data/lib/ffaker/data/address_mx/oax +570 -0
- data/lib/ffaker/data/address_mx/pue +217 -0
- data/lib/ffaker/data/address_mx/qr +10 -0
- data/lib/ffaker/data/address_mx/qro +18 -0
- data/lib/ffaker/data/address_mx/sin +18 -0
- data/lib/ffaker/data/address_mx/slp +58 -0
- data/lib/ffaker/data/address_mx/son +72 -0
- data/lib/ffaker/data/address_mx/state +1 -1
- data/lib/ffaker/data/address_mx/state_abbr +1 -1
- data/lib/ffaker/data/address_mx/tab +17 -0
- data/lib/ffaker/data/address_mx/tamps +43 -0
- data/lib/ffaker/data/address_mx/tlax +60 -0
- data/lib/ffaker/data/address_mx/ver +212 -0
- data/lib/ffaker/data/address_mx/yuc +106 -0
- data/lib/ffaker/data/address_mx/zac +58 -0
- data/lib/ffaker/data/address_ru/city +1 -1
- data/lib/ffaker/data/address_se/city +1 -1
- data/lib/ffaker/data/address_se/countries +1 -1
- data/lib/ffaker/data/address_se/street +1 -1
- data/lib/ffaker/data/address_sn/arrondissements +1 -1
- data/lib/ffaker/data/address_sn/departements +1 -1
- data/lib/ffaker/data/address_sn/regions +1 -1
- data/lib/ffaker/data/address_uk/county +1 -1
- data/lib/ffaker/data/address_us/state +1 -1
- data/lib/ffaker/data/address_us/state_abbr +1 -2
- data/lib/ffaker/data/address_us/state_and_territories_abbr +1 -1
- data/lib/ffaker/data/animal_br/common_names +423 -0
- data/lib/ffaker/data/animal_cn/common_names +141 -0
- data/lib/ffaker/data/animal_es/common_names +135 -0
- data/lib/ffaker/data/animal_pl/common_names +256 -0
- data/lib/ffaker/data/animal_us/common_names +141 -0
- data/lib/ffaker/data/aws/ec2_reserved_instance_tenancy +1 -1
- data/lib/ffaker/data/aws/ec2_reserved_offering_type +1 -1
- data/lib/ffaker/data/aws/ec2_reserved_product_description +1 -1
- data/lib/ffaker/data/bank/card_types +12 -0
- data/lib/ffaker/data/book/nouns +2 -2
- data/lib/ffaker/data/cheesy_lingo/cheesy_phrases +1 -1
- data/lib/ffaker/data/cheesy_lingo/cheesy_words +1 -1
- data/lib/ffaker/data/color/names_list +1 -1
- data/lib/ffaker/data/color_pl/names_list +122 -0
- data/lib/ffaker/data/company/bs_mid +1 -1
- data/lib/ffaker/data/company/bs_pos +1 -1
- data/lib/ffaker/data/company/bs_pre +1 -1
- data/lib/ffaker/data/company/catch_mid +1 -1
- data/lib/ffaker/data/company/catch_pos +1 -1
- data/lib/ffaker/data/company/catch_pre +1 -1
- data/lib/ffaker/data/company/position_areas +1 -1
- data/lib/ffaker/data/conference/conference_list +1 -1
- data/lib/ffaker/data/currency/currency_code +1 -1
- data/lib/ffaker/data/currency/currency_name +1 -1
- data/lib/ffaker/data/currency/currency_symbol +0 -1
- data/lib/ffaker/data/dizzle_ipsum/dizzle_words +1 -1
- data/lib/ffaker/data/education/major_noun +1 -1
- data/lib/ffaker/data/education/school_suffix +1 -1
- data/lib/ffaker/data/education_cn/city +351 -0
- data/lib/ffaker/data/education_cn/major +506 -0
- data/lib/ffaker/data/education_cn/province +31 -0
- data/lib/ffaker/data/education_cn/school_type +27 -0
- data/lib/ffaker/data/filesystem/extension +31 -31
- data/lib/ffaker/data/food/fruit +1 -1
- data/lib/ffaker/data/food/herb_spice +1 -1
- data/lib/ffaker/data/food/meat +1 -1
- data/lib/ffaker/data/food/vegetable +1 -1
- data/lib/ffaker/data/food_pl/diary +14 -0
- data/lib/ffaker/data/food_pl/fermented +13 -0
- data/lib/ffaker/data/food_pl/fruits +34 -0
- data/lib/ffaker/data/food_pl/herbs +20 -0
- data/lib/ffaker/data/food_pl/meats +9 -0
- data/lib/ffaker/data/food_pl/preserves +10 -0
- data/lib/ffaker/data/food_pl/spices +26 -0
- data/lib/ffaker/data/food_pl/vegetables +45 -0
- data/lib/ffaker/data/freedom_ipsum/freedom_words +161 -0
- data/lib/ffaker/data/game/adj_and_adv +18 -0
- data/lib/ffaker/data/game/category +84 -0
- data/lib/ffaker/data/game/mechanic +182 -0
- data/lib/ffaker/data/game/nouns +37 -0
- data/lib/ffaker/data/game/prefixes +17 -0
- data/lib/ffaker/data/healthcare_ru/doctor_specialization +127 -0
- data/lib/ffaker/data/hipster_ipsum/hipster_words +1 -1
- data/lib/ffaker/data/identification_mx/estados_curp +1 -1
- data/lib/ffaker/data/jo_jo/first_names +356 -0
- data/lib/ffaker/data/jo_jo/full_names +225 -0
- data/lib/ffaker/data/jo_jo/last_names +153 -0
- data/lib/ffaker/data/jo_jo/stands +149 -0
- data/lib/ffaker/data/job/job_adj +1 -1
- data/lib/ffaker/data/job/job_noun +1 -1
- data/lib/ffaker/data/job/job_prefix +1 -1
- data/lib/ffaker/data/job_fr/job_prefixes +1 -1
- data/lib/ffaker/data/job_it/job_adj +37 -0
- data/lib/ffaker/data/job_it/job_noun +25 -0
- data/lib/ffaker/data/job_it/job_prefix +22 -0
- data/lib/ffaker/data/locale/language +1 -1
- data/lib/ffaker/data/locale/language_code +1 -1
- data/lib/ffaker/data/lorem/characters +1 -1
- data/lib/ffaker/data/lorem/words +1 -68
- data/lib/ffaker/data/lorem_ar/words +1 -1
- data/lib/ffaker/data/lorem_br/characters +36 -0
- data/lib/ffaker/data/lorem_br/words +183 -0
- data/lib/ffaker/data/lorem_cn/words +1 -1
- data/lib/ffaker/data/lorem_fr/words +1 -1
- data/lib/ffaker/data/lorem_it/words +321 -0
- data/lib/ffaker/data/movie/adj_and_adv +1 -1
- data/lib/ffaker/data/movie/nouns +3 -3
- data/lib/ffaker/data/movie/prefixes +1 -1
- data/lib/ffaker/data/name/first_names_female +0 -230
- data/lib/ffaker/data/name/first_names_male +0 -37
- data/lib/ffaker/data/name/last_names +1 -2
- data/lib/ffaker/data/name/pronouns +6 -0
- data/lib/ffaker/data/name_ar/first_names_female +1 -1
- data/lib/ffaker/data/name_ar/first_names_male +1 -1
- data/lib/ffaker/data/name_ar/last_names +1 -1
- data/lib/ffaker/data/name_cn/first_names +1 -1
- data/lib/ffaker/data/name_cn/last_names +1 -1
- data/lib/ffaker/data/name_cs/female_first_names +40 -0
- data/lib/ffaker/data/name_cs/female_last_names +50 -0
- data/lib/ffaker/data/name_cs/male_first_names +88 -0
- data/lib/ffaker/data/name_cs/male_last_names +49 -0
- data/lib/ffaker/data/name_cs/prefixes +4 -4
- data/lib/ffaker/data/name_de/first_names +1 -1
- data/lib/ffaker/data/name_de/last_names +1 -1
- data/lib/ffaker/data/name_fr/first_names +1 -1
- data/lib/ffaker/data/name_fr/last_names +1 -1
- data/lib/ffaker/data/name_ga/first_names_female +1 -1
- data/lib/ffaker/data/name_ga/first_names_male +287 -287
- data/lib/ffaker/data/name_gr/female_first_names +1 -1
- data/lib/ffaker/data/name_gr/female_last_names +1 -1
- data/lib/ffaker/data/name_gr/male_first_names +1 -1
- data/lib/ffaker/data/name_gr/male_last_names +1 -1
- data/lib/ffaker/data/name_in/first_names_female +100 -0
- data/lib/ffaker/data/name_in/first_names_male +100 -0
- data/lib/ffaker/data/name_in/last_names +100 -0
- data/lib/ffaker/data/name_it/first_names +1 -1
- data/lib/ffaker/data/name_it/last_names +1 -1
- data/lib/ffaker/data/name_ja/first_names +1 -1
- data/lib/ffaker/data/name_ja/last_names +1 -1
- data/lib/ffaker/data/name_kh/first_names +1 -1
- data/lib/ffaker/data/name_kh/nick_names +1 -1
- data/lib/ffaker/data/name_kr/first_names +1 -1
- data/lib/ffaker/data/name_kr/last_names +1 -1
- data/lib/ffaker/data/name_mx/female_first_names +1 -1
- data/lib/ffaker/data/name_mx/last_names +1 -1
- data/lib/ffaker/data/name_mx/male_first_names +1 -1
- data/lib/ffaker/data/name_ph/autochthonous_surnames +1 -1
- data/lib/ffaker/data/name_ph/spanish_surnames +1 -1
- data/lib/ffaker/data/name_ru/first_names_female +91 -0
- data/lib/ffaker/data/name_ru/first_names_male +172 -0
- data/lib/ffaker/data/name_ru/last_names_female +100 -0
- data/lib/ffaker/data/name_ru/last_names_male +100 -0
- data/lib/ffaker/data/name_ru/middle_names_female +65 -0
- data/lib/ffaker/data/name_ru/middle_names_male +73 -0
- data/lib/ffaker/data/name_se/first_names_female +1 -1
- data/lib/ffaker/data/name_se/first_names_male +1 -1
- data/lib/ffaker/data/name_se/last_names +1 -1
- data/lib/ffaker/data/name_sn/first_names_female +1 -1
- data/lib/ffaker/data/name_sn/first_names_male +1 -1
- data/lib/ffaker/data/name_sn/last_names +1 -1
- data/lib/ffaker/data/name_th/first_names +1 -1
- data/lib/ffaker/data/name_th/last_names +1 -1
- data/lib/ffaker/data/name_th/nick_names +1 -1
- data/lib/ffaker/data/name_tw/first_names +122 -0
- data/lib/ffaker/data/name_tw/last_names +100 -0
- data/lib/ffaker/data/nato_alphabet/alphabet_codes +26 -0
- data/lib/ffaker/data/nato_alphabet/numeric_codes +10 -0
- data/lib/ffaker/data/phone_number_ja/four_disit_area_codes +41 -0
- data/lib/ffaker/data/phone_number_ja/one_disit_area_codes +3 -0
- data/lib/ffaker/data/phone_number_ja/three_disit_area_codes +296 -0
- data/lib/ffaker/data/phone_number_ja/two_disit_area_codes +48 -0
- data/lib/ffaker/data/phone_number_nl/area_codes +142 -0
- data/lib/ffaker/data/phone_number_ru/home_phone_prefixes +107 -0
- data/lib/ffaker/data/phone_number_ru/mobile_phone_prefixes +61 -0
- data/lib/ffaker/data/phone_number_se/phone_prefix +1 -1
- data/lib/ffaker/data/phone_number_ua/home_phone_prefixes +29 -0
- data/lib/ffaker/data/phone_number_ua/mobile_phone_prefixes +11 -0
- data/lib/ffaker/data/product/adj +1 -1
- data/lib/ffaker/data/product/b1 +1 -1
- data/lib/ffaker/data/product/noun +4 -1
- data/lib/ffaker/data/skill/specialty_end +1 -1
- data/lib/ffaker/data/skill/specialty_start +1 -1
- data/lib/ffaker/data/skill/tech_skills +1 -1
- data/lib/ffaker/data/sport_pl/summer +53 -0
- data/lib/ffaker/data/sport_pl/winter +14 -0
- data/lib/ffaker/data/sport_ru/summer +68 -0
- data/lib/ffaker/data/sport_ru/winter +20 -0
- data/lib/ffaker/data/sport_us/names +67 -0
- data/lib/ffaker/data/vehicle/color_prefixes +25 -0
- data/lib/ffaker/data/vehicle/displacements_list +1 -1
- data/lib/ffaker/data/vehicle/fuel_types_list +1 -1
- data/lib/ffaker/data/vehicle/makes_list +1 -1
- data/lib/ffaker/data/vehicle/transmissions_list +1 -1
- data/lib/ffaker/data/vehicle/upholstery_list +1 -1
- data/lib/ffaker/data/venue/venue_list +1 -1
- data/lib/ffaker/date.rb +40 -0
- data/lib/ffaker/dizzle_ipsum.rb +1 -3
- data/lib/ffaker/education.rb +9 -10
- data/lib/ffaker/education_cn.rb +37 -0
- data/lib/ffaker/filesystem.rb +18 -8
- data/lib/ffaker/food.rb +2 -0
- data/lib/ffaker/food_pl.rb +65 -0
- data/lib/ffaker/freedom_ipsum.rb +20 -0
- data/lib/ffaker/game.rb +33 -0
- data/lib/ffaker/gender.rb +1 -1
- data/lib/ffaker/gender_br.rb +1 -1
- data/lib/ffaker/gender_cn.rb +1 -1
- data/lib/ffaker/gender_id.rb +0 -1
- data/lib/ffaker/gender_it.rb +17 -0
- data/lib/ffaker/gender_ja.rb +18 -0
- data/lib/ffaker/gender_jp.rb +11 -0
- data/lib/ffaker/gender_kr.rb +1 -1
- data/lib/ffaker/gender_pl.rb +19 -0
- data/lib/ffaker/gender_ru.rb +22 -0
- data/lib/ffaker/geolocation.rb +34 -24
- data/lib/ffaker/guid.rb +1 -1
- data/lib/ffaker/healthcare_ipsum.rb +1 -3
- data/lib/ffaker/healthcare_ru.rb +12 -0
- data/lib/ffaker/hipster_ipsum.rb +1 -3
- data/lib/ffaker/html_ipsum.rb +10 -4
- data/lib/ffaker/identification.rb +5 -2
- data/lib/ffaker/identification_br.rb +4 -13
- data/lib/ffaker/identification_ec.rb +39 -0
- data/lib/ffaker/identification_es.rb +1 -1
- data/lib/ffaker/identification_es_cl.rb +7 -6
- data/lib/ffaker/identification_es_co.rb +3 -4
- data/lib/ffaker/identification_in.rb +15 -0
- data/lib/ffaker/identification_it.rb +30 -0
- data/lib/ffaker/identification_kr.rb +13 -6
- data/lib/ffaker/identification_mx.rb +14 -20
- data/lib/ffaker/identification_pl.rb +77 -0
- data/lib/ffaker/identification_tw.rb +24 -0
- data/lib/ffaker/image.rb +37 -14
- data/lib/ffaker/internet.rb +18 -25
- data/lib/ffaker/internet_se.rb +8 -10
- data/lib/ffaker/jo_jo.rb +24 -0
- data/lib/ffaker/job.rb +1 -1
- data/lib/ffaker/job_br.rb +1 -1
- data/lib/ffaker/job_cn.rb +1 -1
- data/lib/ffaker/job_fr.rb +1 -1
- data/lib/ffaker/job_it.rb +12 -0
- data/lib/ffaker/job_ja.rb +0 -1
- data/lib/ffaker/job_kr.rb +1 -1
- data/lib/ffaker/job_vn.rb +0 -1
- data/lib/ffaker/locale.rb +8 -12
- data/lib/ffaker/lorem.rb +6 -7
- data/lib/ffaker/lorem_ar.rb +1 -1
- data/lib/ffaker/lorem_br.rb +45 -0
- data/lib/ffaker/lorem_cn.rb +1 -2
- data/lib/ffaker/lorem_fr.rb +1 -1
- data/lib/ffaker/lorem_ie.rb +0 -1
- data/lib/ffaker/lorem_it.rb +39 -0
- data/lib/ffaker/lorem_ja.rb +2 -2
- data/lib/ffaker/lorem_kr.rb +1 -1
- data/lib/ffaker/lorem_pl.rb +0 -2
- data/lib/ffaker/lorem_ru.rb +1 -2
- data/lib/ffaker/lorem_ua.rb +3 -5
- data/lib/ffaker/movie.rb +8 -5
- data/lib/ffaker/music.rb +1 -1
- data/lib/ffaker/name.rb +5 -1
- data/lib/ffaker/name_ar.rb +0 -1
- data/lib/ffaker/name_br.rb +1 -1
- data/lib/ffaker/name_cn.rb +1 -1
- data/lib/ffaker/name_cs.rb +7 -9
- data/lib/ffaker/name_da.rb +2 -4
- data/lib/ffaker/name_de.rb +1 -3
- data/lib/ffaker/name_es.rb +0 -2
- data/lib/ffaker/name_fr.rb +5 -5
- data/lib/ffaker/name_ga.rb +1 -1
- data/lib/ffaker/name_gr.rb +2 -3
- data/lib/ffaker/name_id.rb +0 -1
- data/lib/ffaker/name_in.rb +39 -0
- data/lib/ffaker/name_it.rb +2 -3
- data/lib/ffaker/name_ja.rb +1 -1
- data/lib/ffaker/name_kh.rb +2 -0
- data/lib/ffaker/name_kr.rb +1 -1
- data/lib/ffaker/name_mx.rb +4 -6
- data/lib/ffaker/name_nb.rb +1 -3
- data/lib/ffaker/name_nl.rb +1 -3
- data/lib/ffaker/name_ph.rb +1 -3
- data/lib/ffaker/name_pl.rb +2 -3
- data/lib/ffaker/name_ru.rb +32 -71
- data/lib/ffaker/name_se.rb +1 -3
- data/lib/ffaker/name_sn.rb +3 -6
- data/lib/ffaker/name_th.rb +1 -1
- data/lib/ffaker/name_th_en.rb +2 -2
- data/lib/ffaker/name_tw.rb +20 -0
- data/lib/ffaker/name_ua.rb +1 -3
- data/lib/ffaker/name_vn.rb +1 -1
- data/lib/ffaker/nato_alphabet.rb +2 -4
- data/lib/ffaker/number.rb +30 -0
- data/lib/ffaker/phone_number.rb +1 -1
- data/lib/ffaker/phone_number_au.rb +11 -12
- data/lib/ffaker/phone_number_br.rb +16 -14
- data/lib/ffaker/phone_number_ch.rb +1 -1
- data/lib/ffaker/phone_number_cu.rb +18 -27
- data/lib/ffaker/phone_number_da.rb +1 -3
- data/lib/ffaker/phone_number_de.rb +4 -5
- data/lib/ffaker/phone_number_fr.rb +3 -12
- data/lib/ffaker/phone_number_id.rb +2 -6
- data/lib/ffaker/phone_number_it.rb +9 -7
- data/lib/ffaker/phone_number_ja.rb +88 -0
- data/lib/ffaker/phone_number_kr.rb +1 -1
- data/lib/ffaker/phone_number_mx.rb +1 -2
- data/lib/ffaker/phone_number_nl.rb +9 -12
- data/lib/ffaker/phone_number_pl.rb +68 -0
- data/lib/ffaker/phone_number_ru.rb +120 -0
- data/lib/ffaker/phone_number_se.rb +1 -1
- data/lib/ffaker/phone_number_sg.rb +1 -1
- data/lib/ffaker/phone_number_sn.rb +12 -19
- data/lib/ffaker/phone_number_tw.rb +49 -0
- data/lib/ffaker/phone_number_ua.rb +42 -0
- data/lib/ffaker/product.rb +10 -12
- data/lib/ffaker/sem_ver.rb +19 -0
- data/lib/ffaker/skill.rb +2 -2
- data/lib/ffaker/sport.rb +4 -0
- data/lib/ffaker/sport_pl.rb +25 -0
- data/lib/ffaker/sport_ru.rb +25 -0
- data/lib/ffaker/sport_us.rb +12 -0
- data/lib/ffaker/ssn.rb +5 -5
- data/lib/ffaker/ssn_mx.rb +1 -2
- data/lib/ffaker/ssn_se.rb +16 -44
- data/lib/ffaker/string.rb +18 -17
- data/lib/ffaker/time.rb +12 -11
- data/lib/ffaker/tweet.rb +4 -4
- data/lib/ffaker/unit.rb +10 -11
- data/lib/ffaker/unit_english.rb +19 -22
- data/lib/ffaker/unit_metric.rb +16 -19
- data/lib/ffaker/utils/array_utils.rb +8 -5
- data/lib/ffaker/utils/module_utils.rb +27 -6
- data/lib/ffaker/utils/random_utils.rb +4 -0
- data/lib/ffaker/utils/unique_utils.rb +32 -21
- data/lib/ffaker/vehicle.rb +67 -9
- data/lib/ffaker/venue.rb +1 -1
- data/lib/ffaker/version.rb +5 -0
- data/lib/ffaker/youtube.rb +1 -1
- data/lib/ffaker.rb +74 -164
- data/scripts/benchmark.rb +12 -11
- data/scripts/profiling.rb +3 -1
- data/scripts/reference.rb +26 -24
- data/test/helper.rb +41 -6
- data/test/test_address.rb +2 -2
- data/test/test_address_au.rb +7 -8
- data/test/test_address_br.rb +17 -4
- data/test/test_address_ca.rb +2 -2
- data/test/test_address_ch.rb +2 -2
- data/test/test_address_ch_de.rb +2 -2
- data/test/test_address_ch_fr.rb +2 -2
- data/test/test_address_ch_it.rb +2 -2
- data/test/test_address_da.rb +5 -5
- data/test/test_address_de.rb +2 -2
- data/test/test_address_fi.rb +4 -5
- data/test/test_address_fr.rb +3 -4
- data/test/test_address_gr.rb +2 -2
- data/test/test_address_id.rb +2 -3
- data/test/test_address_in.rb +2 -2
- data/test/test_address_it.rb +12 -0
- data/test/test_address_ja.rb +2 -3
- data/test/test_address_kr.rb +1 -2
- data/test/test_address_mx.rb +2 -3
- data/test/test_address_nl.rb +3 -3
- data/test/test_address_pl.rb +1 -2
- data/test/test_address_ru.rb +2 -2
- data/test/test_address_se.rb +4 -4
- data/test/test_address_sn.rb +2 -5
- data/test/test_address_ua.rb +2 -2
- data/test/test_address_uk.rb +2 -2
- data/test/test_address_us.rb +11 -2
- data/test/test_airline.rb +2 -2
- data/test/test_animal.rb +2 -2
- data/test/test_animal_br.rb +17 -0
- data/test/test_animal_cn.rb +17 -0
- data/test/test_animal_es.rb +17 -0
- data/test/test_animal_pl.rb +17 -0
- data/test/test_animal_us.rb +17 -0
- data/test/test_array_utils.rb +3 -3
- data/test/test_avatar.rb +35 -10
- data/test/test_aws.rb +3 -3
- data/test/test_bacon_ipsum.rb +2 -2
- data/test/test_bank.rb +53 -0
- data/test/test_bank_us.rb +35 -0
- data/test/test_book.rb +35 -6
- data/test/test_boolean.rb +3 -3
- data/test/test_cheesy_lingo.rb +4 -2
- data/test/test_code.rb +23 -3
- data/test/test_color.rb +2 -2
- data/test/test_color_pl.rb +13 -0
- data/test/test_color_ua.rb +2 -2
- data/test/test_company.rb +4 -4
- data/test/test_company_cn.rb +2 -2
- data/test/test_company_fr.rb +33 -0
- data/test/test_company_it.rb +2 -2
- data/test/test_company_ja.rb +28 -0
- data/test/test_company_se.rb +2 -2
- data/test/test_conference.rb +2 -2
- data/test/test_course_mathematiques.rb +3 -1
- data/test/test_course_philosophie.rb +3 -1
- data/test/test_crypto.rb +15 -0
- data/test/test_currency.rb +2 -2
- data/test/test_date.rb +47 -0
- data/test/test_dizzle_ipsum.rb +2 -2
- data/test/test_education.rb +2 -2
- data/test/test_education_cn.rb +29 -0
- data/test/{test_faker.rb → test_ffaker.rb} +7 -3
- data/test/test_filesystem.rb +39 -5
- data/test/test_food.rb +3 -3
- data/test/test_food_pl.rb +61 -0
- data/test/test_freedom_ipsum.rb +21 -0
- data/test/test_game.rb +28 -0
- data/test/test_gender.rb +3 -3
- data/test/test_gender_br.rb +2 -2
- data/test/test_gender_cn.rb +2 -2
- data/test/test_gender_id.rb +1 -2
- data/test/test_gender_it.rb +27 -0
- data/test/test_gender_ja.rb +27 -0
- data/test/test_gender_jp.rb +27 -0
- data/test/test_gender_kr.rb +2 -2
- data/test/test_gender_pl.rb +27 -0
- data/test/test_gender_ru.rb +23 -0
- data/test/test_geolocation.rb +4 -4
- data/test/test_guid.rb +2 -2
- data/test/test_healthcare_ipsum.rb +3 -1
- data/test/test_healthcare_ru.rb +19 -0
- data/test/test_hipster_ipsum.rb +2 -2
- data/test/test_html_ipsum.rb +20 -14
- data/test/test_identification.rb +14 -4
- data/test/test_identification_br.rb +2 -2
- data/test/test_identification_co.rb +5 -3
- data/test/test_identification_ec.rb +33 -0
- data/test/test_identification_es.rb +2 -2
- data/test/test_identification_es_cl.rb +3 -3
- data/test/test_identification_es_mx.rb +5 -4
- data/test/test_identification_in.rb +20 -0
- data/test/test_identification_it.rb +45 -0
- data/test/test_identification_kr.rb +5 -5
- data/test/test_identification_pl.rb +28 -0
- data/test/test_identification_tw.rb +17 -0
- data/test/test_image.rb +56 -10
- data/test/test_internet.rb +18 -16
- data/test/test_internet_se.rb +12 -9
- data/test/test_jo_jo.rb +29 -0
- data/test/test_job.rb +2 -2
- data/test/test_job_br.rb +2 -2
- data/test/test_job_cn.rb +3 -3
- data/test/test_job_fr.rb +2 -2
- data/test/test_job_it.rb +17 -0
- data/test/test_job_ja.rb +3 -3
- data/test/test_job_kr.rb +3 -3
- data/test/test_job_vn.rb +2 -3
- data/test/test_locale.rb +2 -2
- data/test/test_lorem.rb +6 -2
- data/test/test_lorem_ar.rb +3 -4
- data/test/test_lorem_br.rb +62 -0
- data/test/test_lorem_cn.rb +11 -11
- data/test/test_lorem_fr.rb +14 -12
- data/test/test_lorem_ie.rb +1 -2
- data/test/test_lorem_it.rb +51 -0
- data/test/test_lorem_ja.rb +5 -5
- data/test/test_lorem_kr.rb +2 -2
- data/test/test_lorem_pl.rb +2 -3
- data/test/test_lorem_ru.rb +3 -4
- data/test/test_lorem_ua.rb +4 -4
- data/test/test_module_utils.rb +35 -2
- data/test/test_movie.rb +2 -2
- data/test/test_music.rb +6 -6
- data/test/test_name.rb +7 -3
- data/test/test_name_ar.rb +1 -2
- data/test/test_name_br.rb +2 -2
- data/test/test_name_cn.rb +2 -2
- data/test/test_name_cs.rb +3 -4
- data/test/test_name_da.rb +5 -5
- data/test/test_name_de.rb +2 -2
- data/test/test_name_es.rb +1 -2
- data/test/test_name_fr.rb +2 -3
- data/test/test_name_ga.rb +2 -2
- data/test/test_name_gr.rb +2 -2
- data/test/test_name_id.rb +1 -2
- data/test/test_name_it.rb +2 -3
- data/test/test_name_ja.rb +2 -2
- data/test/test_name_kh.rb +10 -8
- data/test/test_name_kr.rb +2 -2
- data/test/test_name_mx.rb +2 -3
- data/test/test_name_nb.rb +2 -2
- data/test/test_name_nl.rb +2 -2
- data/test/test_name_ph.rb +2 -2
- data/test/test_name_pl.rb +1 -2
- data/test/test_name_ru.rb +38 -48
- data/test/test_name_se.rb +2 -2
- data/test/test_name_sn.rb +2 -3
- data/test/test_name_th.rb +2 -2
- data/test/test_name_th_en.rb +2 -2
- data/test/test_name_tw.rb +28 -0
- data/test/test_name_ua.rb +3 -3
- data/test/test_name_vn.rb +2 -2
- data/test/test_nato_alphabet.rb +2 -2
- data/test/test_number.rb +57 -0
- data/test/test_phone_number.rb +3 -3
- data/test/test_phone_number_au.rb +5 -6
- data/test/test_phone_number_br.rb +12 -5
- data/test/test_phone_number_cu.rb +5 -12
- data/test/test_phone_number_da.rb +2 -3
- data/test/test_phone_number_de.rb +2 -3
- data/test/test_phone_number_fr.rb +1 -2
- data/test/test_phone_number_id.rb +1 -2
- data/test/test_phone_number_it.rb +12 -0
- data/test/test_phone_number_ja.rb +63 -0
- data/test/test_phone_number_kr.rb +2 -2
- data/test/test_phone_number_mx.rb +2 -3
- data/test/test_phone_number_nl.rb +3 -4
- data/test/test_phone_number_pl.rb +56 -0
- data/test/test_phone_number_ru.rb +76 -0
- data/test/test_phone_number_se.rb +4 -4
- data/test/test_phone_number_sg.rb +10 -10
- data/test/test_phone_number_sn.rb +4 -5
- data/test/test_phone_number_tw.rb +42 -0
- data/test/test_phone_number_ua.rb +38 -0
- data/test/test_products.rb +2 -2
- data/test/test_sem_ver.rb +18 -0
- data/test/test_skill.rb +2 -2
- data/test/test_sport_pl.rb +30 -0
- data/test/test_sport_ru.rb +30 -0
- data/test/test_sport_us.rb +17 -0
- data/test/test_sports.rb +2 -2
- data/test/test_ssn.rb +2 -2
- data/test/test_ssn_mx.rb +2 -3
- data/test/test_ssn_se.rb +10 -12
- data/test/test_string.rb +8 -8
- data/test/test_time.rb +14 -8
- data/test/test_tweet.rb +11 -11
- data/test/test_unique_utils.rb +31 -7
- data/test/test_units.rb +9 -9
- data/test/test_units_english.rb +17 -18
- data/test/test_units_metric.rb +17 -18
- data/test/test_vehicle.rb +32 -5
- data/test/test_venue.rb +2 -2
- data/test/test_youtube.rb +2 -2
- metadata +211 -198
- data/lib/ffaker/data/address_jp/city +0 -127
- data/lib/ffaker/data/address_jp/designated_city +0 -20
- data/lib/ffaker/data/address_jp/street +0 -37
- data/lib/ffaker/data/address_jp/tokyo_ward +0 -23
- data/lib/ffaker/data/address_jp/village +0 -183
- data/lib/ffaker/data/address_jp/ward +0 -188
@@ -1,36 +1,35 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
|
-
# Author: wiseleyb<wiseleyb@gmail.com>
|
5
4
|
# Based on information from http://en.wikipedia.org/wiki/Telephone_numbers_in_Australia
|
6
5
|
module PhoneNumberAU
|
7
6
|
extend ModuleUtils
|
8
7
|
extend self
|
9
8
|
|
10
9
|
# Mobile prefixes
|
11
|
-
|
10
|
+
MOBILE_OPERATORS_PREFIX = %w[04 05].freeze
|
12
11
|
|
13
12
|
# Home or Work Operator prefixes
|
14
|
-
|
13
|
+
HOME_WORK_OPERATORS_PREFIX = %w[02 03 07 08].freeze
|
15
14
|
|
16
|
-
|
15
|
+
OPERATORS_PREFIX = MOBILE_OPERATORS_PREFIX + HOME_WORK_OPERATORS_PREFIX
|
17
16
|
|
18
|
-
# Return a prefix in
|
19
|
-
# @see FFaker::PhoneNumberAU::
|
17
|
+
# Return a prefix in MOBILE_OPERATORS_PREFIX
|
18
|
+
# @see FFaker::PhoneNumberAU::MOBILE_OPERATORS_PREFIX
|
20
19
|
#
|
21
20
|
def mobile_phone_prefix
|
22
|
-
fetch_sample(
|
21
|
+
fetch_sample(MOBILE_OPERATORS_PREFIX)
|
23
22
|
end
|
24
23
|
|
25
|
-
# Return a prefix in
|
26
|
-
# @see FFaker::PhoneNumberAU::
|
24
|
+
# Return a prefix in HOME_WORK_OPERATORS_PREFIX
|
25
|
+
# @see FFaker::PhoneNumberAU::HOME_WORK_OPERATORS_PREFIX
|
27
26
|
#
|
28
27
|
def home_work_phone_prefix
|
29
|
-
fetch_sample(
|
28
|
+
fetch_sample(HOME_WORK_OPERATORS_PREFIX)
|
30
29
|
end
|
31
30
|
|
32
31
|
def phone_prefix
|
33
|
-
fetch_sample(
|
32
|
+
fetch_sample(OPERATORS_PREFIX)
|
34
33
|
end
|
35
34
|
|
36
35
|
# Generates a general phone number
|
@@ -1,26 +1,31 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
|
-
#
|
5
|
-
#
|
4
|
+
# Sources:
|
5
|
+
# - https://en.wikipedia.org/wiki/Telephone_numbers_in_Brazil
|
6
|
+
# - http://www.teleco.com.br/num_cel.asp
|
7
|
+
# - http://ddd.online24hs.com.br/
|
8
|
+
# - https://tecnoblog.net/24850/prefixo-10-para-grande-sao-paulo-deve-comecar-a-funcionar-em-outubro/
|
9
|
+
# - http://agenciabrasil.ebc.com.br/geral/noticia/2016-10/numeros-de-celulares-de-todo-o-pais-terao-nove-digitos-partir-do-dia-6
|
6
10
|
#
|
7
11
|
module PhoneNumberBR
|
8
12
|
extend ModuleUtils
|
9
13
|
extend self
|
10
14
|
|
11
|
-
COUNTRY_PREFIX
|
12
|
-
AREA_CODE
|
15
|
+
COUNTRY_PREFIX = '+55'
|
16
|
+
AREA_CODE = [
|
17
|
+
11..19, 21..22, 24, 27..28, 31..35, 37..38, 41..49,
|
18
|
+
51, 53..55, 61..69, 71, 73..75, 77, 79, 81..89, 91..99
|
19
|
+
].flat_map { |x| Array(x) }.map(&:to_s).freeze
|
20
|
+
|
13
21
|
HOME_WORK_PHONE_PREFIX = %w[2 3 4 5].freeze
|
14
|
-
MOBILE_PHONE_PREFIX = %w[
|
22
|
+
MOBILE_PHONE_PREFIX = %w[96 97 98 99].freeze
|
15
23
|
PHONE_NUMBER = %w[####### ###-####].freeze
|
16
24
|
|
17
25
|
# generate a random phone number
|
18
26
|
#
|
19
27
|
def phone_number
|
20
|
-
|
21
|
-
when 0 then home_work_phone_number
|
22
|
-
when 1 then mobile_phone_number
|
23
|
-
end
|
28
|
+
rand(0..1).zero? ? home_work_phone_number : mobile_phone_number
|
24
29
|
end
|
25
30
|
|
26
31
|
def home_work_phone_number
|
@@ -34,10 +39,7 @@ module FFaker
|
|
34
39
|
# pick a random phone number with the international prefix code
|
35
40
|
#
|
36
41
|
def international_phone_number
|
37
|
-
|
38
|
-
when 0 then international_mobile_phone_number
|
39
|
-
when 1 then international_home_work_phone_number
|
40
|
-
end
|
42
|
+
rand(0..1).zero? ? international_mobile_phone_number : international_home_work_phone_number
|
41
43
|
end
|
42
44
|
|
43
45
|
def international_mobile_phone_number
|
@@ -1,34 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module FFaker
|
2
|
-
# Author: Luilver<luilver@gmail.com>
|
3
4
|
# Based on information from http://en.wikipedia.org/wiki/Telephone_numbers_in_Cuba
|
4
5
|
module PhoneNumberCU
|
5
6
|
extend ModuleUtils
|
6
7
|
extend self
|
7
8
|
|
8
9
|
# Mobile prefixes
|
9
|
-
|
10
|
+
MOBILE_OPERATORS_PREFIX = %w[05].freeze
|
10
11
|
|
11
12
|
# Home or Work Operator prefixes
|
12
|
-
|
13
|
+
HOME_WORK_OPERATORS_PREFIX = %w[
|
14
|
+
021 022 023 024 031 032 033 041 042 043 045 046 047 048 07
|
15
|
+
].freeze
|
13
16
|
|
14
|
-
|
17
|
+
OPERATORS_PREFIX = MOBILE_OPERATORS_PREFIX + HOME_WORK_OPERATORS_PREFIX
|
15
18
|
|
16
|
-
# Return a prefix in
|
17
|
-
# @see FFaker::PhoneNumberCU::
|
19
|
+
# Return a prefix in MOBILE_OPERATORS_PREFIX
|
20
|
+
# @see FFaker::PhoneNumberCU::MOBILE_OPERATORS_PREFIX
|
18
21
|
#
|
19
22
|
def mobile_phone_prefix
|
20
|
-
fetch_sample(
|
23
|
+
fetch_sample(MOBILE_OPERATORS_PREFIX)
|
21
24
|
end
|
22
25
|
|
23
|
-
# Return a prefix in
|
24
|
-
# @see FFaker::PhoneNumberCU::
|
26
|
+
# Return a prefix in HOME_WORK_OPERATORS_PREFIX
|
27
|
+
# @see FFaker::PhoneNumberCU::HOME_WORK_OPERATORS_PREFIX
|
25
28
|
#
|
26
29
|
def home_work_phone_prefix
|
27
|
-
fetch_sample(
|
30
|
+
fetch_sample(HOME_WORK_OPERATORS_PREFIX)
|
28
31
|
end
|
29
32
|
|
30
33
|
def phone_prefix
|
31
|
-
fetch_sample(
|
34
|
+
fetch_sample(OPERATORS_PREFIX)
|
32
35
|
end
|
33
36
|
|
34
37
|
# Generates a general phone number
|
@@ -52,10 +55,7 @@ module FFaker
|
|
52
55
|
# Generates general number
|
53
56
|
#
|
54
57
|
def general_phone_number
|
55
|
-
|
56
|
-
when 0 then home_work_phone_number
|
57
|
-
when 1 then mobile_phone_number
|
58
|
-
end
|
58
|
+
rand(0..1).zero? ? home_work_phone_number : mobile_phone_number
|
59
59
|
end
|
60
60
|
|
61
61
|
# Country Code is E.164 Country Code
|
@@ -67,10 +67,7 @@ module FFaker
|
|
67
67
|
# International formats
|
68
68
|
#
|
69
69
|
def international_country_code
|
70
|
-
|
71
|
-
when 0 then "00#{country_code}"
|
72
|
-
when 1 then "+#{country_code}"
|
73
|
-
end
|
70
|
+
rand(0..1).zero? ? "00#{country_code}" : "+#{country_code}"
|
74
71
|
end
|
75
72
|
|
76
73
|
def international_mobile_phone_number
|
@@ -86,10 +83,7 @@ module FFaker
|
|
86
83
|
end
|
87
84
|
|
88
85
|
def international_phone_number
|
89
|
-
|
90
|
-
when 0 then international_mobile_phone_number
|
91
|
-
when 1 then international_home_work_phone_number
|
92
|
-
end
|
86
|
+
rand(0..1).zero? ? international_mobile_phone_number : international_home_work_phone_number
|
93
87
|
end
|
94
88
|
|
95
89
|
# E.164 formats
|
@@ -112,10 +106,7 @@ module FFaker
|
|
112
106
|
end
|
113
107
|
|
114
108
|
def e164_phone_number
|
115
|
-
|
116
|
-
when 0 then e164_mobile_phone_number
|
117
|
-
when 1 then e164_home_work_phone_number
|
118
|
-
end
|
109
|
+
rand(0..1).zero? ? e164_mobile_phone_number : e164_home_work_phone_number
|
119
110
|
end
|
120
111
|
|
121
112
|
# Generates phone number
|
@@ -1,22 +1,21 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
|
-
# Author: lawitschka<moritz.lawitschka@urbanvention.com>
|
5
4
|
module PhoneNumberDE
|
6
5
|
extend ModuleUtils
|
7
6
|
extend self
|
8
7
|
|
9
8
|
# Mobile prefixes are in the 015x, 016x, 017x ranges
|
10
9
|
def mobile_prefix(leading_zero = true)
|
11
|
-
mobile_prefix =
|
12
|
-
mobile_prefix =
|
10
|
+
mobile_prefix = "1#{rand(5..7)}#{rand(0..9)}"
|
11
|
+
mobile_prefix = "0#{mobile_prefix}" if leading_zero
|
13
12
|
mobile_prefix
|
14
13
|
end
|
15
14
|
|
16
15
|
# Region prefixes are in range 02..09 with length of 3 to 5 digits
|
17
16
|
def region_prefix(leading_zero = true)
|
18
17
|
region_prefix = rand(2..9).to_s + FFaker.numerify('#' * rand(1..3)).to_s
|
19
|
-
region_prefix =
|
18
|
+
region_prefix = "0#{region_prefix}" if leading_zero
|
20
19
|
region_prefix
|
21
20
|
end
|
22
21
|
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# encoding: utf-8
|
3
2
|
|
4
3
|
module FFaker
|
5
4
|
# Source: https://en.wikipedia.org/wiki/Telephone_numbers_in_France
|
@@ -25,10 +24,7 @@ module FFaker
|
|
25
24
|
|
26
25
|
# generates mobile or home/work number
|
27
26
|
def phone_number
|
28
|
-
|
29
|
-
when 0 then home_work_phone_number
|
30
|
-
when 1 then mobile_phone_number
|
31
|
-
end
|
27
|
+
rand(0..1).zero? ? home_work_phone_number : mobile_phone_number
|
32
28
|
end
|
33
29
|
|
34
30
|
def country_code
|
@@ -44,10 +40,7 @@ module FFaker
|
|
44
40
|
end
|
45
41
|
|
46
42
|
def international_phone_number
|
47
|
-
|
48
|
-
when 0 then international_mobile_phone_number
|
49
|
-
when 1 then international_home_work_phone_number
|
50
|
-
end
|
43
|
+
rand(0..1).zero? ? international_mobile_phone_number : international_home_work_phone_number
|
51
44
|
end
|
52
45
|
|
53
46
|
private
|
@@ -60,15 +53,13 @@ module FFaker
|
|
60
53
|
FFaker.numerify [
|
61
54
|
country_prefix,
|
62
55
|
space,
|
63
|
-
# fetch_sample(AREA_CODE),
|
64
|
-
# space,
|
65
56
|
prefix,
|
66
57
|
fetch_sample(PHONE_NUMBER)
|
67
58
|
].join.strip
|
68
59
|
end
|
69
60
|
|
70
61
|
def random_space
|
71
|
-
rand(0..1)
|
62
|
+
rand(0..1).zero? ? '' : ' '
|
72
63
|
end
|
73
64
|
end
|
74
65
|
end
|
@@ -1,12 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# encoding: utf-8
|
3
2
|
|
4
3
|
module FFaker
|
5
4
|
module PhoneNumberID
|
6
5
|
extend ModuleUtils
|
7
6
|
extend self
|
8
7
|
|
9
|
-
COUNTRY_CODE = '+62'
|
8
|
+
COUNTRY_CODE = '+62'
|
10
9
|
|
11
10
|
def mobile_phone_number
|
12
11
|
"#{fetch_sample(MOBILE_PHONE_PREFIXES)}-#{FFaker.numerify('########')}"
|
@@ -19,10 +18,7 @@ module FFaker
|
|
19
18
|
end
|
20
19
|
|
21
20
|
def phone_number
|
22
|
-
|
23
|
-
when 0 then home_phone_number
|
24
|
-
when 1 then mobile_phone_number
|
25
|
-
end
|
21
|
+
rand(0..1).zero? ? home_phone_number : mobile_phone_number
|
26
22
|
end
|
27
23
|
|
28
24
|
def international_mobile_phone_number
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
4
|
module PhoneNumberIT
|
@@ -24,15 +24,17 @@ module FFaker
|
|
24
24
|
number MOBILE_PHONE_PREFIXES
|
25
25
|
end
|
26
26
|
|
27
|
+
private
|
28
|
+
|
27
29
|
def number(prefixes)
|
28
|
-
|
29
|
-
COUNTRY_PREFIX
|
30
|
-
prefixes
|
30
|
+
pattern = [
|
31
|
+
fetch_sample(COUNTRY_PREFIX),
|
32
|
+
fetch_sample(prefixes),
|
31
33
|
random_space,
|
32
|
-
PHONE_NUMBER
|
33
|
-
].join
|
34
|
+
fetch_sample(PHONE_NUMBER)
|
35
|
+
].join
|
34
36
|
|
35
|
-
FFaker.numerify
|
37
|
+
FFaker.numerify(pattern)
|
36
38
|
end
|
37
39
|
|
38
40
|
def random_space
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# sourse: https://www.soumu.go.jp/main_sosiki/joho_tsusin/top/tel_number/number_shitei.html#kotei-denwa
|
4
|
+
|
5
|
+
module FFaker
|
6
|
+
module PhoneNumberJA
|
7
|
+
extend ModuleUtils
|
8
|
+
extend self
|
9
|
+
|
10
|
+
JAPAN_PREFIX = '0'
|
11
|
+
JAPAN_COUNTRY_CODE = '+81'
|
12
|
+
|
13
|
+
ONE_DISIT_FORMAT = '%s #### ####'
|
14
|
+
TWO_DISIT_FORMAT = '%s ### ####'
|
15
|
+
THREE_DISIT_FORMAT = '%s ## ####'
|
16
|
+
FOUR_DISIT_FORMAT = '%s # ####'
|
17
|
+
|
18
|
+
MOBILE_PHONE_PREFIXES = %w[90 80 70].freeze
|
19
|
+
IP_PHONE_PREFIX = '50'
|
20
|
+
MOBILE_NUMBER_FORMAT = '%s #### ####'
|
21
|
+
|
22
|
+
def home_phone_number
|
23
|
+
disit = rand(1..4)
|
24
|
+
FFaker.numerify("#{JAPAN_PREFIX}#{home_phone_number_format(disit)}")
|
25
|
+
end
|
26
|
+
|
27
|
+
def mobile_phone_number
|
28
|
+
FFaker.numerify("#{JAPAN_PREFIX}#{mobile_phone_number_format}")
|
29
|
+
end
|
30
|
+
|
31
|
+
def phone_number
|
32
|
+
case rand(0..1)
|
33
|
+
when 0 then home_phone_number
|
34
|
+
when 1 then mobile_phone_number
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def international_home_phone_number
|
39
|
+
disit = rand(1..4)
|
40
|
+
FFaker.numerify("#{JAPAN_COUNTRY_CODE} #{home_phone_number_format(disit)}")
|
41
|
+
end
|
42
|
+
|
43
|
+
def international_mobile_phone_number
|
44
|
+
FFaker.numerify("#{JAPAN_COUNTRY_CODE} #{mobile_phone_number_format}")
|
45
|
+
end
|
46
|
+
|
47
|
+
def international_phone_number
|
48
|
+
case rand(0..1)
|
49
|
+
when 0 then international_mobile_phone_number
|
50
|
+
when 1 then international_home_phone_number
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def home_phone_prefix(disit = nil)
|
55
|
+
case disit
|
56
|
+
when 1 then fetch_sample(ONE_DISIT_AREA_CODES)
|
57
|
+
when 2 then fetch_sample(TWO_DISIT_AREA_CODES)
|
58
|
+
when 3 then fetch_sample(THREE_DISIT_AREA_CODES)
|
59
|
+
when 4 then fetch_sample(FOUR_DISIT_AREA_CODES)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def home_phone_number_format(disit)
|
64
|
+
prefix = home_phone_prefix(disit)
|
65
|
+
select_home_phone_format(disit) % prefix
|
66
|
+
end
|
67
|
+
|
68
|
+
def mobile_prefix
|
69
|
+
fetch_sample(MOBILE_PHONE_PREFIXES)
|
70
|
+
end
|
71
|
+
|
72
|
+
def mobile_phone_number_format
|
73
|
+
prefix = mobile_prefix
|
74
|
+
MOBILE_NUMBER_FORMAT % prefix
|
75
|
+
end
|
76
|
+
|
77
|
+
private
|
78
|
+
|
79
|
+
def select_home_phone_format(disit)
|
80
|
+
case disit
|
81
|
+
when 1 then ONE_DISIT_FORMAT
|
82
|
+
when 2 then TWO_DISIT_FORMAT
|
83
|
+
when 3 then THREE_DISIT_FORMAT
|
84
|
+
when 4 then FOUR_DISIT_FORMAT
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -1,24 +1,22 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
4
|
module PhoneNumberNL
|
5
5
|
extend ModuleUtils
|
6
6
|
extend self
|
7
7
|
|
8
|
-
COUNTRY_CODE = '+31'
|
9
|
-
AREA_CODE_PREFIX = '0'
|
8
|
+
COUNTRY_CODE = '+31'
|
9
|
+
AREA_CODE_PREFIX = '0'
|
10
10
|
PHONE_NUMBER = {
|
11
11
|
2 => ['#######', '### ####', '#### ###'],
|
12
12
|
3 => ['######', '#### ##', '## ## ##']
|
13
13
|
}.freeze
|
14
|
-
AREA_CODES = %w[10 111 113 114 115 117 118 13 14 15 161 162 164 165 166 167 168 172 174 180 181 182 183 184 186 187 20 222 223 224 226 227 228 229 23 24 251 252 255 26 294 297 299 30 313 314 315 316 317 318 320 321 33 341 342 343 344 345 346 347 348 35 36 38 40 411 412 413 416 418 43 45 46 475 478 481 485 486 487 488 492 493 495 497 499 50 511 512 513 514 515 516 517 518 519 521 522 523 524 525 527 528 529 53 541 543 544 545 546 547 548 55 561 562 566 570 571 572 573 575 577 578 58 591 592 593 594 595 596 597 598 599 70 71 72 73 74 75 76 77 78 79].freeze
|
15
14
|
MOBILE_PHONE_NUMBER = ['########', ' ## ## ## ##', ' ### ### ##', ' #### ####'].freeze
|
16
15
|
|
17
16
|
def phone_number
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
17
|
+
return home_work_phone_number if rand(0..1).zero?
|
18
|
+
|
19
|
+
mobile_phone_number
|
22
20
|
end
|
23
21
|
|
24
22
|
def home_work_phone_number
|
@@ -31,10 +29,9 @@ module FFaker
|
|
31
29
|
end
|
32
30
|
|
33
31
|
def international_phone_number
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
32
|
+
return international_mobile_phone_number if rand(0..1).zero?
|
33
|
+
|
34
|
+
international_home_work_phone_number
|
38
35
|
end
|
39
36
|
|
40
37
|
def international_home_work_phone_number
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FFaker
|
4
|
+
# Inspirations:
|
5
|
+
# https://pl.wikipedia.org/wiki/Numery_telefoniczne_w_Polsce
|
6
|
+
# https://pl.wikipedia.org/wiki/Plan_numeracji_krajowej
|
7
|
+
module PhoneNumberPL
|
8
|
+
extend ModuleUtils
|
9
|
+
|
10
|
+
module_function
|
11
|
+
|
12
|
+
PHONE_NUMBER_FORMAT = '%s#######'
|
13
|
+
COUNTRY_CODE = '+48'
|
14
|
+
MOBILE_PREFIXES = %w[50 51 53 57 60 66 69 72 73 78 79 88].freeze
|
15
|
+
AREA_CODES = %w[12 13 14 15 16 17 18 22 23 24 25 29 32 33
|
16
|
+
34 41 42 43 44 46 48 52 54 55 56 58 59 61
|
17
|
+
62 63 65 67 68 71 74 75 76 77 81 82 83 84
|
18
|
+
85 86 87 89 91 94 95].freeze
|
19
|
+
|
20
|
+
def phone_number
|
21
|
+
case rand(0..1)
|
22
|
+
when 0 then home_work_phone_number
|
23
|
+
when 1 then mobile_phone_number
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def home_work_phone_number
|
28
|
+
FFaker.numerify(phone_number_format)
|
29
|
+
end
|
30
|
+
|
31
|
+
def mobile_phone_number
|
32
|
+
FFaker.numerify(mobile_phone_number_format)
|
33
|
+
end
|
34
|
+
|
35
|
+
def international_phone_number
|
36
|
+
case rand(0..1)
|
37
|
+
when 0 then international_mobile_phone_number
|
38
|
+
when 1 then international_home_work_phone_number
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def international_mobile_phone_number
|
43
|
+
FFaker.numerify("#{COUNTRY_CODE} #{mobile_phone_number_format}")
|
44
|
+
end
|
45
|
+
|
46
|
+
def international_home_work_phone_number
|
47
|
+
FFaker.numerify("#{COUNTRY_CODE} #{phone_number_format}")
|
48
|
+
end
|
49
|
+
|
50
|
+
def area_code
|
51
|
+
fetch_sample(AREA_CODES)
|
52
|
+
end
|
53
|
+
|
54
|
+
def mobile_prefix
|
55
|
+
fetch_sample(MOBILE_PREFIXES)
|
56
|
+
end
|
57
|
+
|
58
|
+
def phone_number_format
|
59
|
+
prefix = area_code
|
60
|
+
PHONE_NUMBER_FORMAT % prefix
|
61
|
+
end
|
62
|
+
|
63
|
+
def mobile_phone_number_format
|
64
|
+
prefix = mobile_prefix
|
65
|
+
PHONE_NUMBER_FORMAT % prefix
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FFaker
|
4
|
+
module PhoneNumberRU
|
5
|
+
extend ModuleUtils
|
6
|
+
extend self
|
7
|
+
|
8
|
+
INTERNATIONAL_COUNTRY_PREFIX = '+7'
|
9
|
+
COUNTRY_PREFIX = '8'
|
10
|
+
TOLL_FREE_PREFIX = '800'
|
11
|
+
|
12
|
+
# Generate general phone number with international country code
|
13
|
+
# +7 929 933 24 99
|
14
|
+
# +7 851 921 35 92
|
15
|
+
#
|
16
|
+
def international_phone_number
|
17
|
+
case rand(0..1)
|
18
|
+
when 0 then international_mobile_phone_number
|
19
|
+
when 1 then international_home_work_phone_number
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# Generate mobile phone number with international country code
|
24
|
+
# +7 929 933 24 99
|
25
|
+
# +7 978 921 35 92
|
26
|
+
#
|
27
|
+
def international_mobile_phone_number
|
28
|
+
build_phone_number(international_country_code, mobile_phone_prefix)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Generate home or work phone number with international country code
|
32
|
+
# +7 842 933 24 99
|
33
|
+
# +7 851 921 35 92
|
34
|
+
#
|
35
|
+
def international_home_work_phone_number
|
36
|
+
build_phone_number(international_country_code, home_work_phone_prefix)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Generate toll free phone number with international country code
|
40
|
+
# +7 800 413 01 33
|
41
|
+
# +7 800 153 55 22
|
42
|
+
#
|
43
|
+
def international_toll_free_number
|
44
|
+
build_phone_number(international_country_code, TOLL_FREE_PREFIX)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Generate general phone number with internal country code
|
48
|
+
# 8 999 044 31 33
|
49
|
+
# 8 843 944 33 33
|
50
|
+
#
|
51
|
+
def phone_number
|
52
|
+
case rand(0..1)
|
53
|
+
when 0 then mobile_phone_number
|
54
|
+
when 1 then home_work_phone_number
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Generate mobile phone number with internal country code
|
59
|
+
# 8 949 232 22 22
|
60
|
+
# 8 999 331 23 12
|
61
|
+
#
|
62
|
+
def mobile_phone_number
|
63
|
+
build_phone_number(country_code, mobile_phone_prefix)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Generate home or work phone number with internal country code
|
67
|
+
# 8 011 232 22 22
|
68
|
+
# 8 836 331 23 12
|
69
|
+
#
|
70
|
+
def home_work_phone_number
|
71
|
+
build_phone_number(country_code, home_work_phone_prefix)
|
72
|
+
end
|
73
|
+
|
74
|
+
# Generate toll free phone number with internal country code
|
75
|
+
# 8 800 413 01 33
|
76
|
+
# 8 800 153 55 22
|
77
|
+
#
|
78
|
+
def toll_free_number
|
79
|
+
build_phone_number(country_code, TOLL_FREE_PREFIX)
|
80
|
+
end
|
81
|
+
|
82
|
+
# International country code
|
83
|
+
# +7
|
84
|
+
#
|
85
|
+
def international_country_code
|
86
|
+
INTERNATIONAL_COUNTRY_PREFIX
|
87
|
+
end
|
88
|
+
|
89
|
+
# Internal country code
|
90
|
+
# 8
|
91
|
+
#
|
92
|
+
def country_code
|
93
|
+
COUNTRY_PREFIX
|
94
|
+
end
|
95
|
+
|
96
|
+
# Home or work phone prefix
|
97
|
+
# 081
|
98
|
+
# 301
|
99
|
+
#
|
100
|
+
def home_work_phone_prefix
|
101
|
+
fetch_sample(HOME_PHONE_PREFIXES)
|
102
|
+
end
|
103
|
+
|
104
|
+
# Mobile phone prefix
|
105
|
+
# 929
|
106
|
+
# 978
|
107
|
+
#
|
108
|
+
def mobile_phone_prefix
|
109
|
+
fetch_sample(MOBILE_PHONE_PREFIXES)
|
110
|
+
end
|
111
|
+
|
112
|
+
private
|
113
|
+
|
114
|
+
# Build phone number by country_code and prefix
|
115
|
+
#
|
116
|
+
def build_phone_number(country_code, prefix)
|
117
|
+
"#{country_code} #{prefix} #{FFaker.numerify('###-##-##')}"
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|