faker_extension_fr 0.0.12 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,39 +24,29 @@ module Faker
24
24
  end
25
25
 
26
26
  def fr_zip_and_city
27
- region = rand(1..22)
28
- fr_zip_and_city_in_region(region-1)
27
+ fr_zip_and_city_in_region(Fr_Regions.keys.sample)
29
28
  end
30
29
 
31
30
  def fr_zip_and_city_in_region(region=nil)
32
- region = rand(1..22) if (region.nil? || region.to_i < 1 || region.to_i > 22)
33
- area = Fr_Regions[region - 1].sample
34
- fr_zip_and_city_in_area(area) # sending a string
31
+ region = "%02d" % region if region.is_a?(Integer)
32
+ region = Fr_Regions.keys.sample if region.nil? || !Fr_Regions.keys.include?(region)
33
+ departement = Fr_Regions[region].sample
34
+ fr_zip_and_city_in_departement(departement)
35
35
  end
36
36
 
37
- def fr_zip_and_city_in_area(area=nil)
38
- area = %w{2A 2B}.sample if area == "20" || area == 20
39
- if area.nil? || area.is_a?(Integer)
40
- area = "%02d" % rand(1..95) if (area.nil? || area.to_i < 1 || area.to_i > 95)
41
- area = %w{2A 2B}.sample if area == "20" || area == 20
42
- elsif Fr_zip_cities[area].nil?
43
- area = "%02d" % rand(1..95)
44
- area = %w{2A 2B}.sample if area == "20" || area == 20
45
- end
46
- Fr_zip_cities[area].sample
37
+ def fr_zip_and_city_in_departement(departement=nil)
38
+ departement = %w{2A 2B}.sample if departement == "20" || departement == 20 # Corsica special case
39
+ departement = "%02d" % departement if departement.is_a?(Integer)
40
+ departement = Fr_Departements.sample if departement.nil? || !Fr_Departements.include?(departement)
41
+ Fr_zip_cities[departement].sample
47
42
  end
48
43
 
49
44
  Fr_street_prefix = ["rue", "place", "boulevard", "avenue", "impasse", "chemin"]
50
45
  Fr_street_root = ["Agatha Christie", "Agrippa d'Aubigné", "Alain Fournier", "Alain René Lesage", "Alain Robbe-Grillet", "Albert Camus", "Albert Cohen", "Albrecht Altdorfer", "Albrecht Dürer", "Alphonse Allais", "Alphonse Daudet", "Anacréon", "Andersen", "Andra del Verrochio", "André Breton", "André Chouraqui", "André Derain", "André Malraux", "André Masson", "Andrea del sarto", "Andrea Mantegna", "Andrée Chedid", "Andy Warhol", "Anthony Burgess", "Antoine Pevsner", "Antoine Van Dyck", "Antoine Watteau", "Anton Tchekhov", "Antonin Artaud", "Arcimboldo", "Aristophane", "August Strindberg", "Auguste Renoir", "Balthus", "Barbey d'Aurevilly", "Beaumarchais", "Bellini", "Benjamin Constant", "Bernardin de Saint-Pierre", "Bertolt Brecht", "Blaise Cendrars", "Boccace", "Boris Vian", "Bossuet", "Camille Pissarro", "Canaletto", "Casanova", "Caspar David Friedrich", "Céline", "Chamfort", "Chandler", "Charles Le Brun", "Charles-Ferdinand Ramuz", "Charlotte Brontë", "Claude Crébillon", "Colette", "Constant Permeke", "Curzio Malaparte", "Cyrano de Bergerac", "Dante Alighieri", "de l'Isle-Adam", "Diego Velázquez", "Dubuffet", "Edmond Rostand", "Edouard Manet", "Edouard Vuillard", "Elie Wiesel", "Elizabeth Vigée-Lebrun", "Elsa Triolet", "Emil Michel Cioran", "Émile Littré", "Emile Verhaeren", "Emile Zola", "Emily Brontë", "Ernest Renan", "Eugène Boudin", "Eugène Sue", "Félix Lope de Vega", "Félix Valloton", "Fenimore Cooper", "Fernand Léger", "Filippo Lippi", "Flora Tristan", "Fra Angelico", "Fragonard", "Francis Bacon", "Francis Picabia", "Frank Kupka", "Frank Wedekind", "Frédéric Dard", "Gabriele D'Annunzio", "Gaston Leroux", "Georg Büchner", "George Sand", "Georges Bataille", "Georges Bernanos", "Georges Braque", "Georges Courteline", "Georges De La Tour", "Géricault", "Ghirlandajo", "Giorgione", "Goethe", "Guido René", "Hans Arp", "Hector Malot", "Henri Matisse", "Henri-Frédéric Amiel", "Henry Barbusse", "Herbert George Wells", "Hervé Bazin", "Honoré d'Urfé", "Honoré de Balzac", "Isaac Asimov", "Italo Calvino", "Italo Svevo", "Ivan Tourgueniev", "Jack London", "Jackson Pollock", "Jacques Amyot", "Jacques Audiberti", "Jacques Callot", "James Ensor", "James Whistler", "Jan Van Eyck", "Jean Anouilh", "Jean Cocteau", "Jean Fouquet", "Jean Lurçat", "Jean-Baptiste Oudry", "Jean-François Regnard", "Jean-Jacques Rousseau", "Jean-Paul Delvaux", "Jérôme Bosch", "Jonathan Swift", "Jorge Luis Borges", "Joseph Conrad", "Joshua Reynolds", "Jules Renard", "Jules Supervielle", "Jules Vallès", "Jules Verne", "Karel Capek", "Kazimir Malevitch", "Le Lorrain", "Le Primatice", "Le Tintoret", "Léon Bloy", "Léon Tolstoï", "Léonard de Vinci", "Lessing", "Lewis Carroll", "Lorenzetti", "Louis Abel-Truchet", "Louis Aragon", "Marc Levy", "Marcel Aymé", "Marcel Duchamp", "Marguerite Yourcenar", "Mario Vargas Llosa", "Mark Twain", "Maurice Barrès", "Maurice de Vlaminck", "Maurice Denis", "Maurice Maeterlinck", "Maurice Quentin De La Tour", "Maurice Utrillo", "Max Ernst", "Michel Butor", "Michel Leiris", "Michel Tournier", "Miguel De Cervantès", "Mikhaïl Boulgakov", "Mikhaïl Lermontov", "Nadjib Mahfuz", "Nathalie Sarraute", "Nicolas Boileau", "Nicolas Poussin", "Nicolas Restif de la Bretonne", "Odilon Redon", "Oscar Wilde", "Pablo Picasso", "Paolo Ucello", "Paul Gauguin", "Paul Scarron", "Paul Valéry", "Pedro Calderón", "Pierre Alechinsky", "Pierre Bayle", "Pierre Bonnard", "Pierre Corneille", "Pierre Loti", "Pierre Mac Orlan", "Pieter Bruegel", "Pisanello", "Primo Levi", "R.D. Bradbury", "Raoul Dufy", "Raphaël", "Rembrandt", "René Magritte", "Richard Wright", "Robert Rauschenberg", "Rogier Van der Weyden", "Roland Barthes", "Romain Rolland", "Saint-Evremond", "Saint-Simon", "Sainte-Beuve", "Samuel Beckett", "Samuel Richardson", "Sandro Botticelli", "Ségur", "Serge Poliakoff", "Sévigné", "Simon Vouet", "Simone de Beauvoir", "Edward Burne-Jones", "Walter Scott", "Stefan Zweig", "Tahar Ben Jelloun", "Tennessee Williams", "Thomas Gainsborough", "Thomas Mann", "Thoreau", "Tirso de Molina", "Tolkien", "Tomas Bernhard", "Tommaso Masaccio", "Toulouse-Lautrec", "Tristan Tzara", "Van Loo", "Vercors", "Vermeer", "Véronèse", "Victor Segalen", "Vincent Van Gogh", "Virginia Woolf", "Vittorio Alfieri", "Voltaire", "Wieland", "William Burroughs", "William Butler Yeats", "William Turner"]
46
+ Fr_Regions = {"42" => ["67", "68"],"72" => ["24", "33", "40", "47", "64"],"83" => ["03", "15", "43", "63"], "25" => ["14", "50", "61"],"26" => ["21", "58", "71", "89"],"53" => ["22", "29", "35", "56"],"24" => ["18", "28", "36", "37", "41", "45"],"21" => ["08", "10", "51", "52"],"94" => ["2A", "2B"],"43" => ["25", "39", "70", "90"],"11" => ["75", "77", "78", "91", "92","93","94","95"],"91" => ["11", "30", "34", "48", "66"],"74" => ["19", "23", "87"],"41" => ["54", "55", "57", "88"],"73" => ["09", "12", "31", "32", "46", "65", "81", "82"],"15" => ["59", "62"],"23" => ["27", "76"],"52" => ["44", "49", "53", "72", "85"],"22" => ["02", "60", "80"],"54" => ["16", "17", "79", "86"], "93" => ["04", "05", "06", "13", "83", "84"],"82" => ["01", "07", "26", "38", "42", "69", "73", "74"]}
47
+ Fr_Departements = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "2A", "2B"]
51
48
 
52
- Fr_Regions = [
53
- ["67", "68"],["24", "33", "40", "47", "64"],["03", "15", "43", "63"], ["21", "58", "71", "89"],["22", "29", "35", "56"],["18", "28", "36", "37", "41", "45"],
54
- ["08", "10", "51", "52"],["2A", "2B"],["25", "39", "70", "90"],["75", "77", "78", "91", "92","93","94","95"],["11", "30", "34", "48", "66"],["19", "23", "87"],
55
- ["54", "55", "57", "88"],["09", "12", "31", "32", "46", "65", "81", "82"],["59", "62"],["14", "50", "61"],["27", "76"],
56
- ["44", "49", "53", "72", "85"],["02", "60", "80"],["16", "17", "79", "86"], ["04", "05", "06", "13", "83", "84"],["01", "07", "26", "38", "42", "69", "73", "74"]
57
- ]
58
-
59
- Fr_zip_cities = {
49
+ Fr_zip_cities = {
60
50
  "67" => [ ["67110", "Zinswiller", "48.9198", "7.5898", "3"], ["67112", "Breuschwickersheim", "48.5801", "7.6016", "3"], ["67113", "Blaesheim", "48.5065", "7.6092", "3"], ["67115", "Plobsheim", "48.4698", "7.7244", "3"], ["67116", "Reichstett", "48.6486", "7.7545", "3"], ["67117", "Fessenheim-le-Bas", "48.6341", "7.5429", "3"], ["67118", "Geispolsheim", "48.5166", "7.6467", "3"], ["67120", "Dorlisheim", "48.5248", "7.4862", "3"], ["67130", "Grandfontaine", "48.4935", "7.1608", "3"], ["67140", "Le Hohwald", "48.4037", "7.3291", "3"], ["67150", "Uttenheim", "48.4105", "7.5972", "3"], ["67160", "Drachenbronn-Birlenbach", "48.9833", "7.8667", "3"], ["67170", "Hohatzenheim", "48.7159", "7.6143", "3"], ["67190", "Grendelbruch", "48.4927", "7.3224", "3"], ["67201", "Eckbolsheim", "48.5808", "7.6877", "3"], ["67202", "Wolfisheim", "48.5872", "7.6671", "3"], ["67203", "Oberschaeffolsheim", "48.5864", "7.6502", "3"], ["67205", "Oberhausbergen", "48.6061", "7.6885", "3"], ["67206", "Mittelhausbergen", "48.6144", "7.6901", "3"], ["67210", "Bernardswiller", "48.4521", "7.4617", "3"], ["67220", "Urbeis", "48.3247", "7.2264", "3"], ["67230", "Sermersheim", "48.3458", "7.5525", "3"], ["67240", "Kurtzenhouse", "48.74", "7.8045", "3"], ["67250", "Preuschdorf", "48.9443", "7.8002", "3"], ["67260", "Altwiller", "48.9292", "6.9804", "3"], ["67260", "Diedendorf", "48.8794", "7.0462", "3"], ["67270", "Geiswiller", "48.7884", "7.5038", "3"], ["67280", "Urmatt", "48.5275", "7.3256", "3"], ["67290", "Lohr", "48.8574", "7.2439", "3"], ["67300", "Schiltigheim", "48.6075", "7.7493", "3"], ["67310", "Allenwiller", "48.6549", "7.3755", "3"], ["67320", "Kirrberg", "48.8226", "7.0654", "3"], ["67330", "Dossenheim-sur-Zinsel", "48.8059", "7.4027", "3"], ["67340", "Weiterswiller", "48.8539", "7.4134", "3"], ["67350", "Mulhausen", "48.8833", "7.55", "3"], ["67360", "Frœschwiller", "48.95", "7.7167", "3"], ["67370", "Willgottheim", "48.6703", "7.5115", "3"], ["67380", "Lingolsheim", "48.5575", "7.6825", "3"], ["67390", "Elsenheim", "48.1617", "7.4982", "3"], ["67400", "Illkirch-Graffenstaden", "48.5289", "7.7152", "3"], ["67410", "Rohrwiller", "48.7571", "7.9055", "3"], ["67420", "Saales", "48.3483", "7.1069", "3"], ["67430", "Vœllerdingen", "48.9667", "7.1333", "3"], ["67440", "Reinhardsmunster", "48.6771", "7.3173", "3"], ["67450", "Lampertheim", "48.6517", "7.6991", "3"], ["67460", "Souffelweyersheim", "48.6354", "7.7414", "3"], ["67470", "Buhl", "48.9165", "8.0058", "3"], ["67480", "Rountzenheim", "48.8208", "8.0056", "3"], ["67490", "Altenheim", "48.7196", "7.4627", "3"], ["67500", "Batzendorf", "48.7833", "7.7068", "3"], ["67510", "Obersteinbach", "49.0357", "7.6882", "3"], ["67520", "Wangen", "48.6181", "7.4657", "3"], ["67530", "Saint-Nabor", "48.4466", "7.4232", "3"], ["67550", "Eckwersheim", "48.6817", "7.6969", "3"], ["67560", "Rosenwiller", "48.5052", "7.4385", "3"], ["67570", "Rothau", "48.4569", "7.2077", "3"], ["67580", "Mietesheim", "48.8791", "7.6428", "3"], ["67590", "Wintershouse", "48.7924", "7.7007", "3"], ["67600", "Orschwiller", "48.2416", "7.3845", "3"], ["67610", "La Wantzenau", "48.6579", "7.8307", "3"], ["67620", "Soufflenheim", "48.8303", "7.9627", "3"], ["67630", "Niederlauterbach", "48.9711", "8.0981", "3"], ["67640", "Lipsheim", "48.4916", "7.6675", "3"], ["67650", "Blienschwiller", "48.3412", "7.4174", "3"], ["67660", "Betschdorf", "48.9", "7.9", "3"], ["67670", "Waltenheim-sur-Zorn", "48.7461", "7.6292", "3"], ["67680", "Nothalten", "48.3513", "7.4198", "3"], ["67690", "Hatten", "48.9012", "7.9797", "3"], ["67700", "Haegen", "48.7149", "7.3391", "3"], ["67720", "Bietlenheim", "48.7188", "7.7816", "3"], ["67730", "La Vancelle", "48.2854", "7.3014", "3"], ["67750", "Scherwiller", "48.2871", "7.4214", "3"], ["67760", "Gambsheim", "48.6921", "7.8829", "3"], ["67770", "Sessenheim", "48.7997", "7.9842", "3"], ["67790", "Steinbourg", "48.7703", "7.4135", "3"], ["67800", "Bischheim", "48.6161", "7.7534", "3"], ["67810", "Holtzheim", "48.5582", "7.6443", "3"], ["67850", "Herrlisheim", "48.7305", "7.9053", "3"], ["67860", "Friesenheim", "48.3093", "7.6709", "3"], ["67880", "Krautergersheim", "48.4763", "7.5672", "3"], ["67920", "Sundhouse", "48.2515", "7.6036", "3"], ["67930", "Kesseldorf", "48.8753", "8.0693", "3"], ["67960", "Entzheim", "48.5322", "7.6333", "3"], ["67980", "Hangenbieten", "48.5599", "7.6146", "3"], ["67990", "Osthoffen", "48.5869", "7.5561", "3"]],
61
51
  "68" => [["68000", "Colmar", "48.0833", "7.3667", "3"], ["68100", "Mulhouse", "47.75", "7.3333", "3"], ["68110", "Illzach", "47.7809", "7.3466", "3"], ["68116", "Guewenheim", "47.7528", "7.0925", "3"], ["68118", "Hirtzbach", "47.5962", "7.2204", "3"], ["68120", "Richwiller", "47.7795", "7.2822", "3"], ["68124", "Wintzenheim", "48.0727", "7.2907", "3"], ["68125", "Houssen", "48.1258", "7.3784", "3"], ["68126", "Bennwihr", "48.1446", "7.3244", "3"], ["68127", "Niederentzen", "47.9479", "7.3809", "3"], ["68128", "Village-Neuf", "47.5902", "7.5702", "3"], ["68130", "Carspach", "47.6163", "7.2115", "3"], ["68140", "Soultzeren", "48.0621", "7.1021", "3"], ["68150", "Aubure", "48.1976", "7.2216", "3"], ["68160", "Sainte-Marie-aux-Mines", "48.2468", "7.1853", "3"], ["68170", "Rixheim", "47.7514", "7.4009", "3"], ["68180", "Horbourg-Wihr", "48.0811", "7.3938", "3"], ["68200", "Mulhouse", "47.75", "7.3333", "3"], ["68210", "Montreux-Jeune", "47.6122", "7.0326", "3"], ["68220", "Knœringue", "47.5667", "7.4", "3"], ["68230", "Soultzbach-les-Bains", "48.0376", "7.2033", "3"], ["68240", "Fréland", "48.1722", "7.1917", "3"], ["68250", "Westhalten", "47.9573", "7.26", "3"], ["68260", "Kingersheim", "47.7926", "7.3349", "3"], ["68270", "Ruelisheim", "47.8231", "7.3594", "3"], ["68280", "Logelheim", "48.0203", "7.4074", "3"], ["68290", "Sewen", "47.8072", "6.9057", "3"], ["68300", "Saint-Louis", "47.5884", "7.5625", "3"], ["68310", "Wittelsheim", "47.8095", "7.2415", "3"], ["68320", "Holtzwihr", "48.1128", "7.4205", "3"], ["68330", "Huningue", "47.6048", "7.5778", "3"], ["68340", "Riquewihr", "48.1667", "7.2971", "3"], ["68350", "Didenheim", "47.7174", "7.3022", "3"], ["68360", "Soultz-Haut-Rhin", "47.8874", "7.2304", "3"], ["68370", "Orbey", "48.1265", "7.1645", "3"], ["68380", "Mittlach", "48.0042", "7.0307", "3"], ["68390", "Sausheim", "47.7898", "7.3713", "3"], ["68400", "Riedisheim", "47.7476", "7.3666", "3"], ["68410", "Ammerschwihr", "48.1255", "7.2828", "3"], ["68420", "Husseren-les-Châteaux", "48.0353", "7.2802", "3"], ["68440", "Bruebach", "47.7012", "7.3588", "3"], ["68470", "Storckensohn", "47.8789", "6.9575", "3"], ["68480", "Pfetterhouse", "47.5006", "7.1654", "3"], ["68490", "Hombourg", "47.7581", "7.5056", "3"], ["68500", "Rimbach-près-Guebwiller", "47.9027", "7.1539", "3"], ["68510", "Rantzwiller", "47.6519", "7.3771", "3"], ["68520", "Burnhaupt-le-Haut", "47.7294", "7.1461", "3"], ["68530", "Murbach", "47.9232", "7.1556", "3"], ["68540", "Bollwiller", "47.8583", "7.2618", "3"], ["68550", "Saint-Amarin", "47.8734", "7.0319", "3"], ["68560", "Hirsingue", "47.5865", "7.2513", "3"], ["68570", "Osenbach", "47.9856", "7.2179", "3"], ["68580", "Hindlingen", "47.5715", "7.1373", "3"], ["68590", "Thannenkirch", "48.2325", "7.3021", "3"], ["68600", "Hettenschlag", "48.0049", "7.4559", "3"], ["68610", "Linthal", "47.9526", "7.1251", "3"], ["68620", "Bitschwiller-lès-Thann", "47.8286", "7.0807", "3"], ["68630", "Mittelwihr", "48.1464", "7.3235", "3"], ["68640", "Feldbach", "47.5358", "7.2643", "3"], ["68650", "Le Bonhomme", "48.1714", "7.1163", "3"], ["68660", "Rombach-le-Franc", "48.2813", "7.2638", "3"], ["68680", "Kembs", "47.6895", "7.5032", "3"], ["68690", "Moosch", "47.8597", "7.0501", "3"], ["68700", "Michelbach", "47.7619", "7.1171", "3"], ["68720", "Eglingen", "47.6635", "7.1813", "3"], ["68730", "Ranspach-le-Bas", "47.5878", "7.4455", "3"], ["68740", "Hirtzfelden", "47.9108", "7.4467", "3"], ["68760", "Willer-sur-Thur", "47.8439", "7.0722", "3"], ["68770", "Ammerschwihr", "48.1255", "7.2828", "3"], ["68780", "Mortzwiller", "47.74", "7.0388", "3"], ["68790", "Morschwiller-le-Bas", "47.7361", "7.2669", "3"], ["68800", "Rammersmatt", "47.7902", "7.0713", "3"], ["68820", "Wildenstein", "47.9764", "6.9617", "3"], ["68830", "Oderen", "47.9105", "6.9747", "3"], ["68840", "Pulversheim", "47.8375", "7.3012", "3"], ["68850", "Staffelfelden", "47.8265", "7.2523", "3"], ["68870", "Brinckheim", "47.6268", "7.4593", "3"], ["68890", "Réguisheim", "47.9", "7.35", "3"], ["68910", "Labaroche", "48.1108", "7.1924", "3"], ["68920", "Wintzenheim", "48.0727", "7.2907", "3"], ["68950", "Reiningue", "47.7505", "7.2325", "3"], ["68960", "Henflingen", "47.5739", "7.2881", "3"], ["68970", "Guémar", "48.1887", "7.3971", "3"], ["68980", "Beblenheim", "48.1572", "7.3271", "3"], ["68990", "Galfingue", "47.7059", "7.2228", "3"]],
62
52
  "24" => [["24000", "Périgueux", "45.1833", "0.7167", "5"], ["24100", "Lembras", "44.8843", "0.5266", "5"], ["24110", "Léguillac-de-l'Auche", "45.1833", "0.55", "5"], ["24120", "Châtres", "45.1896", "1.2048", "5"], ["24130", "Bosset", "44.95", "0.35", "5"], ["24140", "Jaure", "45.0578", "0.5546", "5"], ["24150", "Pressignac-Vicq", "44.9", "0.7167", "5"], ["24160", "Clermont-d'Excideuil", "45.3658", "1.0515", "5"], ["24170", "Siorac-en-Périgord", "44.8218", "0.9873", "5"], ["24190", "Chantérac", "45.1727", "0.4462", "5"], ["24200", "Marcillac-Saint-Quentin", "44.9667", "1.2333", "5"], ["24210", "Brouchaud", "45.2062", "0.9982", "5"], ["24220", "Meyrals", "44.8984", "1.0637", "5"], ["24230", "Saint-Vivien", "44.8833", "0.1167", "5"], ["24240", "Razac-de-Saussignac", "44.8048", "0.2845", "5"], ["24250", "La Roque-Gageac", "44.8251", "1.1834", "5"], ["24260", "Saint-Félix-de-Reillac-et-Mortemart", "45.0209", "0.9108", "5"], ["24270", "Sarlande", "45.4512", "1.1173", "5"], ["24290", "Valojoulx", "45.1167", "1.15", "5"], ["24300", "Augignac", "45.5897", "0.6996", "5"], ["24310", "Saint-Crépin-de-Richemont", "45.4173", "0.6002", "5"], ["24320", "Vendoire", "45.4167", "0.3", "5"], ["24330", "Blis-et-Born", "45.1813", "0.9064", "5"], ["24340", "Les Graulges", "45.4953", "0.4423", "5"], ["24350", "Creyssac", "45.3076", "0.5525", "5"], ["24360", "Busserolles", "45.6769", "0.6424", "5"], ["24370", "Orliaguet", "44.9167", "1.35", "5"], ["24380", "Chalagnac", "45.0919", "0.6772", "5"], ["24390", "Cherveix-Cubas", "45.2899", "1.1158", "5"], ["24400", "Saint-Étienne-de-Puycorbier", "45.1", "0.3333", "5"], ["24410", "Saint-Antoine-Cumond", "45.2667", "0.2", "5"], ["24420", "Coulaures", "45.3064", "0.9797", "5"], ["24430", "Marsac-sur-l'Isle", "45.1833", "0.6667", "5"], ["24440", "Monsac", "44.7797", "0.6974", "5"], ["24450", "Firbeix", "45.6009", "0.9757", "5"], ["24460", "Négrondes", "45.3432", "0.8652", "5"], ["24470", "Saint-Saud-Lacoussière", "45.5439", "0.8187", "5"], ["24480", "Alles-sur-Dordogne", "44.85", "0.8667", "5"], ["24490", "La Roche-Chalais", "45.15", "0.0167", "5"], ["24500", "Singleyrac", "44.7365", "0.4652", "5"], ["24510", "Saint-Laurent-des-Bâtons", "44.9588", "0.7377", "5"], ["24520", "Liorac-sur-Louyre", "44.9", "0.65", "5"], ["24530", "Quinsac", "45.4293", "0.7066", "5"], ["24540", "Saint-Romain-de-Monpazier", "44.7196", "0.8794", "5"], ["24550", "Campagnac-lès-Quercy", "44.6942", "1.1741", "5"], ["24560", "Saint-Aubin-de-Lanquais", "44.7929", "0.5979", "5"], ["24570", "Le Lardin-Saint-Lazare", "45.1333", "1.2167", "5"], ["24580", "Rouffignac-Saint-Cernin-de-Reilhac", "45.05", "0.9667", "5"], ["24590", "Jayac", "45.0311", "1.3448", "5"], ["24600", "Celles", "45.2973", "0.4132", "5"], ["24610", "Minzac", "44.9667", "0.05", "5"], ["24620", "Peyzac-le-Moustier", "44.9833", "1.0833", "5"], ["24630", "Jumilhac-le-Grand", "45.4943", "1.0634", "5"], ["24640", "Sainte-Eulalie-d'Ans", "45.2457", "1.0207", "5"], ["24650", "Chancelade", "45.2005", "0.6726", "5"], ["24660", "Coulounieix-Chamiers", "45.1529", "0.6885", "5"], ["24680", "Gardonne", "44.8333", "0.35", "5"], ["24700", "Eygurande-et-Gardedeuil", "45.0667", "0.1333", "5"], ["24750", "Trélissac", "45.1977", "0.7861", "5"], ["24800", "Chalais", "45.5167", "0.9167", "5"]],
@@ -25,9 +25,11 @@ module Faker
25
25
  vat_number = "FR#{sClef} " + siren.to_s
26
26
  end
27
27
 
28
- def fr_rcs(area="01")
29
- area = "01" if Fr_rcs_registration[area.to_s].nil?
30
- Fr_rcs_registration[area.to_s].sample
28
+ def fr_rcs(departement=nil)
29
+ departement = %w{2A 2B}.sample if departement == "20" || departement == 20 # Corsica special case
30
+ departement = "%02d" % departement if departement.is_a?(Integer)
31
+ departement = Fr_Departements.sample if departement.nil? || !Fr_Departements.include?(departement)
32
+ Fr_rcs_registration[departement].sample
31
33
  end
32
34
 
33
35
  def fr_ape(business_type=nil)
@@ -36,22 +38,22 @@ module Faker
36
38
  [ape_code, Fr_ape_label[ape_code] ]
37
39
  end
38
40
 
39
- def fr_bank(area=nil, bank=nil)
41
+ def fr_bank(departement=nil, bank=nil)
40
42
  bank = %w{ SG LCL BNP CA Poste}.sample if bank.nil? || !%w{ SG LCL BNP CA Poste}.include?(bank)
41
43
  bank_name = Fr_banks[bank]['label']
42
44
  bank_iban = Fr_banks[bank]['IBAN']
43
45
  bank_bic = Fr_banks[bank]['BIC']
44
- bank_location = Faker::Address.fr_zip_and_city_in_area(area)
46
+ bank_location = Faker::Address.fr_zip_and_city_in_departement(departement)
45
47
  bank_address = Faker::Address.fr_street_name
46
48
  [bank_name, bank_address, bank_location, bank_iban, bank_bic].flatten
47
49
  end
48
50
 
49
- def fr_bank_account(area=nil, bank=nil)
51
+ def fr_bank_account(departement=nil, bank=nil)
50
52
  bank = %w{ SG LCL BNP CA Poste}.sample if bank.nil? || !%w{ SG LCL BNP CA Poste}.include?(bank)
51
53
  bank_name = Fr_banks[bank]['label']
52
54
  bank_iban = Fr_banks[bank]['IBAN']
53
55
  bank_bic = Fr_banks[bank]['BIC']
54
- bank_location = Faker::Address.fr_zip_and_city_in_area(area)
56
+ bank_location = Faker::Address.fr_zip_and_city_in_departement(departement)
55
57
  bank_address = Faker::Address.fr_street_name
56
58
  account_number = Faker::Base.numerify('00000######')
57
59
  sClef = (((account_number.to_i % 97) *3 ) + 12 ) % 97
@@ -70,6 +72,7 @@ module Faker
70
72
  [bank_name, bank_address, bank_location, bank_iban, bank_office, bank_account, iban_account, bic_swift ].flatten
71
73
  end
72
74
 
75
+ Fr_Departements = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "90", "91", "92", "93", "2A", "2B"]
73
76
 
74
77
  Fr_rcs_registration = {"01" => ["Bourg-en-Bresse"], "02" => ["Saint-Quentin", "Soissons"], "03" => ["Cusset ", "Montluçon"], "04" => ["Manosque"], "05" => ["Gap"], "06" => ["Antibes", "Cannes", "Grasse", "Nice"], "07" => ["Aubenas"], "08" => ["Sedan"], "09" => ["Foix"], "10" => ["Troyes"], "11" => ["Carcassonne", "Narbonne"], "12" => ["Rodez"], "13" => ["Aix-en-Provence", "Marseille", "Salon-de-Provence", "Tarascon"], "14" => ["Caen", "Lisieux"], "15" => ["Aurillac"], "16" => ["Angoulême"], "17" => ["La Rochelle", "Saintes"], "18" => ["Bourges"], "19" => ["Brive-la-Gaillarde"], "20" => ["Ajaccio", "Bastia" ], "2A" => ["Ajaccio"], "2B" => ["Bastia"], "21" => ["Dijon"], "22" => ["Saint-Brieuc"], "23" => ["Guéret"], "24" => ["Bergerac", "Périgueux"], "25" => ["Besançon"], "26" => ["Romans-sur-Isère"], "27" => ["Evreux", "Bernay"], "28" => ["Chartres"], "29" => ["Brest", "Quimper"], "30" => ["Nîmes"], "31" => ["Toulouse"], "32" => ["Auch"], "33" => ["Bordeaux", "Libourne"], "34" => ["Béziers", "Montpellier"], "35" => ["Rennes", "Saint-Malo"], "36" => ["Châteauroux"], "37" => ["Tours"], "38" => ["Grenoble", "Vienne"], "39" => ["Lons-le-Saunier"], "40" => ["Dax", "Mont-de-Marsan"], "41" => ["Blois"], "42" => ["Roanne", "Saint-Etienne"], "43" => ["TC du Puy-en-Velay"], "44" => ["Nantes", "Saint-Nazaire"], "45" => ["Orléans"], "46" => ["Cahors"], "47" => ["Agen"], "48" => ["Mende"], "49" => ["Angers"], "50" => ["Cherbourg-Octeville", "Coutances"], "51" => ["Châlons-en-Champagne", "Reims"], "52" => ["Chaumont"], "53" => ["Laval"], "54" => ["Briey", "Nancy"], "55" => ["Bar-le-Duc"], "56" => ["Lorient", "Vannes"], "57" => ["Metz", "Sarreguemines", "Thionville"], "58" => ["Nevers"], "59" => ["Douai", "Dunkerque", "Lille", "Roubaix-Tourcoing", "Valenciennes"], "60" => ["Beauvais", "Compiègne"], "61" => ["Alençon"], "62" => ["Arras", "Boulogne-sur-Mer"], "63" => ["Clermont-Ferrand"], "64" => ["Bayonne", "Pau"], "65" => ["Tarbes"], "66" => ["Perpignan"], "67" => ["Saverne", "Strasbourg"], "68" => ["Colmar", "Mulhouse"], "69" => ["Lyon", "Villefranche-Tarare"], "70" => ["Vesoul"], "71" => ["Chalon-sur-Saône", "Mâcon"], "72" => ["Le Mans"], "73" => ["Chambéry"], "74" => ["Annecy", "Thonon-les-Bains"], "75" => ["Paris"], "76" => ["Dieppe", "Le Havre", "Rouen"], "77" => ["Meaux", "Melun"], "78" => ["Versailles"], "79" => ["Niort"], "80" => ["Amiens"], "81" => ["Albi", "Castres"], "82" => ["Montauban"], "83" => ["Draguignan", "Fréjus", "Toulon"], "84" => ["Avignon"], "85" => ["La Roche-sur-Yon"], "86" => ["Poitiers"], "87" => ["Limoges"], "88" => ["Epinal"], "89" => ["Auxerre", "Sens"], "90" => ["Belfort"], "91" => ["Evry"], "92" => ["Nanterre"], "93" => ["Bobigny"], "94" => ["Créteil"], "95" => ["Pontoise"], "971" => ["Pointe à Pitre", "Basse Terre"], "972" => ["Fort de France"], "973" => ["Cayenne"], "974" => ["Saint Denis de la Réunion"]}
75
78
 
@@ -12,21 +12,21 @@ module Faker
12
12
  Faker::Base.numerify(Phone_formats_fr_intl[phone_area_code - 1])
13
13
  end
14
14
 
15
- def fr_phone_number_in_region(region)
15
+ def fr_phone_number_in_region(region=nil)
16
16
  phone_area_code = Faker::Address.fr_zip_and_city_in_region(region)[4].to_i
17
17
  Faker::Base.numerify(Phone_formats_fr[phone_area_code - 1])
18
18
  end
19
- def fr_phone_number_intl_in_region(region)
19
+ def fr_phone_number_intl_in_region(region=nil)
20
20
  phone_area_code = Faker::Address.fr_zip_and_city_in_region(region)[4].to_i
21
21
  Faker::Base.numerify(Phone_formats_fr_intl[phone_area_code - 1])
22
22
  end
23
23
 
24
- def fr_phone_number_in_area(area)
25
- phone_area_code = Faker::Address.fr_zip_and_city_in_area(area)[4].to_i
24
+ def fr_phone_number_in_departement(departement=nil)
25
+ phone_area_code = Faker::Address.fr_zip_and_city_in_area(departement)[4].to_i
26
26
  Faker::Base.numerify(Phone_formats_fr[phone_area_code - 1])
27
27
  end
28
- def fr_phone_number_intl_in_area(area)
29
- phone_area_code = Faker::Address.fr_zip_and_city_in_area(area)[4].to_i
28
+ def fr_phone_number_intl_in_departement(departement=nil)
29
+ phone_area_code = Faker::Address.fr_zip_and_city_in_area(departement)[4].to_i
30
30
  Faker::Base.numerify(Phone_formats_fr_intl[phone_area_code - 1])
31
31
  end
32
32
 
@@ -1,3 +1,3 @@
1
1
  module FakerExtensionFr
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faker_extension_fr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-05-05 00:00:00.000000000 Z
13
+ date: 2012-05-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &70134548529840 !ruby/object:Gem::Requirement
17
+ requirement: &70117719759880 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '3.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70134548529840
25
+ version_requirements: *70117719759880
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: faker
28
- requirement: &70134548529420 !ruby/object:Gem::Requirement
28
+ requirement: &70117719691460 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70134548529420
36
+ version_requirements: *70117719691460
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: sqlite3
39
- requirement: &70134548528960 !ruby/object:Gem::Requirement
39
+ requirement: &70117719690880 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *70134548528960
47
+ version_requirements: *70117719690880
48
48
  description: ! 'Faker, a port of Data::Faker from Perl, is used to easily generate
49
49
  fake data: names, addresses, phone numbers, etc.'
50
50
  email: