ffaker 2.11.0 → 2.12.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 +14 -0
- data/Gemfile +2 -0
- data/REFERENCE.md +47 -0
- data/Rakefile +2 -0
- data/ffaker.gemspec +5 -3
- data/lib/ffaker.rb +14 -9
- data/lib/ffaker/address.rb +3 -3
- data/lib/ffaker/address_au.rb +7 -9
- data/lib/ffaker/address_br.rb +1 -1
- data/lib/ffaker/address_ca.rb +2 -2
- data/lib/ffaker/address_ch.rb +1 -1
- data/lib/ffaker/address_ch_de.rb +1 -1
- data/lib/ffaker/address_ch_fr.rb +1 -1
- data/lib/ffaker/address_ch_it.rb +1 -1
- data/lib/ffaker/address_da.rb +1 -1
- data/lib/ffaker/address_de.rb +1 -1
- data/lib/ffaker/address_fi.rb +1 -1
- data/lib/ffaker/address_fr.rb +1 -1
- data/lib/ffaker/address_gr.rb +1 -1
- data/lib/ffaker/address_id.rb +0 -1
- data/lib/ffaker/address_in.rb +2 -2
- data/lib/ffaker/address_ja.rb +0 -1
- data/lib/ffaker/address_kr.rb +0 -1
- data/lib/ffaker/address_mx.rb +7 -469
- data/lib/ffaker/address_nl.rb +1 -1
- data/lib/ffaker/address_pl.rb +0 -2
- data/lib/ffaker/address_ru.rb +1 -1
- data/lib/ffaker/address_se.rb +1 -1
- data/lib/ffaker/address_sn.rb +1 -2
- data/lib/ffaker/address_ua.rb +2 -2
- data/lib/ffaker/address_uk.rb +1 -1
- data/lib/ffaker/address_us.rb +1 -1
- data/lib/ffaker/airline.rb +1 -1
- data/lib/ffaker/animal_pl.rb +0 -2
- data/lib/ffaker/animals.rb +1 -1
- data/lib/ffaker/animals_cn.rb +0 -1
- data/lib/ffaker/animals_us.rb +0 -1
- data/lib/ffaker/avatar.rb +23 -5
- data/lib/ffaker/aws.rb +1 -1
- data/lib/ffaker/bacon_ipsum.rb +1 -1
- data/lib/ffaker/bank.rb +106 -0
- data/lib/ffaker/book.rb +1 -1
- data/lib/ffaker/boolean.rb +1 -1
- data/lib/ffaker/cheesy_lingo.rb +3 -6
- data/lib/ffaker/code.rb +0 -1
- data/lib/ffaker/color.rb +7 -7
- data/lib/ffaker/color_ua.rb +1 -1
- data/lib/ffaker/company.rb +1 -1
- data/lib/ffaker/company_cn.rb +1 -1
- data/lib/ffaker/company_it.rb +4 -2
- data/lib/ffaker/company_se.rb +1 -1
- data/lib/ffaker/conference.rb +1 -1
- data/lib/ffaker/courses.rb +1 -1
- 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_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_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_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 -1
- data/lib/ffaker/data/address_us/state_and_territories_abbr +1 -1
- data/lib/ffaker/data/animal_cn/common_names +1 -1
- 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/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/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 +1 -1
- data/lib/ffaker/data/education_cn/major +1 -1
- data/lib/ffaker/data/education_cn/province +1 -1
- data/lib/ffaker/data/education_cn/school_type +1 -1
- 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/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/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 -1
- data/lib/ffaker/data/lorem_ar/words +1 -1
- data/lib/ffaker/data/lorem_cn/words +1 -1
- data/lib/ffaker/data/lorem_fr/words +1 -1
- data/lib/ffaker/data/movie/adj_and_adv +1 -1
- data/lib/ffaker/data/movie/nouns +1 -1
- data/lib/ffaker/data/movie/prefixes +1 -1
- 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 +1 -1
- 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_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_male +0 -1
- 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/nato_alphabet/alphabet_codes +26 -0
- data/lib/ffaker/data/nato_alphabet/numeric_codes +10 -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/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/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 -1
- data/lib/ffaker/education.rb +5 -2
- data/lib/ffaker/education_cn.rb +1 -2
- data/lib/ffaker/filesystem.rb +1 -1
- data/lib/ffaker/food.rb +2 -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_ja.rb +18 -0
- data/lib/ffaker/gender_jp.rb +2 -12
- data/lib/ffaker/gender_kr.rb +1 -1
- data/lib/ffaker/gender_pl.rb +0 -2
- data/lib/ffaker/geolocation.rb +32 -22
- data/lib/ffaker/guid.rb +1 -1
- data/lib/ffaker/healthcare_ipsum.rb +1 -1
- data/lib/ffaker/healthcare_ru.rb +0 -1
- data/lib/ffaker/hipster_ipsum.rb +1 -1
- data/lib/ffaker/html_ipsum.rb +3 -3
- 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 -3
- data/lib/ffaker/identification_es_co.rb +2 -2
- data/lib/ffaker/identification_kr.rb +1 -1
- data/lib/ffaker/identification_mx.rb +13 -17
- data/lib/ffaker/image.rb +2 -0
- data/lib/ffaker/internet.rb +17 -22
- data/lib/ffaker/internet_se.rb +7 -7
- 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_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_cn.rb +1 -1
- data/lib/ffaker/lorem_fr.rb +1 -1
- data/lib/ffaker/lorem_ie.rb +0 -1
- data/lib/ffaker/lorem_ja.rb +1 -1
- data/lib/ffaker/lorem_kr.rb +1 -1
- data/lib/ffaker/lorem_pl.rb +0 -2
- 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 -7
- data/lib/ffaker/name_da.rb +2 -2
- data/lib/ffaker/name_de.rb +1 -1
- data/lib/ffaker/name_es.rb +0 -2
- 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 +1 -1
- 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 +2 -2
- data/lib/ffaker/name_nb.rb +1 -1
- data/lib/ffaker/name_nl.rb +1 -1
- data/lib/ffaker/name_ph.rb +1 -1
- data/lib/ffaker/name_pl.rb +1 -2
- data/lib/ffaker/name_ru.rb +1 -1
- data/lib/ffaker/name_se.rb +1 -1
- data/lib/ffaker/name_sn.rb +3 -6
- data/lib/ffaker/name_th.rb +1 -1
- data/lib/ffaker/name_th_en.rb +1 -1
- data/lib/ffaker/name_tw.rb +0 -1
- data/lib/ffaker/name_ua.rb +1 -1
- data/lib/ffaker/name_vn.rb +1 -1
- data/lib/ffaker/nato_alphabet.rb +2 -4
- data/lib/ffaker/phone_number.rb +1 -1
- data/lib/ffaker/phone_number_au.rb +11 -12
- data/lib/ffaker/phone_number_br.rb +6 -13
- 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 -2
- data/lib/ffaker/phone_number_de.rb +1 -2
- 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 +1 -1
- 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 +3 -4
- 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 +3 -10
- data/lib/ffaker/phone_number_ua.rb +42 -0
- data/lib/ffaker/product.rb +9 -11
- data/lib/ffaker/sem_ver.rb +19 -0
- data/lib/ffaker/skill.rb +1 -1
- data/lib/ffaker/sport.rb +2 -0
- data/lib/ffaker/sport_us.rb +2 -0
- data/lib/ffaker/ssn.rb +1 -1
- data/lib/ffaker/ssn_mx.rb +1 -2
- data/lib/ffaker/ssn_se.rb +16 -25
- data/lib/ffaker/string.rb +6 -5
- data/lib/ffaker/time.rb +9 -8
- data/lib/ffaker/tweet.rb +4 -4
- data/lib/ffaker/unit.rb +1 -1
- data/lib/ffaker/unit_english.rb +1 -1
- data/lib/ffaker/unit_metric.rb +1 -1
- data/lib/ffaker/utils/array_utils.rb +7 -4
- data/lib/ffaker/utils/module_utils.rb +2 -0
- data/lib/ffaker/utils/random_utils.rb +2 -0
- data/lib/ffaker/vehicle.rb +6 -5
- data/lib/ffaker/venue.rb +1 -1
- data/lib/ffaker/youtube.rb +1 -1
- data/scripts/benchmark.rb +2 -0
- data/scripts/profiling.rb +2 -0
- data/scripts/reference.rb +5 -2
- data/test/helper.rb +2 -0
- data/test/test_address.rb +1 -1
- data/test/test_address_au.rb +4 -5
- data/test/test_address_br.rb +1 -1
- data/test/test_address_ca.rb +1 -1
- data/test/test_address_ch.rb +1 -1
- data/test/test_address_ch_de.rb +1 -1
- data/test/test_address_ch_fr.rb +1 -1
- data/test/test_address_ch_it.rb +1 -1
- data/test/test_address_da.rb +1 -1
- data/test/test_address_de.rb +1 -1
- data/test/test_address_fi.rb +3 -4
- data/test/test_address_fr.rb +1 -2
- data/test/test_address_gr.rb +1 -1
- data/test/test_address_id.rb +0 -1
- data/test/test_address_in.rb +1 -1
- data/test/test_address_ja.rb +0 -1
- data/test/test_address_kr.rb +0 -1
- data/test/test_address_mx.rb +1 -2
- data/test/test_address_nl.rb +1 -1
- data/test/test_address_pl.rb +0 -1
- data/test/test_address_ru.rb +1 -1
- data/test/test_address_se.rb +3 -3
- data/test/test_address_sn.rb +1 -4
- data/test/test_address_ua.rb +1 -1
- data/test/test_address_uk.rb +1 -1
- data/test/test_address_us.rb +1 -1
- data/test/test_airline.rb +1 -1
- data/test/test_animal.rb +1 -1
- data/test/test_animal_cn.rb +0 -1
- data/test/test_animal_pl.rb +0 -1
- data/test/test_animal_us.rb +0 -1
- data/test/test_array_utils.rb +2 -2
- data/test/test_avatar.rb +4 -2
- data/test/test_aws.rb +1 -1
- data/test/test_bacon_ipsum.rb +1 -1
- data/test/test_bank.rb +18 -0
- data/test/test_book.rb +1 -1
- data/test/test_boolean.rb +2 -2
- data/test/test_cheesy_lingo.rb +4 -2
- data/test/test_code.rb +0 -1
- data/test/test_color.rb +4 -4
- data/test/test_color_ua.rb +1 -1
- data/test/test_company.rb +3 -3
- data/test/test_company_cn.rb +1 -1
- data/test/test_company_it.rb +1 -1
- data/test/test_company_se.rb +1 -1
- data/test/test_conference.rb +1 -1
- data/test/test_course_mathematiques.rb +2 -0
- data/test/test_course_philosophie.rb +2 -0
- data/test/test_currency.rb +1 -1
- data/test/test_dizzle_ipsum.rb +1 -1
- data/test/test_education.rb +1 -1
- data/test/test_education_cn.rb +0 -1
- data/test/test_faker.rb +1 -1
- data/test/test_filesystem.rb +3 -3
- data/test/test_food.rb +2 -2
- data/test/test_gender.rb +1 -1
- data/test/test_gender_br.rb +1 -1
- data/test/test_gender_cn.rb +1 -1
- data/test/test_gender_id.rb +0 -1
- data/test/test_gender_ja.rb +27 -0
- data/test/test_gender_jp.rb +1 -2
- data/test/test_gender_kr.rb +1 -1
- data/test/test_gender_pl.rb +1 -2
- data/test/test_geolocation.rb +1 -1
- data/test/test_guid.rb +1 -1
- data/test/test_healthcare_ipsum.rb +2 -0
- data/test/test_healthcare_ru.rb +1 -2
- data/test/test_hipster_ipsum.rb +2 -2
- data/test/test_html_ipsum.rb +13 -13
- data/test/test_identification.rb +2 -2
- data/test/test_identification_br.rb +1 -1
- data/test/test_identification_co.rb +2 -0
- data/test/test_identification_es.rb +1 -1
- data/test/test_identification_es_cl.rb +1 -1
- data/test/test_identification_es_mx.rb +1 -2
- data/test/test_identification_kr.rb +1 -1
- data/test/test_internet.rb +5 -5
- data/test/test_internet_se.rb +5 -5
- data/test/test_job.rb +1 -1
- data/test/test_job_br.rb +1 -1
- data/test/test_job_cn.rb +1 -1
- data/test/test_job_fr.rb +1 -1
- data/test/test_job_ja.rb +1 -1
- data/test/test_job_kr.rb +1 -1
- data/test/test_job_vn.rb +0 -1
- data/test/test_locale.rb +1 -1
- data/test/test_lorem.rb +1 -1
- data/test/test_lorem_ar.rb +2 -3
- data/test/test_lorem_cn.rb +1 -1
- data/test/test_lorem_fr.rb +5 -5
- data/test/test_lorem_ie.rb +2 -3
- data/test/test_lorem_ja.rb +1 -1
- data/test/test_lorem_kr.rb +4 -4
- 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 +1 -1
- data/test/test_movie.rb +1 -1
- data/test/test_music.rb +2 -2
- data/test/test_name.rb +6 -2
- data/test/test_name_ar.rb +0 -1
- data/test/test_name_br.rb +1 -1
- data/test/test_name_cn.rb +1 -1
- data/test/test_name_cs.rb +2 -3
- data/test/test_name_da.rb +2 -2
- data/test/test_name_de.rb +1 -1
- data/test/test_name_es.rb +0 -1
- data/test/test_name_fr.rb +1 -2
- data/test/test_name_ga.rb +1 -1
- data/test/test_name_gr.rb +1 -1
- data/test/test_name_id.rb +0 -1
- data/test/test_name_it.rb +1 -2
- data/test/test_name_ja.rb +1 -1
- data/test/test_name_kh.rb +9 -7
- data/test/test_name_kr.rb +1 -1
- data/test/test_name_mx.rb +1 -2
- data/test/test_name_nb.rb +1 -1
- data/test/test_name_nl.rb +1 -1
- data/test/test_name_ph.rb +2 -2
- data/test/test_name_pl.rb +0 -1
- data/test/test_name_ru.rb +4 -4
- data/test/test_name_se.rb +1 -1
- data/test/test_name_sn.rb +1 -2
- data/test/test_name_th.rb +1 -1
- data/test/test_name_th_en.rb +1 -1
- data/test/test_name_tw.rb +0 -1
- data/test/test_name_ua.rb +3 -3
- data/test/test_name_vn.rb +1 -1
- data/test/test_nato_alphabet.rb +1 -1
- data/test/test_phone_number.rb +1 -1
- data/test/test_phone_number_au.rb +4 -5
- data/test/test_phone_number_br.rb +2 -4
- data/test/test_phone_number_cu.rb +4 -11
- data/test/test_phone_number_da.rb +1 -2
- data/test/test_phone_number_de.rb +1 -2
- data/test/test_phone_number_fr.rb +0 -1
- data/test/test_phone_number_id.rb +0 -1
- data/test/test_phone_number_kr.rb +1 -1
- data/test/test_phone_number_mx.rb +1 -2
- data/test/test_phone_number_nl.rb +1 -2
- data/test/test_phone_number_pl.rb +1 -1
- data/test/test_phone_number_ru.rb +76 -0
- data/test/test_phone_number_se.rb +2 -2
- data/test/test_phone_number_sg.rb +1 -1
- data/test/test_phone_number_sn.rb +3 -4
- data/test/test_phone_number_tw.rb +0 -1
- data/test/test_phone_number_ua.rb +38 -0
- data/test/test_products.rb +1 -1
- data/test/test_sem_ver.rb +18 -0
- data/test/test_skill.rb +1 -1
- data/test/test_sport_us.rb +0 -1
- data/test/test_sports.rb +1 -1
- data/test/test_ssn.rb +1 -1
- data/test/test_ssn_mx.rb +1 -2
- data/test/test_ssn_se.rb +4 -4
- data/test/test_string.rb +4 -4
- data/test/test_time.rb +1 -1
- data/test/test_tweet.rb +1 -1
- data/test/test_unique_utils.rb +1 -1
- data/test/test_units.rb +1 -2
- data/test/test_units_english.rb +1 -2
- data/test/test_units_metric.rb +1 -2
- data/test/test_vehicle.rb +1 -1
- data/test/test_venue.rb +1 -1
- data/test/test_youtube.rb +1 -1
- metadata +63 -5
data/lib/ffaker/ssn_mx.rb
CHANGED
data/lib/ffaker/ssn_se.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'date'
|
4
4
|
|
@@ -26,8 +26,8 @@ module FFaker
|
|
26
26
|
GENDERS = %w[female male].freeze
|
27
27
|
|
28
28
|
def ssn(opts = {})
|
29
|
-
from = opts[:from]
|
30
|
-
to = opts[:to]
|
29
|
+
from = opts[:from] || ::Time.local(1940, 1, 1)
|
30
|
+
to = opts[:to] || ::Time.now
|
31
31
|
gender = (opts[:gender] || fetch_sample(GENDERS)).to_s
|
32
32
|
|
33
33
|
raise_error_on_bad_arguments(from, to, gender)
|
@@ -39,11 +39,11 @@ module FFaker
|
|
39
39
|
|
40
40
|
def generate_ssn(from, to, gender)
|
41
41
|
birth_date = random_birth_time_between(from, to)
|
42
|
-
birth_date_str = birth_date.strftime('%Y%m%d')
|
43
|
-
region =
|
44
|
-
ssn_without_check_digit = birth_date_str + region
|
45
|
-
check_digit = luhn_check(ssn_without_check_digit)
|
46
|
-
ssn_without_check_digit + check_digit
|
42
|
+
birth_date_str = birth_date.strftime('%Y%m%d') # "19800228"
|
43
|
+
region = random_region_for(gender) # "413"
|
44
|
+
ssn_without_check_digit = birth_date_str + region # "19800228413"
|
45
|
+
check_digit = luhn_check(ssn_without_check_digit) # "9"
|
46
|
+
ssn_without_check_digit + check_digit # "198002284139"
|
47
47
|
end
|
48
48
|
|
49
49
|
def raise_error_on_bad_arguments(from, to, gender)
|
@@ -57,19 +57,19 @@ module FFaker
|
|
57
57
|
::Time.at(from + rand * (to.to_f - from.to_f))
|
58
58
|
end
|
59
59
|
|
60
|
-
def
|
60
|
+
def random_region_for(gender)
|
61
61
|
region_number = case gender
|
62
|
-
when 'female' then
|
63
|
-
when 'male' then
|
64
|
-
|
62
|
+
when 'female' then random_region_even
|
63
|
+
when 'male' then random_region_odd
|
64
|
+
end
|
65
65
|
three_character_string(region_number)
|
66
66
|
end
|
67
67
|
|
68
|
-
def
|
68
|
+
def random_region_even
|
69
69
|
rand(0..498) * 2
|
70
70
|
end
|
71
71
|
|
72
|
-
def
|
72
|
+
def random_region_odd
|
73
73
|
rand(0..498) * 2 + 1
|
74
74
|
end
|
75
75
|
|
@@ -82,11 +82,7 @@ module FFaker
|
|
82
82
|
multiplications = []
|
83
83
|
|
84
84
|
number.split(//).each_with_index do |digit, i|
|
85
|
-
multiplications <<
|
86
|
-
digit.to_i * 2
|
87
|
-
else
|
88
|
-
digit.to_i
|
89
|
-
end
|
85
|
+
multiplications << i.even? ? digit.to_i * 2 : digit.to_i
|
90
86
|
end
|
91
87
|
|
92
88
|
sum = 0
|
@@ -96,12 +92,7 @@ module FFaker
|
|
96
92
|
end
|
97
93
|
end
|
98
94
|
|
99
|
-
control_digit =
|
100
|
-
0
|
101
|
-
else
|
102
|
-
(sum / 10 + 1) * 10 - sum
|
103
|
-
end
|
104
|
-
|
95
|
+
control_digit = (sum % 10).zero? ? 0 : (sum / 10 + 1) * 10 - sum
|
105
96
|
control_digit.to_s
|
106
97
|
end
|
107
98
|
end
|
data/lib/ffaker/string.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
4
|
module String
|
5
5
|
extend ModuleUtils
|
6
6
|
extend self
|
7
7
|
|
8
|
-
BACKSLASH = '\\'
|
9
|
-
DASH = '-'
|
8
|
+
BACKSLASH = '\\'
|
9
|
+
DASH = '-'
|
10
10
|
|
11
11
|
LOWERS = [*'a'..'z'].freeze
|
12
12
|
UPPERS = [*'A'..'Z'].freeze
|
@@ -17,7 +17,7 @@ module FFaker
|
|
17
17
|
ESCAPEABLE_CHARS = ['\\', '/', '.', '(', ')', '[', ']', '{', '}'].freeze
|
18
18
|
|
19
19
|
def from_regexp(exp)
|
20
|
-
result = ''
|
20
|
+
result = +''
|
21
21
|
@last_token = nil
|
22
22
|
|
23
23
|
# Drop surrounding /'s and split into characters
|
@@ -59,9 +59,10 @@ module FFaker
|
|
59
59
|
when '*' then
|
60
60
|
tokens.unshift(token) if rand(0..1) == 1 # Leave the `*` on to run again
|
61
61
|
return '' if rand(0..1) == 1 # Or maybe do nothing
|
62
|
+
|
62
63
|
process_token(@last_token) # Else run the last one again
|
63
64
|
when '{' then
|
64
|
-
number = ''
|
65
|
+
number = +''
|
65
66
|
while (ch = tokens.shift) != '}'
|
66
67
|
number << ch
|
67
68
|
end
|
data/lib/ffaker/time.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'date'
|
4
4
|
|
@@ -7,7 +7,9 @@ module FFaker
|
|
7
7
|
extend ModuleUtils
|
8
8
|
extend self
|
9
9
|
|
10
|
-
MONTHS = %w[
|
10
|
+
MONTHS = %w[
|
11
|
+
January February March April May June July August September October November December
|
12
|
+
].freeze
|
11
13
|
DAYS_OF_WEEK = %w[Monday Tuesday Wednesday Thursday Friday Saturday Sunday].freeze
|
12
14
|
|
13
15
|
def month
|
@@ -27,13 +29,12 @@ module FFaker
|
|
27
29
|
hours = params[:hours] || rand(0..23)
|
28
30
|
minutes = params[:minutes] || rand(0..59)
|
29
31
|
series = [date = ::DateTime.new(year, month, day, hours, minutes)]
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
return series
|
32
|
+
return date unless params[:series]
|
33
|
+
|
34
|
+
params[:series].each do |some_time_after|
|
35
|
+
series << series.last + (rand * some_time_after).ceil
|
35
36
|
end
|
36
|
-
|
37
|
+
series
|
37
38
|
end
|
38
39
|
|
39
40
|
def date(params = {})
|
data/lib/ffaker/tweet.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
4
|
module Tweet
|
@@ -12,14 +12,14 @@ module FFaker
|
|
12
12
|
# body_length: Target length (rand(20..140)) (will be <= target)
|
13
13
|
def tweet(args = {})
|
14
14
|
options = {
|
15
|
-
num_hashtags: [0, rand(
|
16
|
-
num_mentions: [0, rand(
|
15
|
+
num_hashtags: [0, rand(-5..4)].max,
|
16
|
+
num_mentions: [0, rand(-7..2)].max,
|
17
17
|
reply: (rand(1..10) == 1),
|
18
18
|
body_length: rand(20..140)
|
19
19
|
}.merge(args)
|
20
20
|
|
21
21
|
my_reply = options[:reply] ? "#{mention} " : ''
|
22
|
-
my_mentions = options[:num_mentions]
|
22
|
+
my_mentions = (options[:num_mentions]).positive? ? "#{mentions(options[:num_mentions])} " : ''
|
23
23
|
my_tags = tags(options[:num_hashtags])
|
24
24
|
|
25
25
|
remaining = [
|
data/lib/ffaker/unit.rb
CHANGED
data/lib/ffaker/unit_english.rb
CHANGED
data/lib/ffaker/unit_metric.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'ffaker/utils/random_utils'
|
4
|
+
|
2
5
|
module FFaker
|
3
6
|
module ArrayUtils
|
4
7
|
extend RandomUtils
|
@@ -9,9 +12,9 @@ module FFaker
|
|
9
12
|
freeze_all(array)
|
10
13
|
end
|
11
14
|
|
12
|
-
def self.random_pick(array,
|
15
|
+
def self.random_pick(array, num)
|
13
16
|
warn '[ArrayUtils.random_pick] is deprecated. Please use the ModuleUtils#fetch_sample method'
|
14
|
-
fetch_sample(array, count:
|
17
|
+
fetch_sample(array, count: num)
|
15
18
|
end
|
16
19
|
|
17
20
|
def self.rand(array)
|
@@ -29,9 +32,9 @@ module FFaker
|
|
29
32
|
array.sort_by { FFaker::Random.rand }
|
30
33
|
end
|
31
34
|
|
32
|
-
def random_pick(
|
35
|
+
def random_pick(num)
|
33
36
|
warn '[ArrayUtils#random_pick] is deprecated. Please use the ModuleUtils#fetch_sample method'
|
34
|
-
ArrayUtils.random_pick(self,
|
37
|
+
ArrayUtils.random_pick(self, num)
|
35
38
|
end
|
36
39
|
|
37
40
|
def rand
|
data/lib/ffaker/vehicle.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FFaker
|
4
4
|
module Vehicle
|
@@ -8,8 +8,9 @@ module FFaker
|
|
8
8
|
DRIVETRAINS = %w[4WD 4X4 AWD FWD RWD].freeze
|
9
9
|
YEARS = [*'1900'..(Date.today.year + 1).to_s].freeze
|
10
10
|
COLOR_PREFIXES = k(%w[
|
11
|
-
beautiful bright calm dangerous dark dull fast magnetic magnificent
|
12
|
-
mundane mute mysterious new pleasant pretty
|
11
|
+
beautiful bright calm dangerous dark dull fast magnetic magnificent
|
12
|
+
majestic melodic metallic mundane mute mysterious new pleasant pretty
|
13
|
+
resonant royal slate soft tranquil vibrant weak
|
13
14
|
])
|
14
15
|
TRANSMISSIONS_ABBR = %w[AT MT AM CVT].freeze
|
15
16
|
CYLINDERS = %w[2 5 6 8].freeze
|
@@ -26,9 +27,9 @@ module FFaker
|
|
26
27
|
fetch_sample(MAKES_LIST)
|
27
28
|
end
|
28
29
|
|
29
|
-
def manufacturer_color(
|
30
|
+
def manufacturer_color(count = 2)
|
30
31
|
# Take two prefixes because it's more fun than one
|
31
|
-
(fetch_sample(COLOR_PREFIXES, count:
|
32
|
+
(fetch_sample(COLOR_PREFIXES, count: count) + [base_color]).join(' ')
|
32
33
|
end
|
33
34
|
alias mfg_color manufacturer_color
|
34
35
|
|
data/lib/ffaker/venue.rb
CHANGED
data/lib/ffaker/youtube.rb
CHANGED
data/scripts/benchmark.rb
CHANGED
data/scripts/profiling.rb
CHANGED
data/scripts/reference.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
$LOAD_PATH << File.dirname(__FILE__) + '/../lib'
|
2
4
|
require 'ffaker'
|
3
5
|
|
@@ -15,6 +17,7 @@ def faker_modules
|
|
15
17
|
next if mod == FFaker::ModuleUtils
|
16
18
|
next if mod == FFaker::RandomUtils
|
17
19
|
next if mod == FFaker::Random
|
20
|
+
|
18
21
|
mod
|
19
22
|
end.compact
|
20
23
|
end
|
@@ -59,7 +62,7 @@ sections = faker_modules.map do |mod|
|
|
59
62
|
left = "`#{meth}`"
|
60
63
|
right = ''
|
61
64
|
|
62
|
-
if arity
|
65
|
+
if arity.positive?
|
63
66
|
left = "`#{meth}`(#{Array.new(arity) { '...' }.join(', ')})"
|
64
67
|
else
|
65
68
|
begin
|
@@ -71,7 +74,7 @@ sections = faker_modules.map do |mod|
|
|
71
74
|
else
|
72
75
|
(escape examples.join(', ')).to_s
|
73
76
|
end
|
74
|
-
rescue => e
|
77
|
+
rescue StandardError => e
|
75
78
|
right = "#{ICONS[:error]} #{e.class}: #{e.message}"
|
76
79
|
end
|
77
80
|
end
|
data/test/helper.rb
CHANGED
data/test/test_address.rb
CHANGED
data/test/test_address_au.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'helper'
|
4
4
|
|
5
|
-
# Author: wiseleyb<wiseleyb@gmail.com>
|
6
5
|
class TestAddressAU < Test::Unit::TestCase
|
7
6
|
include DeterministicHelper
|
8
7
|
|
@@ -12,9 +11,9 @@ class TestAddressAU < Test::Unit::TestCase
|
|
12
11
|
)
|
13
12
|
|
14
13
|
def test_au_state_abbr_insertion
|
15
|
-
|
16
|
-
assert
|
17
|
-
assert
|
14
|
+
FFaker::AddressAU::STATE_ABBR.sort
|
15
|
+
assert FFaker::AddressAU::SUBURB.keys.sort
|
16
|
+
assert FFaker::AddressAU::POSTCODE.keys.sort
|
18
17
|
end
|
19
18
|
|
20
19
|
def test_au_state
|
data/test/test_address_br.rb
CHANGED
data/test/test_address_ca.rb
CHANGED
data/test/test_address_ch.rb
CHANGED
data/test/test_address_ch_de.rb
CHANGED
data/test/test_address_ch_fr.rb
CHANGED
data/test/test_address_ch_it.rb
CHANGED
data/test/test_address_da.rb
CHANGED
data/test/test_address_de.rb
CHANGED
data/test/test_address_fi.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'helper'
|
4
4
|
|
5
|
-
# Test features related to Finnish addresses
|
6
5
|
class TestAddressFI < Test::Unit::TestCase
|
7
6
|
include DeterministicHelper
|
8
7
|
|
9
|
-
ALPHA = /\A[\p{Alpha}]
|
10
|
-
DIGIT = /\d{1}
|
8
|
+
ALPHA = /\A[\p{Alpha}]+/.freeze
|
9
|
+
DIGIT = /\d{1}/.freeze
|
11
10
|
|
12
11
|
assert_methods_are_deterministic(
|
13
12
|
FFaker::AddressFI,
|