ffaker 2.7.0 → 2.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Changelog.md +115 -0
- data/Gemfile +2 -0
- data/RANDOM.md +153 -0
- data/README.md +25 -4
- data/REFERENCE.md +1736 -1117
- data/Rakefile +5 -9
- data/ffaker.gemspec +15 -6
- data/lib/ffaker/address.rb +3 -3
- 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 +6 -4
- 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 +36 -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 +2 -4
- 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 +23 -5
- 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/book.rb +12 -1
- data/lib/ffaker/boolean.rb +1 -1
- data/lib/ffaker/cheesy_lingo.rb +3 -6
- data/lib/ffaker/code.rb +37 -0
- 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 +4 -7
- 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/currency.rb +5 -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 +1 -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 +8 -0
- 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/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_ie/characters +5 -0
- data/lib/ffaker/data/lorem_ie/paragraphs +2 -0
- data/lib/ffaker/data/lorem_ie/questions +1 -0
- data/lib/ffaker/data/lorem_ie/sentences +1 -0
- data/lib/ffaker/data/lorem_ie/words +107 -0
- data/lib/ffaker/data/lorem_it/words +321 -0
- data/lib/ffaker/data/lorem_pl/characters +32 -0
- data/lib/ffaker/data/lorem_pl/words +245 -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_es/first_names_female +184 -0
- data/lib/ffaker/data/name_es/first_names_male +165 -0
- data/lib/ffaker/data/name_es/last_names +208 -0
- 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/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 +8 -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 +7 -2
- 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 +32 -22
- 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 +1 -1
- data/lib/ffaker/identification_es.rb +1 -1
- data/lib/ffaker/identification_es_cl.rb +6 -5
- data/lib/ffaker/identification_es_co.rb +2 -3
- data/lib/ffaker/identification_in.rb +15 -0
- data/lib/ffaker/identification_it.rb +30 -0
- data/lib/ffaker/identification_kr.rb +3 -3
- 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 +48 -0
- data/lib/ffaker/internet.rb +19 -26
- data/lib/ffaker/internet_se.rb +8 -10
- 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 +40 -0
- data/lib/ffaker/lorem_it.rb +39 -0
- data/lib/ffaker/lorem_ja.rb +1 -1
- data/lib/ffaker/lorem_kr.rb +1 -1
- data/lib/ffaker/lorem_pl.rb +60 -0
- data/lib/ffaker/lorem_ru.rb +0 -1
- data/lib/ffaker/lorem_ua.rb +3 -5
- data/lib/ffaker/movie.rb +7 -4
- 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 +64 -0
- data/lib/ffaker/name_fr.rb +1 -2
- 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 +1 -2
- 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 +26 -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 +1 -2
- data/lib/ffaker/phone_number_fr.rb +50 -13
- 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 +1 -1
- 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 +7 -2
- data/lib/ffaker/ssn_mx.rb +1 -2
- data/lib/ffaker/ssn_se.rb +14 -42
- data/lib/ffaker/string.rb +17 -16
- data/lib/ffaker/time.rb +39 -21
- 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 +26 -4
- data/lib/ffaker/utils/random_utils.rb +4 -0
- data/lib/ffaker/utils/unique_utils.rb +0 -1
- data/lib/ffaker/vehicle.rb +67 -9
- data/lib/ffaker/venue.rb +1 -1
- data/lib/ffaker/youtube.rb +1 -1
- data/lib/ffaker.rb +199 -17
- data/lib/version.rb +5 -0
- data/scripts/benchmark.rb +12 -11
- data/scripts/profiling.rb +3 -1
- data/scripts/reference.rb +21 -17
- data/test/helper.rb +38 -1
- 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 +2 -2
- data/test/test_address_de.rb +2 -2
- data/test/test_address_fi.rb +5 -6
- 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 +5 -5
- 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 +5 -3
- 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_book.rb +10 -5
- data/test/test_boolean.rb +3 -3
- data/test/test_cheesy_lingo.rb +5 -3
- data/test/test_code.rb +39 -0
- data/test/test_color.rb +5 -5
- 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_currency.rb +3 -3
- 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 +13 -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 +9 -4
- 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 +3 -3
- data/test/test_html_ipsum.rb +20 -14
- data/test/test_identification.rb +3 -3
- data/test/test_identification_br.rb +2 -2
- data/test/test_identification_co.rb +5 -3
- data/test/test_identification_es.rb +2 -2
- data/test/test_identification_es_cl.rb +3 -3
- data/test/test_identification_es_mx.rb +2 -3
- data/test/test_identification_in.rb +20 -0
- data/test/test_identification_it.rb +34 -0
- data/test/test_identification_kr.rb +2 -2
- data/test/test_identification_pl.rb +28 -0
- data/test/test_identification_tw.rb +17 -0
- data/test/test_image.rb +51 -0
- data/test/test_internet.rb +16 -16
- data/test/test_internet_se.rb +7 -7
- 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 +8 -8
- data/test/test_lorem_fr.rb +15 -13
- data/test/test_lorem_ie.rb +52 -0
- data/test/test_lorem_it.rb +51 -0
- data/test/test_lorem_ja.rb +5 -5
- data/test/test_lorem_kr.rb +5 -5
- data/test/test_lorem_pl.rb +51 -0
- data/test/test_lorem_ru.rb +4 -5
- data/test/test_lorem_ua.rb +5 -5
- data/test/test_module_utils.rb +2 -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 +6 -6
- data/test/test_name_de.rb +2 -2
- data/test/test_name_es.rb +70 -0
- 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 +3 -3
- 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 +4 -4
- data/test/test_name_vn.rb +2 -2
- data/test/test_nato_alphabet.rb +2 -2
- data/test/test_number.rb +45 -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 +57 -0
- 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 +2 -3
- 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 +5 -5
- data/test/test_phone_number_sg.rb +2 -2
- 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 +18 -4
- 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 +61 -18
- data/test/test_tweet.rb +11 -11
- data/test/test_unique_utils.rb +2 -2
- data/test/test_units.rb +3 -3
- data/test/test_units_english.rb +2 -3
- data/test/test_units_metric.rb +2 -3
- data/test/test_vehicle.rb +10 -5
- data/test/test_venue.rb +2 -2
- data/test/test_youtube.rb +2 -2
- metadata +402 -143
- 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
data/lib/ffaker/geolocation.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
4
|
module Geolocation
|
@@ -14,27 +14,37 @@ module FFaker
|
|
14
14
|
end
|
15
15
|
|
16
16
|
LATLNG = [
|
17
|
-
[41.022921, -73.667595], [41.017643, -73.769264], [40.89505, -73.83582],
|
18
|
-
[
|
19
|
-
[40.
|
20
|
-
[40.
|
21
|
-
[40.
|
22
|
-
[
|
23
|
-
[
|
24
|
-
[40.
|
25
|
-
[
|
26
|
-
[
|
27
|
-
[
|
28
|
-
[
|
29
|
-
[
|
30
|
-
[
|
31
|
-
[
|
32
|
-
[
|
33
|
-
[
|
34
|
-
[
|
35
|
-
[
|
36
|
-
[
|
37
|
-
[
|
17
|
+
[41.022921, -73.667595], [41.017643, -73.769264], [40.89505, -73.83582],
|
18
|
+
[41.018461, -73.66616], [40.6665875097692, -73.8830092325694],
|
19
|
+
[40.6784867492198, -73.9716387729985], [40.5998084142575, -73.9385565185842],
|
20
|
+
[40.6175673160943, -74.0002511295821], [40.7451545655034, -73.971855164776],
|
21
|
+
[40.7143394939935, -73.9783896644132], [40.7916523500249, -73.9693478828185],
|
22
|
+
[40.8005590858048, -73.9473684707957], [40.7292057951864, -73.7555431517841],
|
23
|
+
[40.7532199291845, -73.8842977517553], [40.7490546706085, -73.9187706945134],
|
24
|
+
[40.6609944585817, -73.8454648940358], [38.9962071932467, -77.0898681997577],
|
25
|
+
[38.9614005154765, -77.0739996811784], [38.9381545320739, -77.0656875352079],
|
26
|
+
[39.0788984258721, -77.0500853418371], [40.8377346033077, -73.8618025934729],
|
27
|
+
[40.8377346033077, -73.8618025934729], [40.8831107806302, -73.9212453413708],
|
28
|
+
[40.9077802515069, -73.9025768857695], [36.1936372347, -115.068968492],
|
29
|
+
[36.2345447488, -115.327274645], [36.1257785585, -115.08848819],
|
30
|
+
[36.0150030591, -115.120716573], [41.5205, -81.587], [41.491529, -81.611008],
|
31
|
+
[41.4811, -81.9136], [41.5244, -81.5531], [38.5241394042969, -90.3121643066406],
|
32
|
+
[38.4685363769531, -90.3760452270508], [38.7077140808105, -90.2698593139648],
|
33
|
+
[38.7953453063965, -90.2058792114258], [33.5775667696072, -112.21954995412],
|
34
|
+
[33.4136301699617, -112.605812600303], [33.3732084677927, -111.602125919385],
|
35
|
+
[33.4280828890754, -112.496547310057], [40.0677174866262, -75.0764604391247],
|
36
|
+
[39.9760149034563, -75.1786003814711], [39.9871631180866, -75.1862338204704],
|
37
|
+
[39.9847861520773, -75.110396933127], [26.1180992126465, -80.149299621582],
|
38
|
+
[25.4804286236799, -80.4256357381565], [26.1793003082275, -80.1410980224609],
|
39
|
+
[26.5322723388672, -80.1300048828125], [47.685714288367, -122.340967372417],
|
40
|
+
[47.6993431274679, -122.395610510952], [47.7553943974153, -122.305764516646],
|
41
|
+
[47.5173276931226, -122.275152683751], [40.78595, -73.196244], [40.927955, -73.048076],
|
42
|
+
[41.022872, -72.204989], [40.855153, -72.572405], [34.101011924908, -118.064638782714],
|
43
|
+
[34.2430955947492, -118.427610513239], [34.3823767402857, -118.550562688364],
|
44
|
+
[33.8256050190507, -118.281161297494], [37.5758033375583, -122.012044535507],
|
45
|
+
[37.8768587606888, -122.078250641083], [37.6859990796181, -122.094516147761],
|
46
|
+
[37.4660979087165, -121.900873639257], [41.77117, -87.888795], [41.900425, -87.624262],
|
47
|
+
[41.737173, -87.869998]
|
38
48
|
].freeze
|
39
49
|
|
40
50
|
def boxed_coords(upper_left, lower_right)
|
data/lib/ffaker/guid.rb
CHANGED
data/lib/ffaker/hipster_ipsum.rb
CHANGED
data/lib/ffaker/html_ipsum.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
4
|
# Loosely based on http://html-ipsum.com/
|
@@ -134,9 +134,15 @@ module FFaker
|
|
134
134
|
a = k([
|
135
135
|
content_tag_for(:strong, words(2).capitalize!),
|
136
136
|
content_tag_for(:em, paragraph),
|
137
|
+
content_tag_for(:mark, paragraph),
|
138
|
+
content_tag_for(:del, words(2)),
|
139
|
+
content_tag_for(:ins, words(2)),
|
140
|
+
content_tag_for(:sub, words(2)),
|
141
|
+
content_tag_for(:sup, words(2)),
|
137
142
|
content_tag_for(:code, words(2)),
|
143
|
+
content_tag_for(:small, words(2)),
|
138
144
|
(a 2).to_s
|
139
|
-
] + FFaker::Lorem.paragraphs(count))
|
145
|
+
] + FFaker::Lorem.paragraphs(count - 1))
|
140
146
|
fetch_sample(a, count: count).join(sep)
|
141
147
|
end
|
142
148
|
|
@@ -146,11 +152,11 @@ module FFaker
|
|
146
152
|
element_content = if content
|
147
153
|
content
|
148
154
|
else
|
149
|
-
block_html = ''
|
155
|
+
block_html = +''
|
150
156
|
yield(block_html)
|
151
157
|
block_html
|
152
158
|
end
|
153
|
-
"<#{element}>#{element_content}</#{element}>"
|
159
|
+
+"<#{element}>#{element_content}</#{element}>"
|
154
160
|
end
|
155
161
|
|
156
162
|
def word
|
@@ -1,11 +1,14 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
4
|
module Identification
|
5
5
|
extend ModuleUtils
|
6
6
|
extend self
|
7
7
|
|
8
|
-
ETHNICITIES = [
|
8
|
+
ETHNICITIES = [
|
9
|
+
'African American', 'Asian/Pacific Islander', 'Caucasian', 'Hispanic', 'Native American',
|
10
|
+
'Multiracial', 'Other', 'Prefer not to respond'
|
11
|
+
].freeze
|
9
12
|
GENDERS = %w[Male Female].freeze
|
10
13
|
|
11
14
|
def drivers_license
|
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
require 'ffaker/identification_es'
|
1
|
+
# frozen_string_literal: true
|
4
2
|
|
5
3
|
module FFaker
|
6
4
|
module IdentificationESCL
|
@@ -11,7 +9,8 @@ module FFaker
|
|
11
9
|
# RUT is the Chilean ID, followed by format: XX.XXX.XXX - Y
|
12
10
|
# http://es.wikipedia.org/wiki/Rol_%C3%9Anico_Tributario
|
13
11
|
#
|
14
|
-
# The last Y is a modulo 11 validation code. In the case the result is 10, it will be
|
12
|
+
# The last Y is a modulo 11 validation code. In the case the result is 10, it will be
|
13
|
+
# replaced by a 'K' character
|
15
14
|
def rut
|
16
15
|
# Rut is gonna be between 1.000.000 and 24.999.999
|
17
16
|
n = rand(1_000_000...25_000_000)
|
@@ -21,7 +20,9 @@ module FFaker
|
|
21
20
|
private
|
22
21
|
|
23
22
|
def dv(rut)
|
24
|
-
total = rut.to_s.rjust(8, '0').split(//).zip(%w[3 2 7 6 5 4 3 2]).
|
23
|
+
total = rut.to_s.rjust(8, '0').split(//).zip(%w[3 2 7 6 5 4 3 2]).sum do |a, b|
|
24
|
+
a.to_i * b.to_i
|
25
|
+
end
|
25
26
|
(11 - total % 11).to_s.gsub(/10/, 'k').gsub(/11/, '0')
|
26
27
|
end
|
27
28
|
end
|
@@ -1,6 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'ffaker/identification_es'
|
4
3
|
require 'date'
|
5
4
|
|
6
5
|
module FFaker
|
@@ -27,7 +26,7 @@ module FFaker
|
|
27
26
|
"#{category}#{num}"
|
28
27
|
end
|
29
28
|
|
30
|
-
def blood_type
|
29
|
+
def blood_type
|
31
30
|
sign = fetch_sample(%w[+ -])
|
32
31
|
"#{fetch_sample(BLOOD_TYPE)}#{sign}"
|
33
32
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FFaker
|
4
|
+
module IdentificationIN
|
5
|
+
extend ModuleUtils
|
6
|
+
extend self
|
7
|
+
|
8
|
+
AADHAAR_FORMAT = ['############'].freeze
|
9
|
+
|
10
|
+
# REF: https://en.wikipedia.org/wiki/Aadhaar
|
11
|
+
def aadhaar
|
12
|
+
FFaker.numerify(AADHAAR_FORMAT)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FFaker
|
4
|
+
module IdentificationIT
|
5
|
+
extend ModuleUtils
|
6
|
+
extend self
|
7
|
+
|
8
|
+
ETHNICITIES = [
|
9
|
+
'Afroamericano', 'Asiatico/isolano del Pacifico', 'Caucasico', 'Ispanico', 'Nativo americano',
|
10
|
+
'Multirazziale', 'Altro', 'Preferisco non rispondere'
|
11
|
+
].freeze
|
12
|
+
GENDERS = %w[Maschio Femmina].freeze
|
13
|
+
|
14
|
+
def drivers_license
|
15
|
+
FFaker::String.from_regexp(/U1[1-9]\d{7}[A-Z]/)
|
16
|
+
end
|
17
|
+
|
18
|
+
def ssn
|
19
|
+
FFaker.numerify('####################')
|
20
|
+
end
|
21
|
+
|
22
|
+
def ethnicity
|
23
|
+
fetch_sample(ETHNICITIES)
|
24
|
+
end
|
25
|
+
|
26
|
+
def gender
|
27
|
+
fetch_sample(GENDERS)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
4
|
module IdentificationKr
|
@@ -8,9 +8,9 @@ module FFaker
|
|
8
8
|
# Resident Registration Number
|
9
9
|
# http://ko.wikipedia.org/wiki/%EC%A3%BC%EB%AF%BC%EB%93%B1%EB%A1%9D%EB%B2%88%ED%98%B8
|
10
10
|
def rrn
|
11
|
-
birth = fetch_sample(
|
11
|
+
birth = fetch_sample(Date.new(1970, 1, 1)..Date.new(1999, 12, 31)).strftime('%y%d%m')
|
12
12
|
sex = fetch_sample([1, 2])
|
13
|
-
loc = FFaker.numerify("#{fetch_sample(
|
13
|
+
loc = FFaker.numerify("#{fetch_sample(Array('00'..'95'))}###")
|
14
14
|
a, b, c, d, e, f, g, h, i, j, k, l = "#{birth}#{sex}#{loc}".split(//).map(&:to_i)
|
15
15
|
checksum = (11 - (2 * a + 3 * b + 4 * c + 5 * d + 6 * e + 7 * f + 8 * g + 9 * h + 2 * i + 3 * j + 4 * k + 5 * l) % 11) % 10
|
16
16
|
"#{birth}-#{sex}#{loc}#{checksum}"
|
@@ -1,27 +1,22 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
require 'ffaker/identification_es'
|
1
|
+
# frozen_string_literal: true
|
4
2
|
|
5
3
|
module FFaker
|
6
4
|
module IdentificationMX
|
7
|
-
# Author Guapolo <github.com/guapolo>
|
8
5
|
extend ModuleUtils
|
9
6
|
extend self
|
10
7
|
|
11
8
|
CONSONANTS = %w[B C D F G H J K L M N P Q R S T V W X Y Z].freeze
|
12
9
|
VOWELS = %w[A E I O U].freeze
|
13
|
-
HOMOCLAVE = CONSONANTS + VOWELS +
|
10
|
+
HOMOCLAVE = CONSONANTS + VOWELS + Array('0'..'9')
|
14
11
|
|
15
12
|
# http://es.wikipedia.org/wiki/Registro_Federal_de_Contribuyentes_(M%C3%A9xico)
|
16
13
|
# Registro Federal de Contribuyentes (R.F.C.) para persona física
|
17
14
|
def rfc_persona_fisica
|
18
15
|
consonants_n = CONSONANTS + ['Ñ']
|
19
|
-
all_letters = consonants_n + VOWELS
|
20
|
-
date = ::Time.at(rand * ::Time.now.to_f).strftime('%y%m%d')
|
21
16
|
[
|
22
17
|
fetch_sample(consonants_n),
|
23
18
|
fetch_sample(VOWELS),
|
24
|
-
fetch_sample(
|
19
|
+
fetch_sample(consonants_n + VOWELS, count: 2).join,
|
25
20
|
date,
|
26
21
|
fetch_sample(HOMOCLAVE, count: 3).join
|
27
22
|
].join
|
@@ -32,8 +27,7 @@ module FFaker
|
|
32
27
|
def rfc_persona_moral
|
33
28
|
consonants_n_amp = CONSONANTS + ['Ñ', '&']
|
34
29
|
all_letters = consonants_n_amp + VOWELS
|
35
|
-
date
|
36
|
-
"#{fetch_sample(all_letters, count: 3).join}#{date}#{fetch_sample(HOMOCLAVE, count: 3).join}"
|
30
|
+
[fetch_sample(all_letters, count: 3), date, fetch_sample(HOMOCLAVE, count: 3)].flatten.join
|
37
31
|
end
|
38
32
|
|
39
33
|
# http://es.wikipedia.org/wiki/Registro_Federal_de_Contribuyentes_(M%C3%A9xico)
|
@@ -47,18 +41,18 @@ module FFaker
|
|
47
41
|
def curp
|
48
42
|
all_letters = CONSONANTS + VOWELS
|
49
43
|
hm = %w[H M]
|
50
|
-
date = ::Time.at(rand * ::Time.now.to_f).strftime('%y%m%d')
|
51
44
|
[
|
52
|
-
fetch_sample(CONSONANTS),
|
53
|
-
fetch_sample(
|
54
|
-
fetch_sample(
|
55
|
-
|
56
|
-
fetch_sample(hm),
|
57
|
-
fetch_sample(ESTADOS_CURP),
|
58
|
-
fetch_sample(CONSONANTS, count: 3).join,
|
59
|
-
fetch_sample(HOMOCLAVE),
|
60
|
-
rand(0..9)
|
45
|
+
fetch_sample(CONSONANTS), fetch_sample(VOWELS),
|
46
|
+
fetch_sample(all_letters, count: 2).join, date, fetch_sample(hm),
|
47
|
+
fetch_sample(ESTADOS_CURP), fetch_sample(CONSONANTS, count: 3).join,
|
48
|
+
fetch_sample(HOMOCLAVE), rand(0..9)
|
61
49
|
].join
|
62
50
|
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def date
|
55
|
+
::Time.at(rand * ::Time.now.to_f).strftime('%y%m%d')
|
56
|
+
end
|
63
57
|
end
|
64
58
|
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module FFaker
|
6
|
+
module IdentificationPL
|
7
|
+
extend ModuleUtils
|
8
|
+
extend self
|
9
|
+
|
10
|
+
# Polish national identification number
|
11
|
+
# https://en.wikipedia.org/wiki/PESEL
|
12
|
+
def pesel
|
13
|
+
date = generate_valid_pesel_date
|
14
|
+
birthdate = pesel_birthdate(date)
|
15
|
+
serial_number = FFaker.numerify('####')
|
16
|
+
checksum = pesel_checksum(birthdate, serial_number)
|
17
|
+
"#{birthdate}#{serial_number}#{checksum}"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Polish identity card number
|
21
|
+
# https://en.wikipedia.org/wiki/Polish_identity_card
|
22
|
+
def identity_card
|
23
|
+
letter_part = FFaker.letterify('???').upcase
|
24
|
+
number_part = FFaker.numerify('#####')
|
25
|
+
checksum = identity_card_checksum(letter_part, number_part)
|
26
|
+
"#{letter_part}#{checksum}#{number_part}"
|
27
|
+
end
|
28
|
+
|
29
|
+
alias id identity_card
|
30
|
+
|
31
|
+
# Polish driver's licence number
|
32
|
+
# https://en.wikipedia.org/wiki/Driving_licence_in_Poland
|
33
|
+
def drivers_license
|
34
|
+
FFaker.numerify('#####/##/####')
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def generate_valid_pesel_date
|
40
|
+
from = Date.new(1800, 1, 1)
|
41
|
+
to = [Date.today, Date.new(2299, 12, 31)].min
|
42
|
+
fetch_sample(from..to)
|
43
|
+
end
|
44
|
+
|
45
|
+
def pesel_birthdate(date)
|
46
|
+
century_differentiator = pesel_century_differentiator(date.year)
|
47
|
+
|
48
|
+
year = date.strftime('%y')
|
49
|
+
month = century_differentiator.zero? ? date.strftime('%m') : date.month + century_differentiator
|
50
|
+
day = date.strftime('%d')
|
51
|
+
|
52
|
+
"#{year}#{month}#{day}"
|
53
|
+
end
|
54
|
+
|
55
|
+
def pesel_century_differentiator(year)
|
56
|
+
case year
|
57
|
+
when 1800..1899 then 80
|
58
|
+
when 2000..2099 then 20
|
59
|
+
when 2100..2199 then 40
|
60
|
+
when 2200..2299 then 60
|
61
|
+
else 0
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def pesel_checksum(date, serial_number)
|
66
|
+
pesel_digits = "#{date}#{serial_number}".split('').map(&:to_i)
|
67
|
+
a, b, c, d, e, f, g, h, i, j = pesel_digits
|
68
|
+
(a * 9 + b * 7 + c * 3 + d + e * 9 + f * 7 + g * 3 + h + i * 9 + j * 7) % 10
|
69
|
+
end
|
70
|
+
|
71
|
+
def identity_card_checksum(letter_part, number_part)
|
72
|
+
a, b, c = letter_part.codepoints.map { |codepoints| codepoints - 55 }
|
73
|
+
d, e, f, g, h = number_part.split('').map(&:to_i)
|
74
|
+
(a * 7 + b * 3 + c + 7 * d + 3 * e + f + 7 * g + 3 * h) % 10
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FFaker
|
4
|
+
module IdentificationTW
|
5
|
+
extend ModuleUtils
|
6
|
+
extend self
|
7
|
+
|
8
|
+
AREA_CODE = { a: 10, b: 11, c: 12, d: 13, e: 14, f: 15, g: 16, h: 17, i: 34, j: 18, k: 19, l: 20, m: 21, n: 22,
|
9
|
+
o: 35, p: 23, q: 24, r: 25, s: 26, t: 27, u: 28, v: 29, w: 32, x: 30, y: 31, z: 33 }.freeze
|
10
|
+
|
11
|
+
# Identity Card Number
|
12
|
+
# https://en.wikipedia.org/wiki/National_identification_card_(Taiwan)#Identity_card_number
|
13
|
+
def id
|
14
|
+
letter = FFaker.letterify('?')
|
15
|
+
code = AREA_CODE[letter.to_sym]
|
16
|
+
gender = fetch_sample([1, 2])
|
17
|
+
serial = FFaker.numerify('#######')
|
18
|
+
a, b, c, d, e, f, g, h, i, j = "#{code}#{gender}#{serial}".chars.map(&:to_i)
|
19
|
+
|
20
|
+
checksum = (9 * a + b + 2 * c + 3 * d + 4 * e + 5 * f + 6 * g + 7 * h + 8 * i + 9 * j) % 10
|
21
|
+
"#{letter.upcase}#{gender}#{serial}#{checksum}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/ffaker/image.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'cgi'
|
4
|
+
require 'tempfile'
|
5
|
+
require 'open-uri'
|
6
|
+
|
7
|
+
module FFaker
|
8
|
+
module Image
|
9
|
+
extend ModuleUtils
|
10
|
+
extend self
|
11
|
+
|
12
|
+
SUPPORTED_FORMATS = %w[png jpg jpeg gif].freeze
|
13
|
+
|
14
|
+
def url(size = '300x300', format = 'png', bg_color = :random, text_color = :random, text = nil)
|
15
|
+
check_size!(size)
|
16
|
+
check_format!(format)
|
17
|
+
|
18
|
+
bg_color = FFaker::Color.hex_code if bg_color == :random
|
19
|
+
text_color = FFaker::Color.hex_code if text_color == :random
|
20
|
+
text = CGI.escape(text.to_s)
|
21
|
+
|
22
|
+
"https://dummyimage.com/#{size}/#{bg_color}/#{text_color}.#{format}?text=#{text}"
|
23
|
+
end
|
24
|
+
|
25
|
+
def file(size = '300x300', format = 'png', bg_color = :random, text_color = :random, text = nil)
|
26
|
+
uri = URI.parse(url(size, format, bg_color, text_color, text))
|
27
|
+
file = Tempfile.new('ffaker_image')
|
28
|
+
file.binmode
|
29
|
+
file << uri.open.read
|
30
|
+
file.close
|
31
|
+
File.new(file.path)
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def check_size!(size)
|
37
|
+
return true if size =~ /\A\d+x\d+\z/
|
38
|
+
|
39
|
+
raise ArgumentError, 'Size should be specified in format 300x300'
|
40
|
+
end
|
41
|
+
|
42
|
+
def check_format!(format)
|
43
|
+
return true if SUPPORTED_FORMATS.include?(format)
|
44
|
+
|
45
|
+
raise ArgumentError, "Supported formats are #{SUPPORTED_FORMATS.join(', ')}"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/ffaker/internet.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
4
|
module Internet
|
5
5
|
extend ModuleUtils
|
6
6
|
extend self
|
7
7
|
|
8
|
-
BYTE =
|
8
|
+
BYTE = Array('0'..'255').freeze
|
9
9
|
HOSTS = %w[gmail.com yahoo.com hotmail.com].freeze
|
10
|
-
DISPOSABLE_HOSTS = %w[
|
10
|
+
DISPOSABLE_HOSTS = %w[
|
11
|
+
mailinator.com suremail.info spamherelots.com binkmail.com safetymail.info
|
12
|
+
].freeze
|
11
13
|
DOMAIN_SUFFIXES = %w[co.uk com us ca biz info name].freeze
|
12
14
|
SAFE_DOMAIN_SUFFIXES = %w[org com net].freeze
|
13
15
|
SLUG_DELIMITERS = %w[- _ .].freeze
|
@@ -18,42 +20,34 @@ module FFaker
|
|
18
20
|
end
|
19
21
|
|
20
22
|
# returns an email address of an online disposable email service (like tempinbox.com).
|
21
|
-
# you can really send an email to these addresses an access it by going to the
|
23
|
+
# you can really send an email to these addresses an access it by going to the
|
24
|
+
# service web pages.
|
22
25
|
def disposable_email(name = nil)
|
23
26
|
[user_name(name), fetch_sample(DISPOSABLE_HOSTS)].join('@')
|
24
27
|
end
|
25
28
|
|
26
29
|
def free_email(name = nil)
|
27
|
-
|
30
|
+
[user_name(name), fetch_sample(HOSTS)].join('@')
|
28
31
|
end
|
29
32
|
|
30
33
|
def safe_email(name = nil)
|
31
|
-
|
34
|
+
[user_name(name), fetch_sample(SAFE_DOMAIN_SUFFIXES)].join('@example.')
|
32
35
|
end
|
33
36
|
|
34
37
|
def user_name(name = nil)
|
35
|
-
if name
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
when 0
|
41
|
-
sanitize(Name.first_name)
|
42
|
-
when 1
|
43
|
-
[Name.first_name, Name.last_name].map { |n| sanitize(n) }.join(fetch_sample(%w[. _]))
|
44
|
-
end
|
45
|
-
end
|
38
|
+
return shuffle(name.split(' ')).join(fetch_sample(%w[. _])).downcase if name
|
39
|
+
|
40
|
+
return sanitize(Name.first_name) if rand(0..1).zero?
|
41
|
+
|
42
|
+
[sanitize(Name.first_name), sanitize(Name.last_name)].join(fetch_sample(%w[. _]))
|
46
43
|
end
|
47
44
|
|
48
45
|
def domain_name
|
49
|
-
|
46
|
+
[domain_word, domain_suffix].join('.')
|
50
47
|
end
|
51
48
|
|
52
49
|
def domain_word
|
53
|
-
|
54
|
-
dw.gsub!(/\W/, '')
|
55
|
-
dw.downcase!
|
56
|
-
dw
|
50
|
+
sanitize(Company.name.split(' ').first)
|
57
51
|
end
|
58
52
|
|
59
53
|
def domain_suffix
|
@@ -61,7 +55,7 @@ module FFaker
|
|
61
55
|
end
|
62
56
|
|
63
57
|
def uri(protocol)
|
64
|
-
|
58
|
+
[protocol, domain_name].join('://')
|
65
59
|
end
|
66
60
|
|
67
61
|
def http_url
|
@@ -79,9 +73,8 @@ module FFaker
|
|
79
73
|
end
|
80
74
|
|
81
75
|
def password(min_length = 8, max_length = 16)
|
82
|
-
length =
|
83
|
-
|
84
|
-
String.from_regexp(/[a-z]{#{length}}/)
|
76
|
+
length = min_length > max_length ? min_length : fetch_sample(min_length..max_length)
|
77
|
+
String.from_regexp(/\w{#{length}}/)
|
85
78
|
end
|
86
79
|
|
87
80
|
def mac(delimiter = ':')
|
data/lib/ffaker/internet_se.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
require 'ffaker/internet'
|
1
|
+
# frozen_string_literal: true
|
4
2
|
|
5
3
|
module FFaker
|
6
4
|
module InternetSE
|
@@ -9,14 +7,16 @@ module FFaker
|
|
9
7
|
extend ModuleUtils
|
10
8
|
extend self
|
11
9
|
|
12
|
-
BYTE =
|
10
|
+
BYTE = Array('0'..'255').freeze
|
13
11
|
HOSTS = %w[gmail.com yahoo.com hotmail.com spray.se passagen.se].freeze
|
14
12
|
DOMAIN_SUFFIXES = %w[se nu com].freeze
|
15
|
-
DISPOSABLE_HOSTS = %w[
|
13
|
+
DISPOSABLE_HOSTS = %w[
|
14
|
+
mailinator.com suremail.info spamherelots.com binkmail.com safetymail.info
|
15
|
+
].freeze
|
16
16
|
SLUG_DELIMITERS = %w[- _ .].freeze
|
17
17
|
|
18
18
|
def email(name = nil)
|
19
|
-
"#{user_name(name)}@#{domain_name}"
|
19
|
+
+"#{user_name(name)}@#{domain_name}"
|
20
20
|
end
|
21
21
|
|
22
22
|
# Returns an email address of an online disposable email service
|
@@ -38,14 +38,12 @@ module FFaker
|
|
38
38
|
# Mostly used for email creation
|
39
39
|
def user_name(name = nil)
|
40
40
|
return user_name_from_name(name) if name
|
41
|
+
|
41
42
|
user_name_random
|
42
43
|
end
|
43
44
|
|
44
45
|
def user_name_random
|
45
|
-
|
46
|
-
when 0 then user_name_variant_short
|
47
|
-
when 1 then user_name_variant_long
|
48
|
-
end
|
46
|
+
rand(0..1).zero? ? user_name_variant_short : user_name_variant_long
|
49
47
|
end
|
50
48
|
|
51
49
|
def user_name_variant_long
|
data/lib/ffaker/job.rb
CHANGED
data/lib/ffaker/job_br.rb
CHANGED