ffakerTW 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Changelog.md +7 -0
- data/Gemfile +8 -0
- data/LICENSE +17 -0
- data/RANDOM.md +153 -0
- data/README.md +31 -0
- data/REFERENCE.md +2709 -0
- data/Rakefile +152 -0
- data/ffakerTW.gemspec +65 -0
- data/lib/ffakerTW/address.rb +115 -0
- data/lib/ffakerTW/address_au.rb +120 -0
- data/lib/ffakerTW/address_br.rb +57 -0
- data/lib/ffakerTW/address_ca.rb +32 -0
- data/lib/ffakerTW/address_ch.rb +18 -0
- data/lib/ffakerTW/address_ch_de.rb +14 -0
- data/lib/ffakerTW/address_ch_fr.rb +14 -0
- data/lib/ffakerTW/address_ch_it.rb +14 -0
- data/lib/ffakerTW/address_da.rb +49 -0
- data/lib/ffakerTW/address_de.rb +42 -0
- data/lib/ffakerTW/address_fi.rb +44 -0
- data/lib/ffakerTW/address_fr.rb +40 -0
- data/lib/ffakerTW/address_gr.rb +38 -0
- data/lib/ffakerTW/address_id.rb +36 -0
- data/lib/ffakerTW/address_in.rb +56 -0
- data/lib/ffakerTW/address_it.rb +36 -0
- data/lib/ffakerTW/address_ja.rb +83 -0
- data/lib/ffakerTW/address_kr.rb +87 -0
- data/lib/ffakerTW/address_mx.rb +31 -0
- data/lib/ffakerTW/address_nl.rb +43 -0
- data/lib/ffakerTW/address_pl.rb +83 -0
- data/lib/ffakerTW/address_ru.rb +37 -0
- data/lib/ffakerTW/address_se.rb +44 -0
- data/lib/ffakerTW/address_sn.rb +22 -0
- data/lib/ffakerTW/address_ua.rb +56 -0
- data/lib/ffakerTW/address_uk.rb +25 -0
- data/lib/ffakerTW/address_us.rb +58 -0
- data/lib/ffakerTW/airline.rb +16 -0
- data/lib/ffakerTW/animal.rb +14 -0
- data/lib/ffakerTW/animal_br.rb +12 -0
- data/lib/ffakerTW/animal_cn.rb +12 -0
- data/lib/ffakerTW/animal_es.rb +12 -0
- data/lib/ffakerTW/animal_pl.rb +15 -0
- data/lib/ffakerTW/animal_tw.rb +12 -0
- data/lib/ffakerTW/animal_us.rb +12 -0
- data/lib/ffakerTW/avatar.rb +36 -0
- data/lib/ffakerTW/aws.rb +24 -0
- data/lib/ffakerTW/bacon_ipsum.rb +19 -0
- data/lib/ffakerTW/bank.rb +118 -0
- data/lib/ffakerTW/book.rb +56 -0
- data/lib/ffakerTW/boolean.rb +18 -0
- data/lib/ffakerTW/cheesy_lingo.rb +39 -0
- data/lib/ffakerTW/code.rb +37 -0
- data/lib/ffakerTW/color.rb +66 -0
- data/lib/ffakerTW/color_pl.rb +14 -0
- data/lib/ffakerTW/color_ua.rb +12 -0
- data/lib/ffakerTW/company.rb +44 -0
- data/lib/ffakerTW/company_cn.rb +23 -0
- data/lib/ffakerTW/company_fr.rb +35 -0
- data/lib/ffakerTW/company_it.rb +45 -0
- data/lib/ffakerTW/company_ja.rb +24 -0
- data/lib/ffakerTW/company_se.rb +23 -0
- data/lib/ffakerTW/company_tw.rb +23 -0
- data/lib/ffakerTW/conference.rb +12 -0
- data/lib/ffakerTW/courses_fr.rb +23 -0
- data/lib/ffakerTW/currency.rb +20 -0
- data/lib/ffakerTW/data/address/city_suffixes +19 -0
- data/lib/ffakerTW/data/address/country +249 -0
- data/lib/ffakerTW/data/address/country_code +249 -0
- data/lib/ffakerTW/data/address/neighborhood +49 -0
- data/lib/ffakerTW/data/address/street_suffix +195 -0
- data/lib/ffakerTW/data/address/time_zone +130 -0
- data/lib/ffakerTW/data/address_br/city +299 -0
- data/lib/ffakerTW/data/address_br/complement +3 -0
- data/lib/ffakerTW/data/address_br/neighborhood_prefixes +3 -0
- data/lib/ffakerTW/data/address_br/state +27 -0
- data/lib/ffakerTW/data/address_br/state_abbr +27 -0
- data/lib/ffakerTW/data/address_ca/city +181 -0
- data/lib/ffakerTW/data/address_ca/province +13 -0
- data/lib/ffakerTW/data/address_ch/canton_abbr +26 -0
- data/lib/ffakerTW/data/address_chde/canton +26 -0
- data/lib/ffakerTW/data/address_chfr/canton +26 -0
- data/lib/ffakerTW/data/address_chit/canton +26 -0
- data/lib/ffakerTW/data/address_da/city +592 -0
- data/lib/ffakerTW/data/address_da/kommune +88 -0
- data/lib/ffakerTW/data/address_da/street +657 -0
- data/lib/ffakerTW/data/address_de/city +1666 -0
- data/lib/ffakerTW/data/address_de/state +15 -0
- data/lib/ffakerTW/data/address_fi/city +107 -0
- data/lib/ffakerTW/data/address_fi/countries +96 -0
- data/lib/ffakerTW/data/address_fi/street +140 -0
- data/lib/ffakerTW/data/address_fr/city +261 -0
- data/lib/ffakerTW/data/address_fr/region +27 -0
- data/lib/ffakerTW/data/address_gr/city +79 -0
- data/lib/ffakerTW/data/address_gr/region +13 -0
- data/lib/ffakerTW/data/address_gr/street +100 -0
- data/lib/ffakerTW/data/address_id/city +102 -0
- data/lib/ffakerTW/data/address_id/common_street_names +170 -0
- data/lib/ffakerTW/data/address_id/state +33 -0
- data/lib/ffakerTW/data/address_id/state_abbr +33 -0
- data/lib/ffakerTW/data/address_in/city +24 -0
- data/lib/ffakerTW/data/address_in/state +29 -0
- data/lib/ffakerTW/data/address_in/state_abbr +29 -0
- data/lib/ffakerTW/data/address_in/union_territory +7 -0
- data/lib/ffakerTW/data/address_in/union_territory_abbr +7 -0
- data/lib/ffakerTW/data/address_it/city +111 -0
- data/lib/ffakerTW/data/address_it/region +20 -0
- data/lib/ffakerTW/data/address_ja/city +791 -0
- data/lib/ffakerTW/data/address_ja/county +98 -0
- data/lib/ffakerTW/data/address_ja/designated_city +20 -0
- data/lib/ffakerTW/data/address_ja/prefecture +47 -0
- data/lib/ffakerTW/data/address_ja/street +37 -0
- data/lib/ffakerTW/data/address_ja/tokyo_ward +23 -0
- data/lib/ffakerTW/data/address_ja/village +183 -0
- data/lib/ffakerTW/data/address_ja/ward +188 -0
- data/lib/ffakerTW/data/address_kr/boroughs +29 -0
- data/lib/ffakerTW/data/address_kr/cities +51 -0
- data/lib/ffakerTW/data/address_mx/ags +11 -0
- data/lib/ffakerTW/data/address_mx/bc +5 -0
- data/lib/ffakerTW/data/address_mx/bcs +5 -0
- data/lib/ffakerTW/data/address_mx/camp +11 -0
- data/lib/ffakerTW/data/address_mx/chih +67 -0
- data/lib/ffakerTW/data/address_mx/chis +118 -0
- data/lib/ffakerTW/data/address_mx/coah +38 -0
- data/lib/ffakerTW/data/address_mx/col +10 -0
- data/lib/ffakerTW/data/address_mx/df +16 -0
- data/lib/ffakerTW/data/address_mx/dgo +39 -0
- data/lib/ffakerTW/data/address_mx/gro +81 -0
- data/lib/ffakerTW/data/address_mx/gto +46 -0
- data/lib/ffakerTW/data/address_mx/hgo +84 -0
- data/lib/ffakerTW/data/address_mx/jal +125 -0
- data/lib/ffakerTW/data/address_mx/mex +125 -0
- data/lib/ffakerTW/data/address_mx/mich +113 -0
- data/lib/ffakerTW/data/address_mx/mor +33 -0
- data/lib/ffakerTW/data/address_mx/nay +20 -0
- data/lib/ffakerTW/data/address_mx/nl +51 -0
- data/lib/ffakerTW/data/address_mx/oax +570 -0
- data/lib/ffakerTW/data/address_mx/pue +217 -0
- data/lib/ffakerTW/data/address_mx/qr +10 -0
- data/lib/ffakerTW/data/address_mx/qro +18 -0
- data/lib/ffakerTW/data/address_mx/sin +18 -0
- data/lib/ffakerTW/data/address_mx/slp +58 -0
- data/lib/ffakerTW/data/address_mx/son +72 -0
- data/lib/ffakerTW/data/address_mx/state +32 -0
- data/lib/ffakerTW/data/address_mx/state_abbr +32 -0
- data/lib/ffakerTW/data/address_mx/tab +17 -0
- data/lib/ffakerTW/data/address_mx/tamps +43 -0
- data/lib/ffakerTW/data/address_mx/tlax +60 -0
- data/lib/ffakerTW/data/address_mx/ver +212 -0
- data/lib/ffakerTW/data/address_mx/yuc +106 -0
- data/lib/ffakerTW/data/address_mx/zac +58 -0
- data/lib/ffakerTW/data/address_nl/city +2226 -0
- data/lib/ffakerTW/data/address_nl/province +12 -0
- data/lib/ffakerTW/data/address_pl/city +916 -0
- data/lib/ffakerTW/data/address_pl/square +390 -0
- data/lib/ffakerTW/data/address_pl/street +390 -0
- data/lib/ffakerTW/data/address_pl/voivodeship +16 -0
- data/lib/ffakerTW/data/address_pl/voivodeship_abbr +16 -0
- data/lib/ffakerTW/data/address_pl/voivodeship_capital_city +18 -0
- data/lib/ffakerTW/data/address_ru/city +74 -0
- data/lib/ffakerTW/data/address_ru/province +83 -0
- data/lib/ffakerTW/data/address_ru/street +49 -0
- data/lib/ffakerTW/data/address_se/city +154 -0
- data/lib/ffakerTW/data/address_se/countries +250 -0
- data/lib/ffakerTW/data/address_se/street +2887 -0
- data/lib/ffakerTW/data/address_sn/arrondissements +47 -0
- data/lib/ffakerTW/data/address_sn/departements +43 -0
- data/lib/ffakerTW/data/address_sn/regions +14 -0
- data/lib/ffakerTW/data/address_ua/city +57 -0
- data/lib/ffakerTW/data/address_ua/country +193 -0
- data/lib/ffakerTW/data/address_ua/province +27 -0
- data/lib/ffakerTW/data/address_ua/street +13 -0
- data/lib/ffakerTW/data/address_uk/county +70 -0
- data/lib/ffakerTW/data/address_us/state +50 -0
- data/lib/ffakerTW/data/address_us/state_abbr +50 -0
- data/lib/ffakerTW/data/address_us/state_and_territories_abbr +62 -0
- data/lib/ffakerTW/data/airline/codes_list +209 -0
- data/lib/ffakerTW/data/airline/names_list +206 -0
- data/lib/ffakerTW/data/animal/common_names +141 -0
- data/lib/ffakerTW/data/animal_br/common_names +423 -0
- data/lib/ffakerTW/data/animal_cn/common_names +141 -0
- data/lib/ffakerTW/data/animal_es/common_names +135 -0
- data/lib/ffakerTW/data/animal_pl/common_names +256 -0
- data/lib/ffakerTW/data/animal_tw/common_names +141 -0
- data/lib/ffakerTW/data/animal_us/common_names +141 -0
- data/lib/ffakerTW/data/aws/ec2_instance_type +59 -0
- data/lib/ffakerTW/data/aws/ec2_reserved_instance_tenancy +3 -0
- data/lib/ffakerTW/data/aws/ec2_reserved_offering_type +6 -0
- data/lib/ffakerTW/data/aws/ec2_reserved_product_description +14 -0
- data/lib/ffakerTW/data/bacon_ipsum/bacon_words +62 -0
- data/lib/ffakerTW/data/bank/card_types +12 -0
- data/lib/ffakerTW/data/book/adj_and_adv +20 -0
- data/lib/ffakerTW/data/book/genres +369 -0
- data/lib/ffakerTW/data/book/nouns +36 -0
- data/lib/ffakerTW/data/book/prefixes +17 -0
- data/lib/ffakerTW/data/cheesy_lingo/cheesy_phrases +54 -0
- data/lib/ffakerTW/data/cheesy_lingo/cheesy_words +34 -0
- data/lib/ffakerTW/data/color/names_list +147 -0
- data/lib/ffakerTW/data/color_pl/names_list +122 -0
- data/lib/ffakerTW/data/color_ua/names_list +114 -0
- data/lib/ffakerTW/data/company/bs_mid +65 -0
- data/lib/ffakerTW/data/company/bs_pos +44 -0
- data/lib/ffakerTW/data/company/bs_pre +60 -0
- data/lib/ffakerTW/data/company/catch_mid +101 -0
- data/lib/ffakerTW/data/company/catch_pos +104 -0
- data/lib/ffakerTW/data/company/catch_pre +100 -0
- data/lib/ffakerTW/data/company/position_areas +11 -0
- data/lib/ffakerTW/data/company_it/piva_office_codes +99 -0
- data/lib/ffakerTW/data/conference/conference_list +40 -0
- data/lib/ffakerTW/data/currency/currency_code +169 -0
- data/lib/ffakerTW/data/currency/currency_name +169 -0
- data/lib/ffakerTW/data/currency/currency_symbol +8 -0
- data/lib/ffakerTW/data/dizzle_ipsum/dizzle_words +69 -0
- data/lib/ffakerTW/data/education/degree_prefix +274 -0
- data/lib/ffakerTW/data/education/degree_short_prefix +19 -0
- data/lib/ffakerTW/data/education/major_noun +13 -0
- data/lib/ffakerTW/data/education/school_suffix +13 -0
- data/lib/ffakerTW/data/education_cn/city +351 -0
- data/lib/ffakerTW/data/education_cn/major +506 -0
- data/lib/ffakerTW/data/education_cn/province +31 -0
- data/lib/ffakerTW/data/education_cn/school_type +27 -0
- data/lib/ffakerTW/data/education_tw/city +20 -0
- data/lib/ffakerTW/data/education_tw/major +506 -0
- data/lib/ffakerTW/data/education_tw/school_type +27 -0
- data/lib/ffakerTW/data/filesystem/extension +32 -0
- data/lib/ffakerTW/data/filesystem/mime_type +67 -0
- data/lib/ffakerTW/data/food/fruit +82 -0
- data/lib/ffakerTW/data/food/herb_spice +64 -0
- data/lib/ffakerTW/data/food/meat +48 -0
- data/lib/ffakerTW/data/food/vegetable +207 -0
- data/lib/ffakerTW/data/food_pl/diary +14 -0
- data/lib/ffakerTW/data/food_pl/fermented +13 -0
- data/lib/ffakerTW/data/food_pl/fruits +34 -0
- data/lib/ffakerTW/data/food_pl/herbs +20 -0
- data/lib/ffakerTW/data/food_pl/meats +9 -0
- data/lib/ffakerTW/data/food_pl/preserves +10 -0
- data/lib/ffakerTW/data/food_pl/spices +26 -0
- data/lib/ffakerTW/data/food_pl/vegetables +45 -0
- data/lib/ffakerTW/data/freedom_ipsum/freedom_words +161 -0
- data/lib/ffakerTW/data/game/adj_and_adv +18 -0
- data/lib/ffakerTW/data/game/category +84 -0
- data/lib/ffakerTW/data/game/mechanic +182 -0
- data/lib/ffakerTW/data/game/nouns +37 -0
- data/lib/ffakerTW/data/game/prefixes +17 -0
- data/lib/ffakerTW/data/healthcare_ipsum/healthcare_words +193 -0
- data/lib/ffakerTW/data/healthcare_ru/doctor_specialization +127 -0
- data/lib/ffakerTW/data/hipster_ipsum/hipster_words +101 -0
- data/lib/ffakerTW/data/identification_mx/estados_curp +33 -0
- data/lib/ffakerTW/data/job/job_adj +37 -0
- data/lib/ffakerTW/data/job/job_noun +25 -0
- data/lib/ffakerTW/data/job/job_prefix +22 -0
- data/lib/ffakerTW/data/job_br/job_nouns +52 -0
- data/lib/ffakerTW/data/job_cn/job_nouns +300 -0
- data/lib/ffakerTW/data/job_fr/job_nouns +14 -0
- data/lib/ffakerTW/data/job_fr/job_prefixes +15 -0
- data/lib/ffakerTW/data/job_it/job_adj +37 -0
- data/lib/ffakerTW/data/job_it/job_noun +25 -0
- data/lib/ffakerTW/data/job_it/job_prefix +22 -0
- data/lib/ffakerTW/data/job_ja/job_nouns +235 -0
- data/lib/ffakerTW/data/job_kr/job_nouns +1209 -0
- data/lib/ffakerTW/data/job_tw/job_nouns +300 -0
- data/lib/ffakerTW/data/job_vn/job_nouns +191 -0
- data/lib/ffakerTW/data/locale/language +136 -0
- data/lib/ffakerTW/data/locale/language_code +136 -0
- data/lib/ffakerTW/data/lorem/characters +36 -0
- data/lib/ffakerTW/data/lorem/words +182 -0
- data/lib/ffakerTW/data/lorem_ar/words +911 -0
- data/lib/ffakerTW/data/lorem_br/characters +36 -0
- data/lib/ffakerTW/data/lorem_br/words +183 -0
- data/lib/ffakerTW/data/lorem_cn/words +706 -0
- data/lib/ffakerTW/data/lorem_fr/words +229 -0
- data/lib/ffakerTW/data/lorem_ie/characters +5 -0
- data/lib/ffakerTW/data/lorem_ie/paragraphs +2 -0
- data/lib/ffakerTW/data/lorem_ie/questions +1 -0
- data/lib/ffakerTW/data/lorem_ie/sentences +1 -0
- data/lib/ffakerTW/data/lorem_ie/words +107 -0
- data/lib/ffakerTW/data/lorem_it/words +321 -0
- data/lib/ffakerTW/data/lorem_ja/characters +101 -0
- data/lib/ffakerTW/data/lorem_ja/sentences +30 -0
- data/lib/ffakerTW/data/lorem_ja/sentences_end +21 -0
- data/lib/ffakerTW/data/lorem_ja/words +81 -0
- data/lib/ffakerTW/data/lorem_kr/words +47 -0
- data/lib/ffakerTW/data/lorem_pl/characters +32 -0
- data/lib/ffakerTW/data/lorem_pl/words +245 -0
- data/lib/ffakerTW/data/lorem_ru/capital_chars +33 -0
- data/lib/ffakerTW/data/lorem_ru/chars +33 -0
- data/lib/ffakerTW/data/lorem_ru/words +191 -0
- data/lib/ffakerTW/data/lorem_tw/words +706 -0
- data/lib/ffakerTW/data/lorem_ua/capital_chars +33 -0
- data/lib/ffakerTW/data/lorem_ua/chars +33 -0
- data/lib/ffakerTW/data/lorem_ua/words +362 -0
- data/lib/ffakerTW/data/mathematiques/lessons +58 -0
- data/lib/ffakerTW/data/movie/adj_and_adv +20 -0
- data/lib/ffakerTW/data/movie/nouns +36 -0
- data/lib/ffakerTW/data/movie/prefixes +17 -0
- data/lib/ffakerTW/data/music/albums +91 -0
- data/lib/ffakerTW/data/music/artists +100 -0
- data/lib/ffakerTW/data/music/genres +20 -0
- data/lib/ffakerTW/data/music/songs +100 -0
- data/lib/ffakerTW/data/name/first_names_female +4045 -0
- data/lib/ffakerTW/data/name/first_names_male +1182 -0
- data/lib/ffakerTW/data/name/last_names +474 -0
- data/lib/ffakerTW/data/name/pronouns +6 -0
- data/lib/ffakerTW/data/name_ar/first_names_female +250 -0
- data/lib/ffakerTW/data/name_ar/first_names_male +567 -0
- data/lib/ffakerTW/data/name_ar/last_names +357 -0
- data/lib/ffakerTW/data/name_br/first_names_female +1068 -0
- data/lib/ffakerTW/data/name_br/first_names_male +607 -0
- data/lib/ffakerTW/data/name_br/last_names +77 -0
- data/lib/ffakerTW/data/name_cn/first_names +1000 -0
- data/lib/ffakerTW/data/name_cn/last_names +1057 -0
- data/lib/ffakerTW/data/name_cs/female_first_names +40 -0
- data/lib/ffakerTW/data/name_cs/female_last_names +50 -0
- data/lib/ffakerTW/data/name_cs/male_first_names +88 -0
- data/lib/ffakerTW/data/name_cs/male_last_names +49 -0
- data/lib/ffakerTW/data/name_cs/prefixes +16 -0
- data/lib/ffakerTW/data/name_da/female_first_names +303 -0
- data/lib/ffakerTW/data/name_da/last_names +187 -0
- data/lib/ffakerTW/data/name_da/male_first_names +301 -0
- data/lib/ffakerTW/data/name_de/first_names +1166 -0
- data/lib/ffakerTW/data/name_de/last_names +100 -0
- data/lib/ffakerTW/data/name_es/first_names_female +184 -0
- data/lib/ffakerTW/data/name_es/first_names_male +165 -0
- data/lib/ffakerTW/data/name_es/last_names +208 -0
- data/lib/ffakerTW/data/name_fr/first_names +220 -0
- data/lib/ffakerTW/data/name_fr/last_names +408 -0
- data/lib/ffakerTW/data/name_ga/first_names_female +225 -0
- data/lib/ffakerTW/data/name_ga/first_names_male +306 -0
- data/lib/ffakerTW/data/name_gr/female_first_names +80 -0
- data/lib/ffakerTW/data/name_gr/female_last_names +45 -0
- data/lib/ffakerTW/data/name_gr/male_first_names +90 -0
- data/lib/ffakerTW/data/name_gr/male_last_names +57 -0
- data/lib/ffakerTW/data/name_id/first_names_female +267 -0
- data/lib/ffakerTW/data/name_id/first_names_male +312 -0
- data/lib/ffakerTW/data/name_id/last_names +1669 -0
- data/lib/ffakerTW/data/name_in/first_names_female +100 -0
- data/lib/ffakerTW/data/name_in/first_names_male +100 -0
- data/lib/ffakerTW/data/name_in/last_names +100 -0
- data/lib/ffakerTW/data/name_it/first_names +171 -0
- data/lib/ffakerTW/data/name_it/last_names +70 -0
- data/lib/ffakerTW/data/name_ja/first_names +397 -0
- data/lib/ffakerTW/data/name_ja/last_names +1078 -0
- data/lib/ffakerTW/data/name_kh/first_names +64 -0
- data/lib/ffakerTW/data/name_kh/last_names +71 -0
- data/lib/ffakerTW/data/name_kh/nick_names +30 -0
- data/lib/ffakerTW/data/name_kr/first_names +1317 -0
- data/lib/ffakerTW/data/name_kr/last_names +197 -0
- data/lib/ffakerTW/data/name_mx/female_first_names +216 -0
- data/lib/ffakerTW/data/name_mx/last_names +352 -0
- data/lib/ffakerTW/data/name_mx/male_first_names +211 -0
- data/lib/ffakerTW/data/name_nb/first_names_female +50 -0
- data/lib/ffakerTW/data/name_nb/first_names_male +50 -0
- data/lib/ffakerTW/data/name_nb/last_names +100 -0
- data/lib/ffakerTW/data/name_nl/first_names_female +89 -0
- data/lib/ffakerTW/data/name_nl/first_names_male +75 -0
- data/lib/ffakerTW/data/name_nl/last_names +115 -0
- data/lib/ffakerTW/data/name_ph/autochthonous_surnames +217 -0
- data/lib/ffakerTW/data/name_ph/spanish_surnames +300 -0
- data/lib/ffakerTW/data/name_pl/female_first_names +121 -0
- data/lib/ffakerTW/data/name_pl/female_last_names +200 -0
- data/lib/ffakerTW/data/name_pl/male_first_names +121 -0
- data/lib/ffakerTW/data/name_pl/male_last_names +200 -0
- data/lib/ffakerTW/data/name_ru/first_names_female +91 -0
- data/lib/ffakerTW/data/name_ru/first_names_male +172 -0
- data/lib/ffakerTW/data/name_ru/last_names_female +100 -0
- data/lib/ffakerTW/data/name_ru/last_names_male +100 -0
- data/lib/ffakerTW/data/name_ru/middle_names_female +65 -0
- data/lib/ffakerTW/data/name_ru/middle_names_male +73 -0
- data/lib/ffakerTW/data/name_se/first_names_female +110 -0
- data/lib/ffakerTW/data/name_se/first_names_male +110 -0
- data/lib/ffakerTW/data/name_se/last_names +100 -0
- data/lib/ffakerTW/data/name_sn/first_names_female +225 -0
- data/lib/ffakerTW/data/name_sn/first_names_male +304 -0
- data/lib/ffakerTW/data/name_sn/last_names +243 -0
- data/lib/ffakerTW/data/name_th/first_names +360 -0
- data/lib/ffakerTW/data/name_th/last_names +15 -0
- data/lib/ffakerTW/data/name_th/nick_names +74 -0
- data/lib/ffakerTW/data/name_then/first_names +292 -0
- data/lib/ffakerTW/data/name_then/last_names +63 -0
- data/lib/ffakerTW/data/name_then/nick_names +30 -0
- data/lib/ffakerTW/data/name_tw/first_names +122 -0
- data/lib/ffakerTW/data/name_tw/last_names +100 -0
- data/lib/ffakerTW/data/name_tw/name_tw/first_names +1000 -0
- data/lib/ffakerTW/data/name_tw/name_tw/last_names +243 -0
- data/lib/ffakerTW/data/name_ua/first_names_female +193 -0
- data/lib/ffakerTW/data/name_ua/first_names_male +195 -0
- data/lib/ffakerTW/data/name_ua/last_names_female +230 -0
- data/lib/ffakerTW/data/name_ua/last_names_male +239 -0
- data/lib/ffakerTW/data/name_ua/middle_names_female +116 -0
- data/lib/ffakerTW/data/name_ua/middle_names_male +116 -0
- data/lib/ffakerTW/data/name_vn/first_names +6 -0
- data/lib/ffakerTW/data/name_vn/last_names +67 -0
- data/lib/ffakerTW/data/name_vn/middle_names +89 -0
- data/lib/ffakerTW/data/nato_alphabet/alphabet_codes +26 -0
- data/lib/ffakerTW/data/nato_alphabet/numeric_codes +10 -0
- data/lib/ffakerTW/data/philosophie/lessons +17 -0
- data/lib/ffakerTW/data/phone_number/phone_calling_code +205 -0
- data/lib/ffakerTW/data/phone_number_id/home_phone_prefixes +303 -0
- data/lib/ffakerTW/data/phone_number_id/mobile_phone_prefixes +33 -0
- data/lib/ffakerTW/data/phone_number_it/home_phone_prefixes +232 -0
- data/lib/ffakerTW/data/phone_number_it/mobile_phone_prefixes +18 -0
- data/lib/ffakerTW/data/phone_number_ja/four_disit_area_codes +41 -0
- data/lib/ffakerTW/data/phone_number_ja/one_disit_area_codes +3 -0
- data/lib/ffakerTW/data/phone_number_ja/three_disit_area_codes +296 -0
- data/lib/ffakerTW/data/phone_number_ja/two_disit_area_codes +48 -0
- data/lib/ffakerTW/data/phone_number_nl/area_codes +142 -0
- data/lib/ffakerTW/data/phone_number_ru/home_phone_prefixes +107 -0
- data/lib/ffakerTW/data/phone_number_ru/mobile_phone_prefixes +61 -0
- data/lib/ffakerTW/data/phone_number_se/phone_prefix +265 -0
- data/lib/ffakerTW/data/phone_number_ua/home_phone_prefixes +29 -0
- data/lib/ffakerTW/data/phone_number_ua/mobile_phone_prefixes +11 -0
- data/lib/ffakerTW/data/product/adj +19 -0
- data/lib/ffakerTW/data/product/b1 +19 -0
- data/lib/ffakerTW/data/product/noun +19 -0
- data/lib/ffakerTW/data/skill/specialty_end +14 -0
- data/lib/ffakerTW/data/skill/specialty_start +18 -0
- data/lib/ffakerTW/data/skill/tech_skills +52 -0
- data/lib/ffakerTW/data/sport/names +67 -0
- data/lib/ffakerTW/data/sport_pl/summer +53 -0
- data/lib/ffakerTW/data/sport_pl/winter +14 -0
- data/lib/ffakerTW/data/sport_ru/summer +68 -0
- data/lib/ffakerTW/data/sport_ru/winter +20 -0
- data/lib/ffakerTW/data/sport_us/names +67 -0
- data/lib/ffakerTW/data/tweet/hashtag +58 -0
- data/lib/ffakerTW/data/vehicle/color_prefixes +25 -0
- data/lib/ffakerTW/data/vehicle/displacements_list +21 -0
- data/lib/ffakerTW/data/vehicle/fuel_types_list +6 -0
- data/lib/ffakerTW/data/vehicle/makes_list +73 -0
- data/lib/ffakerTW/data/vehicle/models_list +106 -0
- data/lib/ffakerTW/data/vehicle/transmissions_list +4 -0
- data/lib/ffakerTW/data/vehicle/trims_list +13 -0
- data/lib/ffakerTW/data/vehicle/upholstery_list +5 -0
- data/lib/ffakerTW/data/venue/venue_list +33 -0
- data/lib/ffakerTW/data/youtube/video_ids +50 -0
- data/lib/ffakerTW/dizzle_ipsum.rb +19 -0
- data/lib/ffakerTW/education.rb +49 -0
- data/lib/ffakerTW/education_cn.rb +37 -0
- data/lib/ffakerTW/education_tw.rb +37 -0
- data/lib/ffakerTW/filesystem.rb +25 -0
- data/lib/ffakerTW/food.rb +28 -0
- data/lib/ffakerTW/food_pl.rb +65 -0
- data/lib/ffakerTW/freedom_ipsum.rb +20 -0
- data/lib/ffakerTW/game.rb +33 -0
- data/lib/ffakerTW/gender.rb +22 -0
- data/lib/ffakerTW/gender_br.rb +17 -0
- data/lib/ffakerTW/gender_cn.rb +17 -0
- data/lib/ffakerTW/gender_id.rb +17 -0
- data/lib/ffakerTW/gender_it.rb +17 -0
- data/lib/ffakerTW/gender_ja.rb +18 -0
- data/lib/ffakerTW/gender_jp.rb +11 -0
- data/lib/ffakerTW/gender_kr.rb +17 -0
- data/lib/ffakerTW/gender_pl.rb +19 -0
- data/lib/ffakerTW/gender_ru.rb +22 -0
- data/lib/ffakerTW/gender_tw.rb +17 -0
- data/lib/ffakerTW/geolocation.rb +60 -0
- data/lib/ffakerTW/guid.rb +12 -0
- data/lib/ffakerTW/healthcare_ipsum.rb +18 -0
- data/lib/ffakerTW/healthcare_ru.rb +12 -0
- data/lib/ffakerTW/hipster_ipsum.rb +19 -0
- data/lib/ffakerTW/html_ipsum.rb +186 -0
- data/lib/ffakerTW/identification.rb +30 -0
- data/lib/ffakerTW/identification_br.rb +84 -0
- data/lib/ffakerTW/identification_es.rb +14 -0
- data/lib/ffakerTW/identification_es_cl.rb +29 -0
- data/lib/ffakerTW/identification_es_co.rb +39 -0
- data/lib/ffakerTW/identification_in.rb +15 -0
- data/lib/ffakerTW/identification_it.rb +30 -0
- data/lib/ffakerTW/identification_kr.rb +19 -0
- data/lib/ffakerTW/identification_mx.rb +58 -0
- data/lib/ffakerTW/identification_pl.rb +77 -0
- data/lib/ffakerTW/identification_tw.rb +24 -0
- data/lib/ffakerTW/image.rb +48 -0
- data/lib/ffakerTW/internet.rb +90 -0
- data/lib/ffakerTW/internet_se.rb +108 -0
- data/lib/ffakerTW/job.rb +12 -0
- data/lib/ffakerTW/job_br.rb +12 -0
- data/lib/ffakerTW/job_cn.rb +12 -0
- data/lib/ffakerTW/job_fr.rb +18 -0
- data/lib/ffakerTW/job_it.rb +12 -0
- data/lib/ffakerTW/job_ja.rb +12 -0
- data/lib/ffakerTW/job_kr.rb +12 -0
- data/lib/ffakerTW/job_tw.rb +12 -0
- data/lib/ffakerTW/job_vn.rb +12 -0
- data/lib/ffakerTW/locale.rb +22 -0
- data/lib/ffakerTW/lorem.rb +45 -0
- data/lib/ffakerTW/lorem_ar.rb +40 -0
- data/lib/ffakerTW/lorem_br.rb +45 -0
- data/lib/ffakerTW/lorem_cn.rb +40 -0
- data/lib/ffakerTW/lorem_fr.rb +39 -0
- data/lib/ffakerTW/lorem_ie.rb +40 -0
- data/lib/ffakerTW/lorem_it.rb +39 -0
- data/lib/ffakerTW/lorem_ja.rb +40 -0
- data/lib/ffakerTW/lorem_kr.rb +36 -0
- data/lib/ffakerTW/lorem_pl.rb +60 -0
- data/lib/ffakerTW/lorem_ru.rb +57 -0
- data/lib/ffakerTW/lorem_tw.rb +40 -0
- data/lib/ffakerTW/lorem_ua.rb +54 -0
- data/lib/ffakerTW/movie.rb +69 -0
- data/lib/ffakerTW/music.rb +24 -0
- data/lib/ffakerTW/name.rb +121 -0
- data/lib/ffakerTW/name_ar.rb +28 -0
- data/lib/ffakerTW/name_br.rb +62 -0
- data/lib/ffakerTW/name_cn.rb +24 -0
- data/lib/ffakerTW/name_cs.rb +87 -0
- data/lib/ffakerTW/name_da.rb +56 -0
- data/lib/ffakerTW/name_de.rb +31 -0
- data/lib/ffakerTW/name_es.rb +64 -0
- data/lib/ffakerTW/name_fr.rb +34 -0
- data/lib/ffakerTW/name_ga.rb +39 -0
- data/lib/ffakerTW/name_gr.rb +59 -0
- data/lib/ffakerTW/name_id.rb +62 -0
- data/lib/ffakerTW/name_in.rb +39 -0
- data/lib/ffakerTW/name_it.rb +31 -0
- data/lib/ffakerTW/name_ja.rb +22 -0
- data/lib/ffakerTW/name_kh.rb +24 -0
- data/lib/ffakerTW/name_kr.rb +26 -0
- data/lib/ffakerTW/name_mx.rb +101 -0
- data/lib/ffakerTW/name_nb.rb +44 -0
- data/lib/ffakerTW/name_nl.rb +48 -0
- data/lib/ffakerTW/name_ph.rb +25 -0
- data/lib/ffakerTW/name_pl.rb +98 -0
- data/lib/ffakerTW/name_ru.rb +55 -0
- data/lib/ffakerTW/name_se.rb +44 -0
- data/lib/ffakerTW/name_sn.rb +56 -0
- data/lib/ffakerTW/name_th.rb +25 -0
- data/lib/ffakerTW/name_th_en.rb +26 -0
- data/lib/ffakerTW/name_tw.rb +24 -0
- data/lib/ffakerTW/name_ua.rb +57 -0
- data/lib/ffakerTW/name_vn.rb +28 -0
- data/lib/ffakerTW/nato_alphabet.rb +38 -0
- data/lib/ffakerTW/number.rb +26 -0
- data/lib/ffakerTW/phone_number.rb +80 -0
- data/lib/ffakerTW/phone_number_au.rb +76 -0
- data/lib/ffakerTW/phone_number_br.rb +77 -0
- data/lib/ffakerTW/phone_number_ch.rb +46 -0
- data/lib/ffakerTW/phone_number_cu.rb +122 -0
- data/lib/ffakerTW/phone_number_da.rb +43 -0
- data/lib/ffakerTW/phone_number_de.rb +50 -0
- data/lib/ffakerTW/phone_number_fr.rb +65 -0
- data/lib/ffakerTW/phone_number_id.rb +36 -0
- data/lib/ffakerTW/phone_number_it.rb +44 -0
- data/lib/ffakerTW/phone_number_ja.rb +88 -0
- data/lib/ffakerTW/phone_number_kr.rb +50 -0
- data/lib/ffakerTW/phone_number_mx.rb +56 -0
- data/lib/ffakerTW/phone_number_nl.rb +46 -0
- data/lib/ffakerTW/phone_number_pl.rb +68 -0
- data/lib/ffakerTW/phone_number_ru.rb +120 -0
- data/lib/ffakerTW/phone_number_se.rb +88 -0
- data/lib/ffakerTW/phone_number_sg.rb +81 -0
- data/lib/ffakerTW/phone_number_sn.rb +71 -0
- data/lib/ffakerTW/phone_number_tw.rb +49 -0
- data/lib/ffakerTW/phone_number_ua.rb +42 -0
- data/lib/ffakerTW/product.rb +47 -0
- data/lib/ffakerTW/sem_ver.rb +19 -0
- data/lib/ffakerTW/skill.rb +24 -0
- data/lib/ffakerTW/sport.rb +14 -0
- data/lib/ffakerTW/sport_pl.rb +25 -0
- data/lib/ffakerTW/sport_ru.rb +25 -0
- data/lib/ffakerTW/sport_us.rb +12 -0
- data/lib/ffakerTW/ssn.rb +22 -0
- data/lib/ffakerTW/ssn_mx.rb +56 -0
- data/lib/ffakerTW/ssn_se.rb +80 -0
- data/lib/ffakerTW/string.rb +110 -0
- data/lib/ffakerTW/time.rb +65 -0
- data/lib/ffakerTW/tweet.rb +59 -0
- data/lib/ffakerTW/unit.rb +48 -0
- data/lib/ffakerTW/unit_english.rb +107 -0
- data/lib/ffakerTW/unit_metric.rb +98 -0
- data/lib/ffakerTW/utils/array_utils.rb +53 -0
- data/lib/ffakerTW/utils/module_utils.rb +59 -0
- data/lib/ffakerTW/utils/random_utils.rb +37 -0
- data/lib/ffakerTW/utils/unique_utils.rb +44 -0
- data/lib/ffakerTW/vehicle.rb +133 -0
- data/lib/ffakerTW/venue.rb +12 -0
- data/lib/ffakerTW/version.rb +5 -0
- data/lib/ffakerTW/youtube.rb +24 -0
- data/lib/ffakerTW.rb +263 -0
- data/lib/version.rb +5 -0
- data/scripts/benchmark.rb +21 -0
- data/scripts/profile.sh +2 -0
- data/scripts/profiling.rb +9 -0
- data/scripts/reference.rb +96 -0
- data/test/helper.rb +89 -0
- data/test/test_address.rb +109 -0
- data/test/test_address_au.rb +78 -0
- data/test/test_address_br.rb +50 -0
- data/test/test_address_ca.rb +31 -0
- data/test/test_address_ch.rb +17 -0
- data/test/test_address_ch_de.rb +13 -0
- data/test/test_address_ch_fr.rb +13 -0
- data/test/test_address_ch_it.rb +15 -0
- data/test/test_address_da.rb +50 -0
- data/test/test_address_de.rb +32 -0
- data/test/test_address_fi.rb +39 -0
- data/test/test_address_fr.rb +12 -0
- data/test/test_address_gr.rb +43 -0
- data/test/test_address_id.rb +39 -0
- data/test/test_address_in.rb +58 -0
- data/test/test_address_it.rb +12 -0
- data/test/test_address_ja.rb +58 -0
- data/test/test_address_kr.rb +14 -0
- data/test/test_address_mx.rb +32 -0
- data/test/test_address_nl.rb +36 -0
- data/test/test_address_pl.rb +80 -0
- data/test/test_address_ru.rb +36 -0
- data/test/test_address_se.rb +39 -0
- data/test/test_address_sn.rb +28 -0
- data/test/test_address_ua.rb +57 -0
- data/test/test_address_uk.rb +25 -0
- data/test/test_address_us.rb +51 -0
- data/test/test_airline.rb +17 -0
- data/test/test_animal.rb +17 -0
- 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 +100 -0
- data/test/test_avatar.rb +57 -0
- data/test/test_aws.rb +25 -0
- data/test/test_bacon_ipsum.rb +36 -0
- data/test/test_bank.rb +53 -0
- data/test/test_book.rb +46 -0
- data/test/test_boolean.rb +14 -0
- data/test/test_cheesy_lingo.rb +43 -0
- data/test/test_code.rb +39 -0
- data/test/test_color.rb +134 -0
- data/test/test_color_pl.rb +13 -0
- data/test/test_color_ua.rb +13 -0
- data/test/test_company.rb +32 -0
- data/test/test_company_cn.rb +24 -0
- data/test/test_company_fr.rb +33 -0
- data/test/test_company_it.rb +28 -0
- data/test/test_company_ja.rb +28 -0
- data/test/test_company_se.rb +20 -0
- data/test/test_conference.rb +13 -0
- data/test/test_course_mathematiques.rb +17 -0
- data/test/test_course_philosophie.rb +17 -0
- data/test/test_currency.rb +12 -0
- data/test/test_dizzle_ipsum.rb +36 -0
- data/test/test_education.rb +41 -0
- data/test/test_education_cn.rb +29 -0
- data/test/test_ffaker.rb +41 -0
- data/test/test_filesystem.rb +36 -0
- data/test/test_food.rb +28 -0
- 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 +23 -0
- data/test/test_gender_br.rb +18 -0
- data/test/test_gender_cn.rb +18 -0
- data/test/test_gender_id.rb +18 -0
- 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 +28 -0
- data/test/test_gender_pl.rb +27 -0
- data/test/test_gender_ru.rb +23 -0
- data/test/test_geolocation.rb +37 -0
- data/test/test_guid.rb +14 -0
- data/test/test_healthcare_ipsum.rb +36 -0
- data/test/test_healthcare_ru.rb +19 -0
- data/test/test_hipster_ipsum.rb +38 -0
- data/test/test_html_ipsum.rb +105 -0
- data/test/test_identification.rb +35 -0
- data/test/test_identification_br.rb +46 -0
- data/test/test_identification_co.rb +41 -0
- data/test/test_identification_es.rb +17 -0
- data/test/test_identification_es_cl.rb +17 -0
- data/test/test_identification_es_mx.rb +28 -0
- data/test/test_identification_in.rb +20 -0
- data/test/test_identification_it.rb +34 -0
- data/test/test_identification_kr.rb +17 -0
- 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 +132 -0
- data/test/test_internet_se.rb +78 -0
- data/test/test_job.rb +17 -0
- data/test/test_job_br.rb +17 -0
- data/test/test_job_cn.rb +21 -0
- data/test/test_job_fr.rb +23 -0
- data/test/test_job_it.rb +17 -0
- data/test/test_job_ja.rb +21 -0
- data/test/test_job_kr.rb +21 -0
- data/test/test_job_vn.rb +21 -0
- data/test/test_locale.rb +27 -0
- data/test/test_lorem.rb +58 -0
- data/test/test_lorem_ar.rb +44 -0
- data/test/test_lorem_br.rb +62 -0
- data/test/test_lorem_cn.rb +54 -0
- data/test/test_lorem_fr.rb +48 -0
- data/test/test_lorem_ie.rb +52 -0
- data/test/test_lorem_it.rb +51 -0
- data/test/test_lorem_ja.rb +81 -0
- data/test/test_lorem_kr.rb +56 -0
- data/test/test_lorem_pl.rb +51 -0
- data/test/test_lorem_ru.rb +52 -0
- data/test/test_lorem_ua.rb +52 -0
- data/test/test_module_utils.rb +14 -0
- data/test/test_movie.rb +21 -0
- data/test/test_music.rb +28 -0
- data/test/test_name.rb +138 -0
- data/test/test_name_ar.rb +39 -0
- data/test/test_name_br.rb +70 -0
- data/test/test_name_cn.rb +28 -0
- data/test/test_name_cs.rb +73 -0
- data/test/test_name_da.rb +59 -0
- data/test/test_name_de.rb +25 -0
- data/test/test_name_es.rb +70 -0
- data/test/test_name_fr.rb +52 -0
- data/test/test_name_ga.rb +61 -0
- data/test/test_name_gr.rb +70 -0
- data/test/test_name_id.rb +70 -0
- data/test/test_name_it.rb +53 -0
- data/test/test_name_ja.rb +51 -0
- data/test/test_name_kh.rb +34 -0
- data/test/test_name_kr.rb +28 -0
- data/test/test_name_mx.rb +190 -0
- data/test/test_name_nb.rb +43 -0
- data/test/test_name_nl.rb +25 -0
- data/test/test_name_ph.rb +34 -0
- data/test/test_name_pl.rb +111 -0
- data/test/test_name_ru.rb +76 -0
- data/test/test_name_se.rb +43 -0
- data/test/test_name_sn.rb +92 -0
- data/test/test_name_th.rb +34 -0
- data/test/test_name_th_en.rb +35 -0
- data/test/test_name_tw.rb +28 -0
- data/test/test_name_ua.rb +68 -0
- data/test/test_name_vn.rb +42 -0
- data/test/test_nato_alphabet.rb +42 -0
- data/test/test_number.rb +45 -0
- data/test/test_phone_number.rb +46 -0
- data/test/test_phone_number_au.rb +65 -0
- data/test/test_phone_number_br.rb +63 -0
- data/test/test_phone_number_cu.rb +93 -0
- data/test/test_phone_number_da.rb +47 -0
- data/test/test_phone_number_de.rb +53 -0
- data/test/test_phone_number_fr.rb +57 -0
- data/test/test_phone_number_id.rb +57 -0
- 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 +49 -0
- data/test/test_phone_number_mx.rb +50 -0
- data/test/test_phone_number_nl.rb +36 -0
- 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 +65 -0
- data/test/test_phone_number_sg.rb +52 -0
- data/test/test_phone_number_sn.rb +41 -0
- data/test/test_phone_number_tw.rb +42 -0
- data/test/test_phone_number_ua.rb +38 -0
- data/test/test_products.rb +22 -0
- data/test/test_sem_ver.rb +18 -0
- data/test/test_skill.rb +30 -0
- 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 +17 -0
- data/test/test_ssn.rb +27 -0
- data/test/test_ssn_mx.rb +36 -0
- data/test/test_ssn_se.rb +43 -0
- data/test/test_string.rb +114 -0
- data/test/test_time.rb +101 -0
- data/test/test_tweet.rb +59 -0
- data/test/test_unique_utils.rb +54 -0
- data/test/test_units.rb +37 -0
- data/test/test_units_english.rb +63 -0
- data/test/test_units_metric.rb +63 -0
- data/test/test_vehicle.rb +79 -0
- data/test/test_venue.rb +13 -0
- data/test/test_youtube.rb +28 -0
- metadata +1054 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'random_utils'
|
4
|
+
|
5
|
+
module FFakerTW
|
6
|
+
module ArrayUtils
|
7
|
+
extend RandomUtils
|
8
|
+
|
9
|
+
def self.const_array(argument)
|
10
|
+
array = argument.is_a?(Array) ? argument : argument.to_a
|
11
|
+
array.extend ArrayUtils
|
12
|
+
freeze_all(array)
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.random_pick(array, num)
|
16
|
+
warn '[ArrayUtils.random_pick] is deprecated. Please use the ModuleUtils#fetch_sample method'
|
17
|
+
fetch_sample(array, count: num)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.rand(array)
|
21
|
+
warn '[ArrayUtils.rand] is deprecated. Please use the ModuleUtils#fetch_sample method'
|
22
|
+
fetch_sample(array)
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.freeze_all(array)
|
26
|
+
array.each(&:freeze)
|
27
|
+
array.freeze
|
28
|
+
array
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.shuffle(array)
|
32
|
+
array.sort_by { FFakerTW::Random.rand }
|
33
|
+
end
|
34
|
+
|
35
|
+
def random_pick(num)
|
36
|
+
warn '[ArrayUtils#random_pick] is deprecated. Please use the ModuleUtils#fetch_sample method'
|
37
|
+
ArrayUtils.random_pick(self, num)
|
38
|
+
end
|
39
|
+
|
40
|
+
def rand
|
41
|
+
warn '[ArrayUtils#rand] is deprecated. Please use the ModuleUtils#fetch_sample method'
|
42
|
+
ArrayUtils.rand(self)
|
43
|
+
end
|
44
|
+
|
45
|
+
def freeze_all
|
46
|
+
ArrayUtils.freeze_all(self)
|
47
|
+
end
|
48
|
+
|
49
|
+
def shuffle
|
50
|
+
ArrayUtils.shuffle(self)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'array_utils'
|
4
|
+
require_relative 'random_utils'
|
5
|
+
require_relative 'unique_utils'
|
6
|
+
|
7
|
+
module FFakerTW
|
8
|
+
module ModuleUtils
|
9
|
+
include RandomUtils
|
10
|
+
|
11
|
+
def k(arg)
|
12
|
+
FFakerTW::ArrayUtils.const_array(arg)
|
13
|
+
end
|
14
|
+
|
15
|
+
def const_missing(const_name)
|
16
|
+
if const_name =~ /[a-z]/ # Not a constant, probably a class/module name.
|
17
|
+
super const_name
|
18
|
+
else
|
19
|
+
mod_name = ancestors.first.to_s.split('::').last
|
20
|
+
data_path = "#{FFakerTW::BASE_LIB_PATH}/ffaker/data/#{underscore(mod_name)}/#{underscore(const_name.to_s)}"
|
21
|
+
data = k File.read(data_path, mode: 'r:UTF-8').split("\n")
|
22
|
+
const_set const_name, data
|
23
|
+
data
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def underscore(string)
|
28
|
+
string.gsub(/::/, '/')
|
29
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
30
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
31
|
+
.tr('-', '_')
|
32
|
+
.downcase
|
33
|
+
end
|
34
|
+
|
35
|
+
def unique(max_retries = 10_000)
|
36
|
+
@unique_generator ||= FFakerTW::UniqueUtils.new(self, max_retries)
|
37
|
+
end
|
38
|
+
|
39
|
+
# http://en.wikipedia.org/wiki/Luhn_algorithm
|
40
|
+
def luhn_check(number)
|
41
|
+
multiplications = []
|
42
|
+
|
43
|
+
number.split(//).each_with_index do |digit, i|
|
44
|
+
multiplications << i.even? ? digit.to_i * 2 : digit.to_i
|
45
|
+
end
|
46
|
+
|
47
|
+
sum = 0
|
48
|
+
multiplications.each do |num|
|
49
|
+
num.to_s.each_byte do |character|
|
50
|
+
sum += character.chr.to_i
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
control_digit = (sum % 10).zero? ? 0 : (sum / 10 + 1) * 10 - sum
|
55
|
+
control_digit.to_s
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FFakerTW
|
4
|
+
# Methods for returning repeatably-random data using the internal
|
5
|
+
# Random Number Generator. You should not need to use this directly, it is
|
6
|
+
# automatically included when you `include ModuleUtils` in a FFakerTW module.
|
7
|
+
module RandomUtils
|
8
|
+
# Returns a randon number from the internal Random Number Generator. Can be
|
9
|
+
# used in place of `rand` or `Kernal.rand`.
|
10
|
+
def rand(max = nil)
|
11
|
+
FFakerTW::Random.rand(max)
|
12
|
+
end
|
13
|
+
|
14
|
+
# Performs Array#sample on `list` using a the internal Random Number
|
15
|
+
# Generator so that the results are deterministic.
|
16
|
+
#
|
17
|
+
# * Returns one random item from `list`.
|
18
|
+
# * Pass `count: n` in options argument, where `n` is an integer, to
|
19
|
+
# return *n* items from `list`
|
20
|
+
def fetch_sample(list, options = {})
|
21
|
+
if (count = options.delete(:count))
|
22
|
+
list.sample(count, random: FFakerTW::Random)
|
23
|
+
elsif list.is_a?(Range)
|
24
|
+
FFakerTW::Random.rand(list)
|
25
|
+
else
|
26
|
+
list.sample(random: FFakerTW::Random)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Performs same action as as `Array#suffle` (returns a randomly-reordered
|
31
|
+
# copy of `list`) except that it uses the internal Random Number Generator
|
32
|
+
# so that the results are deterministic.
|
33
|
+
def shuffle(list)
|
34
|
+
list.shuffle(random: FFakerTW::Random)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'set'
|
3
|
+
|
4
|
+
module FFakerTW
|
5
|
+
class UniqueUtils
|
6
|
+
def initialize(generator, max_retries)
|
7
|
+
@generator = generator
|
8
|
+
@max_retries = max_retries
|
9
|
+
@previous_results = Hash.new { |hash, key| hash[key] = Set.new }
|
10
|
+
end
|
11
|
+
|
12
|
+
def method_missing(name, *arguments)
|
13
|
+
@generator.respond_to?(name) ? add_results_to_hash(name, *arguments) : super
|
14
|
+
end
|
15
|
+
|
16
|
+
def respond_to_missing?(method_name, include_private = false)
|
17
|
+
super
|
18
|
+
end
|
19
|
+
|
20
|
+
RetryLimitExceeded = Class.new(StandardError)
|
21
|
+
|
22
|
+
def clear
|
23
|
+
@previous_results.clear
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.clear
|
27
|
+
ObjectSpace.each_object(self, &:clear)
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def add_results_to_hash(name, *arguments)
|
33
|
+
@max_retries.times do
|
34
|
+
result = @generator.send(name, *arguments)
|
35
|
+
|
36
|
+
next if @previous_results[[name, arguments]].include?(result)
|
37
|
+
|
38
|
+
@previous_results[[name, arguments]] << result
|
39
|
+
return result
|
40
|
+
end
|
41
|
+
raise RetryLimitExceeded
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,133 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FFakerTW
|
4
|
+
module Vehicle
|
5
|
+
module VIN
|
6
|
+
extend ModuleUtils
|
7
|
+
extend self
|
8
|
+
|
9
|
+
# https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/World_Manufacturer_Identifier_(WMI)
|
10
|
+
VALID_WMI_REGIONS = [*'A'..'C', *'J'..'Z', *'1'..'9'].freeze
|
11
|
+
|
12
|
+
VALID_YEAR_CHARS = %w[
|
13
|
+
5 6 7 8 9 A B C D E F G H J K L M N P R S T V W X Y 1 2 3 4 5 6 7 8 9
|
14
|
+
].freeze # 2005-2039
|
15
|
+
|
16
|
+
# https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Check_digit
|
17
|
+
TRANSLITERATION_VALUES = {
|
18
|
+
'A' => 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8,
|
19
|
+
'J' => 1, 'K' => 2, 'L' => 3, 'M' => 4, 'N' => 5, 'P' => 7, 'R' => 9,
|
20
|
+
'S' => 2, 'T' => 3, 'U' => 4, 'V' => 5, 'W' => 6, 'X' => 7, 'Y' => 8, 'Z' => 9
|
21
|
+
}.freeze
|
22
|
+
POSITION_WEIGHTS = [8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2].freeze
|
23
|
+
|
24
|
+
VALID_ALPHA = TRANSLITERATION_VALUES.keys
|
25
|
+
VALID_ALPHANUMERIC = [*VALID_ALPHA, *'1'..'9'].freeze
|
26
|
+
|
27
|
+
# Generate a VIN that is compliant with specifications of US Title 49 Section 565.15
|
28
|
+
# https://www.govinfo.gov/content/pkg/CFR-2019-title49-vol6/xml/CFR-2019-title49-vol6-part565.xml#seqnum565.15
|
29
|
+
#
|
30
|
+
# Position Meaning
|
31
|
+
# 1-3 Manufacturer ID aka WMI (alpha and digits)
|
32
|
+
# 4-8 Vehicle Description ("For passenger cars ..[position 7].. shall be alphabetic")
|
33
|
+
# 9 Check Digit (0-9 or "X")
|
34
|
+
# 10 Year (see VIN_VALID_YEARS)
|
35
|
+
# 11 Plant of manufacture (alpha and digits)
|
36
|
+
# 12-17 Serial number (digits only)
|
37
|
+
#
|
38
|
+
# I, O and Q are NOT allowed. VIN_VALID_ALPHA has valid alpha characters.
|
39
|
+
def vin
|
40
|
+
generated_vin = [
|
41
|
+
# Manufacturer ID / WMI
|
42
|
+
fetch_sample(VALID_WMI_REGIONS),
|
43
|
+
fetch_sample(VALID_ALPHANUMERIC, count: 2),
|
44
|
+
# Vehicle Description
|
45
|
+
fetch_sample(VALID_ALPHANUMERIC, count: 3),
|
46
|
+
fetch_sample(VALID_ALPHA),
|
47
|
+
fetch_sample(VALID_ALPHANUMERIC),
|
48
|
+
'0', # check digit placeholder
|
49
|
+
fetch_sample(VALID_YEAR_CHARS), # Year of Manufacture
|
50
|
+
fetch_sample(VALID_ALPHANUMERIC), # Plant ID
|
51
|
+
FFakerTW.numerify('######') # Serial Number
|
52
|
+
].join
|
53
|
+
|
54
|
+
# Calculate the Check Digit
|
55
|
+
weighted_sum = generated_vin.chars.each_with_index.sum do |char, idx|
|
56
|
+
(TRANSLITERATION_VALUES[char.to_sym] || char).to_i * POSITION_WEIGHTS[idx]
|
57
|
+
end
|
58
|
+
|
59
|
+
check_digit = weighted_sum % 11
|
60
|
+
check_digit = 'X' if check_digit == 10
|
61
|
+
generated_vin[8] = check_digit.to_s
|
62
|
+
|
63
|
+
generated_vin
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
extend ModuleUtils
|
68
|
+
extend self
|
69
|
+
|
70
|
+
DRIVETRAINS = %w[4WD 4X4 AWD FWD RWD].freeze
|
71
|
+
YEARS = Array('1900'..(::Time.now.year + 1).to_s).freeze
|
72
|
+
TRANSMISSIONS_ABBR = %w[AT MT AM CVT].freeze
|
73
|
+
CYLINDERS = %w[2 5 6 8].freeze
|
74
|
+
|
75
|
+
def base_color
|
76
|
+
FFakerTW::Color.name
|
77
|
+
end
|
78
|
+
|
79
|
+
def drivetrain
|
80
|
+
fetch_sample(DRIVETRAINS)
|
81
|
+
end
|
82
|
+
|
83
|
+
def make
|
84
|
+
fetch_sample(MAKES_LIST)
|
85
|
+
end
|
86
|
+
|
87
|
+
def manufacturer_color(count = 2)
|
88
|
+
# Take two prefixes because it's more fun than one
|
89
|
+
(fetch_sample(COLOR_PREFIXES, count: count) + [base_color]).join(' ')
|
90
|
+
end
|
91
|
+
alias mfg_color manufacturer_color
|
92
|
+
|
93
|
+
def model
|
94
|
+
fetch_sample(MODELS_LIST)
|
95
|
+
end
|
96
|
+
|
97
|
+
def trim
|
98
|
+
fetch_sample(TRIMS_LIST)
|
99
|
+
end
|
100
|
+
|
101
|
+
def vin
|
102
|
+
VIN.vin
|
103
|
+
end
|
104
|
+
|
105
|
+
def year
|
106
|
+
fetch_sample(YEARS)
|
107
|
+
end
|
108
|
+
|
109
|
+
def transmission
|
110
|
+
fetch_sample(TRANSMISSIONS_LIST)
|
111
|
+
end
|
112
|
+
|
113
|
+
def transmission_abbr
|
114
|
+
fetch_sample(TRANSMISSIONS_ABBR)
|
115
|
+
end
|
116
|
+
|
117
|
+
def engine_cylinders
|
118
|
+
fetch_sample(CYLINDERS)
|
119
|
+
end
|
120
|
+
|
121
|
+
def engine_displacement
|
122
|
+
fetch_sample(DISPLACEMENTS_LIST)
|
123
|
+
end
|
124
|
+
|
125
|
+
def fuel_type
|
126
|
+
fetch_sample(FUEL_TYPES_LIST)
|
127
|
+
end
|
128
|
+
|
129
|
+
def interior_upholstery
|
130
|
+
fetch_sample(UPHOLSTERY_LIST)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FFakerTW
|
4
|
+
module Youtube
|
5
|
+
extend ModuleUtils
|
6
|
+
extend self
|
7
|
+
|
8
|
+
def url
|
9
|
+
"www.youtube.com/watch?v=#{video_id}"
|
10
|
+
end
|
11
|
+
|
12
|
+
def share_url
|
13
|
+
"youtu.be/#{video_id}"
|
14
|
+
end
|
15
|
+
|
16
|
+
def embed_url
|
17
|
+
"www.youtube.com/embed/#{video_id}"
|
18
|
+
end
|
19
|
+
|
20
|
+
def video_id
|
21
|
+
fetch_sample(VIDEO_IDS)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/ffakerTW.rb
ADDED
@@ -0,0 +1,263 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module FFakerTW
|
4
|
+
require_relative 'ffakerTW/utils/array_utils'
|
5
|
+
require_relative 'ffakerTW/utils/module_utils'
|
6
|
+
|
7
|
+
extend ModuleUtils
|
8
|
+
|
9
|
+
BASE_LIB_PATH = File.expand_path(__dir__)
|
10
|
+
|
11
|
+
LETTERS = Array('a'..'z').freeze
|
12
|
+
|
13
|
+
HEX = %w[0 1 2 3 4 5 6 7 8 9 A B C D E F].freeze
|
14
|
+
|
15
|
+
def self.hexify(*masks)
|
16
|
+
fetch_sample(masks.flatten).gsub(/#/) { fetch_sample(HEX) }
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.numerify(*masks)
|
20
|
+
fetch_sample(masks.flatten).gsub(/#/) { rand(0..9).to_s }
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.letterify(*masks)
|
24
|
+
fetch_sample(masks.flatten).gsub(/\?/) { fetch_sample(LETTERS) }
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.bothify(masks)
|
28
|
+
letterify(numerify(masks))
|
29
|
+
end
|
30
|
+
|
31
|
+
autoload :Address, 'ffakerTW/address'
|
32
|
+
autoload :AddressAU, 'ffakerTW/address_au'
|
33
|
+
autoload :AddressBR, 'ffakerTW/address_br'
|
34
|
+
autoload :AddressCA, 'ffakerTW/address_ca'
|
35
|
+
autoload :AddressCH, 'ffakerTW/address_ch'
|
36
|
+
autoload :AddressCHDE, 'ffakerTW/address_ch_de'
|
37
|
+
autoload :AddressCHFR, 'ffakerTW/address_ch_fr'
|
38
|
+
autoload :AddressCHIT, 'ffakerTW/address_ch_it'
|
39
|
+
autoload :AddressDA, 'ffakerTW/address_da'
|
40
|
+
autoload :AddressDE, 'ffakerTW/address_de'
|
41
|
+
autoload :AddressFI, 'ffakerTW/address_fi'
|
42
|
+
autoload :AddressFR, 'ffakerTW/address_fr'
|
43
|
+
autoload :AddressGR, 'ffakerTW/address_gr'
|
44
|
+
autoload :AddressID, 'ffakerTW/address_id'
|
45
|
+
autoload :AddressIN, 'ffakerTW/address_in'
|
46
|
+
autoload :AddressIT, 'ffakerTW/address_it'
|
47
|
+
autoload :AddressJA, 'ffakerTW/address_ja'
|
48
|
+
autoload :AddressKR, 'ffakerTW/address_kr'
|
49
|
+
autoload :AddressMX, 'ffakerTW/address_mx'
|
50
|
+
autoload :AddressNL, 'ffakerTW/address_nl'
|
51
|
+
autoload :AddressPL, 'ffakerTW/address_pl'
|
52
|
+
autoload :AddressRU, 'ffakerTW/address_ru'
|
53
|
+
autoload :AddressSE, 'ffakerTW/address_se'
|
54
|
+
autoload :AddressSN, 'ffakerTW/address_sn'
|
55
|
+
autoload :AddressUA, 'ffakerTW/address_ua'
|
56
|
+
autoload :AddressUK, 'ffakerTW/address_uk'
|
57
|
+
autoload :AddressUS, 'ffakerTW/address_us'
|
58
|
+
autoload :Airline, 'ffakerTW/airline'
|
59
|
+
autoload :Animal, 'ffakerTW/animal'
|
60
|
+
autoload :AnimalBR, 'ffakerTW/animal_br'
|
61
|
+
autoload :AnimalCN, 'ffakerTW/animal_cn'
|
62
|
+
autoload :AnimalES, 'ffakerTW/animal_es'
|
63
|
+
autoload :AnimalPL, 'ffakerTW/animal_pl'
|
64
|
+
autoload :AnimalTW, 'ffakerTW/animal_tw'
|
65
|
+
autoload :AnimalUS, 'ffakerTW/animal_us'
|
66
|
+
autoload :Avatar, 'ffakerTW/avatar'
|
67
|
+
autoload :AWS, 'ffakerTW/aws'
|
68
|
+
autoload :BaconIpsum, 'ffakerTW/bacon_ipsum'
|
69
|
+
autoload :Bank, 'ffakerTW/bank'
|
70
|
+
autoload :Book, 'ffakerTW/book'
|
71
|
+
autoload :Boolean, 'ffakerTW/boolean'
|
72
|
+
autoload :CheesyLingo, 'ffakerTW/cheesy_lingo'
|
73
|
+
autoload :Code, 'ffakerTW/code'
|
74
|
+
autoload :Color, 'ffakerTW/color'
|
75
|
+
autoload :ColorPL, 'ffakerTW/color_pl'
|
76
|
+
autoload :ColorUA, 'ffakerTW/color_ua'
|
77
|
+
autoload :Company, 'ffakerTW/company'
|
78
|
+
autoload :CompanyCN, 'ffakerTW/company_cn'
|
79
|
+
autoload :CompanyFR, 'ffakerTW/company_fr'
|
80
|
+
autoload :CompanyIT, 'ffakerTW/company_it'
|
81
|
+
autoload :CompanyJA, 'ffakerTW/company_ja'
|
82
|
+
autoload :CompanySE, 'ffakerTW/company_se'
|
83
|
+
autoload :CompanyTW, 'ffakerTW/company_tw'
|
84
|
+
autoload :Conference, 'ffakerTW/conference'
|
85
|
+
autoload :CoursesFR, 'ffakerTW/courses_fr'
|
86
|
+
autoload :Currency, 'ffakerTW/currency'
|
87
|
+
autoload :DizzleIpsum, 'ffakerTW/dizzle_ipsum'
|
88
|
+
autoload :Education, 'ffakerTW/education'
|
89
|
+
autoload :EducationCN, 'ffakerTW/education_cn'
|
90
|
+
autoload :EducationTW, 'ffakerTW/education_tw'
|
91
|
+
autoload :Filesystem, 'ffakerTW/filesystem'
|
92
|
+
autoload :Food, 'ffakerTW/food'
|
93
|
+
autoload :FoodPL, 'ffakerTW/food_pl'
|
94
|
+
autoload :FreedomIpsum, 'ffakerTW/freedom_ipsum'
|
95
|
+
autoload :Game, 'ffakerTW/game'
|
96
|
+
autoload :Gender, 'ffakerTW/gender'
|
97
|
+
autoload :GenderBR, 'ffakerTW/gender_br'
|
98
|
+
autoload :GenderCN, 'ffakerTW/gender_cn'
|
99
|
+
autoload :GenderID, 'ffakerTW/gender_id'
|
100
|
+
autoload :GenderIT, 'ffakerTW/gender_it'
|
101
|
+
autoload :GenderJA, 'ffakerTW/gender_ja'
|
102
|
+
autoload :GenderJP, 'ffakerTW/gender_jp'
|
103
|
+
autoload :GenderKR, 'ffakerTW/gender_kr'
|
104
|
+
autoload :GenderPL, 'ffakerTW/gender_pl'
|
105
|
+
autoload :GenderRU, 'ffakerTW/gender_ru'
|
106
|
+
autoload :GenderTW, 'ffakerTW/gender_tw'
|
107
|
+
autoload :Geolocation, 'ffakerTW/geolocation'
|
108
|
+
autoload :Guid, 'ffakerTW/guid'
|
109
|
+
autoload :HealthcareIpsum, 'ffakerTW/healthcare_ipsum'
|
110
|
+
autoload :HealthcareRU, 'ffakerTW/healthcare_ru'
|
111
|
+
autoload :HipsterIpsum, 'ffakerTW/hipster_ipsum'
|
112
|
+
autoload :HTMLIpsum, 'ffakerTW/html_ipsum'
|
113
|
+
autoload :Identification, 'ffakerTW/identification'
|
114
|
+
autoload :IdentificationBR, 'ffakerTW/identification_br'
|
115
|
+
autoload :IdentificationES, 'ffakerTW/identification_es'
|
116
|
+
autoload :IdentificationESCL, 'ffakerTW/identification_es_cl'
|
117
|
+
autoload :IdentificationESCO, 'ffakerTW/identification_es_co'
|
118
|
+
autoload :IdentificationIN, 'ffakerTW/identification_in'
|
119
|
+
autoload :IdentificationIT, 'ffakerTW/identification_it'
|
120
|
+
autoload :IdentificationKr, 'ffakerTW/identification_kr'
|
121
|
+
autoload :IdentificationMX, 'ffakerTW/identification_mx'
|
122
|
+
autoload :IdentificationPL, 'ffakerTW/identification_pl'
|
123
|
+
autoload :IdentificationTW, 'ffakerTW/identification_tw'
|
124
|
+
autoload :Image, 'ffakerTW/image'
|
125
|
+
autoload :Internet, 'ffakerTW/internet'
|
126
|
+
autoload :InternetSE, 'ffakerTW/internet_se'
|
127
|
+
autoload :Job, 'ffakerTW/job'
|
128
|
+
autoload :JobBR, 'ffakerTW/job_br'
|
129
|
+
autoload :JobCN, 'ffakerTW/job_cn'
|
130
|
+
autoload :JobFR, 'ffakerTW/job_fr'
|
131
|
+
autoload :JobIT, 'ffakerTW/job_it'
|
132
|
+
autoload :JobJA, 'ffakerTW/job_ja'
|
133
|
+
autoload :JobKR, 'ffakerTW/job_kr'
|
134
|
+
autoload :JobTW, 'ffakerTW/job_tw'
|
135
|
+
autoload :JobVN, 'ffakerTW/job_vn'
|
136
|
+
autoload :Locale, 'ffakerTW/locale'
|
137
|
+
autoload :Lorem, 'ffakerTW/lorem'
|
138
|
+
autoload :LoremAR, 'ffakerTW/lorem_ar'
|
139
|
+
autoload :LoremBR, 'ffakerTW/lorem_br'
|
140
|
+
autoload :LoremCN, 'ffakerTW/lorem_cn'
|
141
|
+
autoload :LoremFR, 'ffakerTW/lorem_fr'
|
142
|
+
autoload :LoremIE, 'ffakerTW/lorem_ie'
|
143
|
+
autoload :LoremIT, 'ffakerTW/lorem_it'
|
144
|
+
autoload :LoremJA, 'ffakerTW/lorem_ja'
|
145
|
+
autoload :LoremKR, 'ffakerTW/lorem_kr'
|
146
|
+
autoload :LoremPL, 'ffakerTW/lorem_pl'
|
147
|
+
autoload :LoremRU, 'ffakerTW/lorem_ru'
|
148
|
+
autoload :LoremTW, 'ffakerTW/lorem_tw'
|
149
|
+
autoload :LoremUA, 'ffakerTW/lorem_ua'
|
150
|
+
autoload :Movie, 'ffakerTW/movie'
|
151
|
+
autoload :Music, 'ffakerTW/music'
|
152
|
+
autoload :Name, 'ffakerTW/name'
|
153
|
+
autoload :NameAR, 'ffakerTW/name_ar'
|
154
|
+
autoload :NameBR, 'ffakerTW/name_br'
|
155
|
+
autoload :NameTW, 'ffakerTW/name_tw'
|
156
|
+
autoload :NameCS, 'ffakerTW/name_cs'
|
157
|
+
autoload :NameDA, 'ffakerTW/name_da'
|
158
|
+
autoload :NameDE, 'ffakerTW/name_de'
|
159
|
+
autoload :NameES, 'ffakerTW/name_es'
|
160
|
+
autoload :NameFR, 'ffakerTW/name_fr'
|
161
|
+
autoload :NameGA, 'ffakerTW/name_ga'
|
162
|
+
autoload :NameGR, 'ffakerTW/name_gr'
|
163
|
+
autoload :NameID, 'ffakerTW/name_id'
|
164
|
+
autoload :NameIN, 'ffakerTW/name_in'
|
165
|
+
autoload :NameIT, 'ffakerTW/name_it'
|
166
|
+
autoload :NameJA, 'ffakerTW/name_ja'
|
167
|
+
autoload :NameKH, 'ffakerTW/name_kh'
|
168
|
+
autoload :NameKR, 'ffakerTW/name_kr'
|
169
|
+
autoload :NameMX, 'ffakerTW/name_mx'
|
170
|
+
autoload :NameNB, 'ffakerTW/name_nb'
|
171
|
+
autoload :NameNL, 'ffakerTW/name_nl'
|
172
|
+
autoload :NamePH, 'ffakerTW/name_ph'
|
173
|
+
autoload :NamePL, 'ffakerTW/name_pl'
|
174
|
+
autoload :NameRU, 'ffakerTW/name_ru'
|
175
|
+
autoload :NameSE, 'ffakerTW/name_se'
|
176
|
+
autoload :NameSN, 'ffakerTW/name_sn'
|
177
|
+
autoload :NameTH, 'ffakerTW/name_th'
|
178
|
+
autoload :NameTW, 'ffakerTW/name_tw'
|
179
|
+
autoload :NameTHEN, 'ffakerTW/name_th_en'
|
180
|
+
autoload :NameUA, 'ffakerTW/name_ua'
|
181
|
+
autoload :NameVN, 'ffakerTW/name_vn'
|
182
|
+
autoload :NatoAlphabet, 'ffakerTW/nato_alphabet'
|
183
|
+
autoload :Number, 'ffakerTW/number'
|
184
|
+
autoload :PhoneNumber, 'ffakerTW/phone_number'
|
185
|
+
autoload :PhoneNumberAU, 'ffakerTW/phone_number_au'
|
186
|
+
autoload :PhoneNumberBR, 'ffakerTW/phone_number_br'
|
187
|
+
autoload :PhoneNumberCH, 'ffakerTW/phone_number_ch'
|
188
|
+
autoload :PhoneNumberCU, 'ffakerTW/phone_number_cu'
|
189
|
+
autoload :PhoneNumberDA, 'ffakerTW/phone_number_da'
|
190
|
+
autoload :PhoneNumberDE, 'ffakerTW/phone_number_de'
|
191
|
+
autoload :PhoneNumberFR, 'ffakerTW/phone_number_fr'
|
192
|
+
autoload :PhoneNumberID, 'ffakerTW/phone_number_id'
|
193
|
+
autoload :PhoneNumberIT, 'ffakerTW/phone_number_it'
|
194
|
+
autoload :PhoneNumberJA, 'ffakerTW/phone_number_ja'
|
195
|
+
autoload :PhoneNumberKR, 'ffakerTW/phone_number_kr'
|
196
|
+
autoload :PhoneNumberMX, 'ffakerTW/phone_number_mx'
|
197
|
+
autoload :PhoneNumberNL, 'ffakerTW/phone_number_nl'
|
198
|
+
autoload :PhoneNumberPL, 'ffakerTW/phone_number_pl'
|
199
|
+
autoload :PhoneNumberSE, 'ffakerTW/phone_number_se'
|
200
|
+
autoload :PhoneNumberSG, 'ffakerTW/phone_number_sg'
|
201
|
+
autoload :PhoneNumberSN, 'ffakerTW/phone_number_sn'
|
202
|
+
autoload :PhoneNumberTW, 'ffakerTW/phone_number_tw'
|
203
|
+
autoload :PhoneNumberUA, 'ffakerTW/phone_number_ua'
|
204
|
+
autoload :PhoneNumberRU, 'ffakerTW/phone_number_ru'
|
205
|
+
autoload :Product, 'ffakerTW/product'
|
206
|
+
autoload :SemVer, 'ffakerTW/sem_ver'
|
207
|
+
autoload :Skill, 'ffakerTW/skill'
|
208
|
+
autoload :Sport, 'ffakerTW/sport'
|
209
|
+
autoload :SportPL, 'ffakerTW/sport_pl'
|
210
|
+
autoload :SportUS, 'ffakerTW/sport_us'
|
211
|
+
autoload :SportRU, 'ffakerTW/sport_ru'
|
212
|
+
autoload :SSN, 'ffakerTW/ssn'
|
213
|
+
autoload :SSNMX, 'ffakerTW/ssn_mx'
|
214
|
+
autoload :SSNSE, 'ffakerTW/ssn_se'
|
215
|
+
autoload :String, 'ffakerTW/string'
|
216
|
+
autoload :Time, 'ffakerTW/time'
|
217
|
+
autoload :Tweet, 'ffakerTW/tweet'
|
218
|
+
autoload :Unit, 'ffakerTW/unit'
|
219
|
+
autoload :UnitEnglish, 'ffakerTW/unit_english'
|
220
|
+
autoload :UnitMetric, 'ffakerTW/unit_metric'
|
221
|
+
autoload :VERSION, 'version'
|
222
|
+
autoload :Vehicle, 'ffakerTW/vehicle'
|
223
|
+
autoload :Venue, 'ffakerTW/venue'
|
224
|
+
autoload :Youtube, 'ffakerTW/youtube'
|
225
|
+
|
226
|
+
# Random Number Generator (RNG) used with ModuleUtils#fetch, #shuffle, #rand
|
227
|
+
# in order to provide deterministic repeatability.
|
228
|
+
module Random
|
229
|
+
# Returns the current RNG seed.
|
230
|
+
def self.seed
|
231
|
+
@seed ||= ::Random.new_seed
|
232
|
+
end
|
233
|
+
|
234
|
+
# Sets the RNG seed and creates a new internal RNG.
|
235
|
+
def self.seed=(new_seed)
|
236
|
+
@seed = new_seed
|
237
|
+
reset!
|
238
|
+
new_seed
|
239
|
+
end
|
240
|
+
|
241
|
+
# Reset the RNG back to its initial state.
|
242
|
+
def self.reset!
|
243
|
+
@rng = new_rng
|
244
|
+
end
|
245
|
+
|
246
|
+
# Returns a random number using an RNG with a known seed.
|
247
|
+
def self.rand(max = nil)
|
248
|
+
return rng.rand(max) if max
|
249
|
+
|
250
|
+
rng.rand
|
251
|
+
end
|
252
|
+
|
253
|
+
# Returns the current Random object.
|
254
|
+
def self.rng
|
255
|
+
@rng ||= new_rng
|
256
|
+
end
|
257
|
+
|
258
|
+
# Returns a new Random object instantiated with #seed.
|
259
|
+
def self.new_rng
|
260
|
+
::Random.new(seed)
|
261
|
+
end
|
262
|
+
end
|
263
|
+
end
|
data/lib/version.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'benchmark'
|
4
|
+
|
5
|
+
NAMES_COUNT = 10_000
|
6
|
+
|
7
|
+
def run(name)
|
8
|
+
Benchmark.bm do |rep|
|
9
|
+
rep.report("generating #{NAMES_COUNT} names (#{name})") do
|
10
|
+
mod = name == 'ffakertw' ? FFakerTW : Faker
|
11
|
+
NAMES_COUNT.times { mod::Name.name }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
%w[faker ffakerTW].each do |gem_name|
|
17
|
+
require gem_name
|
18
|
+
|
19
|
+
fork { run(gem_name) }
|
20
|
+
Process.wait
|
21
|
+
end
|
data/scripts/profile.sh
ADDED