ffaker 1.20.0 → 1.21.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +13 -0
- data/ffaker.gemspec +14 -2
- data/lib/ffaker.rb +6 -1
- data/lib/ffaker/bacon_ipsum.rb +2 -1
- data/lib/ffaker/name_fr.rb +44 -0
- data/lib/ffaker/skill.rb +45 -0
- data/lib/ffaker/unit.rb +36 -0
- data/lib/ffaker/unit_english.rb +81 -0
- data/lib/ffaker/unit_metric.rb +81 -0
- data/test/test_faker_name_fr.rb +51 -0
- data/test/test_skill.rb +22 -0
- data/test/test_units.rb +31 -0
- data/test/test_units_english.rb +61 -0
- data/test/test_units_metric.rb +60 -0
- metadata +33 -11
- checksums.yaml +0 -7
data/Changelog.md
CHANGED
data/ffaker.gemspec
CHANGED
@@ -4,9 +4,11 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.rubygems_version = '1.3.5'
|
5
5
|
|
6
6
|
s.name = 'ffaker'
|
7
|
-
s.version = '1.
|
8
|
-
s.date = '2013-
|
7
|
+
s.version = '1.21.0'
|
8
|
+
s.date = '2013-11-15'
|
9
9
|
s.rubyforge_project = 'ffaker'
|
10
|
+
|
11
|
+
s.license = 'MIT'
|
10
12
|
|
11
13
|
s.summary = "Faster Faker, generates dummy data."
|
12
14
|
s.description = "Faster Faker, generates dummy data."
|
@@ -66,6 +68,7 @@ Gem::Specification.new do |s|
|
|
66
68
|
lib/ffaker/name_cs.rb
|
67
69
|
lib/ffaker/name_da.rb
|
68
70
|
lib/ffaker/name_de.rb
|
71
|
+
lib/ffaker/name_fr.rb
|
69
72
|
lib/ffaker/name_ga.rb
|
70
73
|
lib/ffaker/name_ja.rb
|
71
74
|
lib/ffaker/name_kr.rb
|
@@ -84,10 +87,14 @@ Gem::Specification.new do |s|
|
|
84
87
|
lib/ffaker/phone_number_sg.rb
|
85
88
|
lib/ffaker/phone_number_sn.rb
|
86
89
|
lib/ffaker/product.rb
|
90
|
+
lib/ffaker/skill.rb
|
87
91
|
lib/ffaker/ssn.rb
|
88
92
|
lib/ffaker/ssn_se.rb
|
89
93
|
lib/ffaker/string.rb
|
90
94
|
lib/ffaker/time.rb
|
95
|
+
lib/ffaker/unit.rb
|
96
|
+
lib/ffaker/unit_english.rb
|
97
|
+
lib/ffaker/unit_metric.rb
|
91
98
|
lib/ffaker/utils/array_utils.rb
|
92
99
|
lib/ffaker/utils/module_utils.rb
|
93
100
|
lib/ffaker/venue.rb
|
@@ -120,6 +127,7 @@ Gem::Specification.new do |s|
|
|
120
127
|
test/test_faker_name_cn.rb
|
121
128
|
test/test_faker_name_cs.rb
|
122
129
|
test/test_faker_name_de.rb
|
130
|
+
test/test_faker_name_fr.rb
|
123
131
|
test/test_faker_name_ga.rb
|
124
132
|
test/test_faker_name_ja.rb
|
125
133
|
test/test_faker_name_kr.rb
|
@@ -148,10 +156,14 @@ Gem::Specification.new do |s|
|
|
148
156
|
test/test_phone_number_se.rb
|
149
157
|
test/test_phone_number_sg.rb
|
150
158
|
test/test_phone_number_sn.rb
|
159
|
+
test/test_skill.rb
|
151
160
|
test/test_ssn.rb
|
152
161
|
test/test_ssn_se.rb
|
153
162
|
test/test_string.rb
|
154
163
|
test/test_time.rb
|
164
|
+
test/test_units.rb
|
165
|
+
test/test_units_english.rb
|
166
|
+
test/test_units_metric.rb
|
155
167
|
test/test_venue.rb
|
156
168
|
]
|
157
169
|
# = MANIFEST =
|
data/lib/ffaker.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Faker
|
2
|
-
VERSION = "1.
|
2
|
+
VERSION = "1.21.0"
|
3
3
|
|
4
4
|
require 'ffaker/utils/array_utils'
|
5
5
|
require 'ffaker/utils/module_utils'
|
@@ -59,6 +59,7 @@ module Faker
|
|
59
59
|
autoload :NameCN, 'ffaker/name_cn'
|
60
60
|
autoload :NameCS, 'ffaker/name_cs'
|
61
61
|
autoload :NameDE, 'ffaker/name_de'
|
62
|
+
autoload :NameFR, 'ffaker/name_fr'
|
62
63
|
autoload :NameGA, 'ffaker/name_ga'
|
63
64
|
autoload :NameJA, 'ffaker/name_ja'
|
64
65
|
autoload :NameKR, 'ffaker/name_kr'
|
@@ -78,7 +79,11 @@ module Faker
|
|
78
79
|
autoload :Regexp, 'ffaker/regexp'
|
79
80
|
autoload :SSN, 'ffaker/ssn'
|
80
81
|
autoload :SSNSE, 'ffaker/ssn_se'
|
82
|
+
autoload :Skill, 'ffaker/skill'
|
81
83
|
autoload :String, 'ffaker/string'
|
82
84
|
autoload :Time, 'ffaker/time'
|
85
|
+
autoload :Unit, 'ffaker/unit'
|
86
|
+
autoload :UnitEnglish, 'ffaker/unit_english'
|
87
|
+
autoload :UnitMetric, 'ffaker/unit_metric'
|
83
88
|
autoload :Venue, 'ffaker/venue'
|
84
89
|
end
|
data/lib/ffaker/bacon_ipsum.rb
CHANGED
@@ -0,0 +1,44 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# => author: PapePathe github.com/PapePathe
|
4
|
+
# => email: pathe.sene@gmail.com
|
5
|
+
|
6
|
+
# => the names & first names in this module were found at this url : https://github.com/fzaninotto/Faker/blob/master/src/Faker/Provider/fr_FR/Person.php
|
7
|
+
|
8
|
+
module Faker
|
9
|
+
module NameFR
|
10
|
+
extend ModuleUtils
|
11
|
+
extend self
|
12
|
+
|
13
|
+
|
14
|
+
PREFIX = k %w(de du le)
|
15
|
+
FIRST_NAMES = k %w(Adrien Aimé Alain Alexandre Alfred Alphonse André Antoine Arthur Auguste Augustin Benjamin Benoît Bernard Bertrand Charles Christophe Daniel David Denis Édouard Émile Emmanuel Éric Étienne Eugène François Franck Frédéric Gabriel Georges Gérard Gilbert Gilles Grégoire Guillaume Guy William Henri Honoré Hugues Isaac Jacques Jean Jérôme Joseph Jules Julien Laurent Léon Louis Luc Lucas Marc Marcel Martin Matthieu Maurice Michel Nicolas Noël Olivier Patrick Paul Philippe Pierre Raymond Rémy René Richard Robert Roger Roland Sébastien Stéphane Théodore Théophile Thibaut Thibault Thierry Thomas Timothée Tristan Victor Vincent Xavier Yves Zacharie Adélaïde Adèle Adrienne Agathe Agnès Aimée Alexandrie Alix Alexandria Alex Alice Amélie Anaïs Anastasie Andrée Anne Anouk Antoinette Arnaude Astrid Audrey Aurélie Aurore Bernadette Brigitte Capucine Caroline Catherine Cécile Céline Célina Chantal Charlotte Christelle Christiane Christine Claire Claudine Clémence Colette Constance Corinne Danielle Denise Diane Dorothée Édith Éléonore Élisabeth Élise Élodie Émilie Emmanuelle Françoise Frédérique Gabrielle Geneviève Hélène Henriette Hortense Inès Isabelle Jacqueline Jeanne Jeannine Joséphine Josette Julie Juliette Laetitia Laure Laurence Lorraine Louise Luce Lucie Lucy Madeleine Manon Marcelle Margaux Margaud Margot Marguerite Margot Margaret Maggie daisy Marianne Marie Marine Marthe Martine Maryse Mathilde Michèle Michelle Michelle Monique Nathalie Nath Nathalie Nicole Noémi Océane Odette Olivie Patricia Paulette Pauline Pénélope Philippine Renée Sabine Simone Sophie Stéphanie Susanne Suzanne Susan Suzanne Sylvie Thérèse Valentine Valérie Véronique Victoire Virginie Zoé Camille Claude Dominique)
|
16
|
+
LAST_NAMES = k %w(Martin Bernard Thomas Robert Petit Dubois Richard Garcia Durand Moreau Lefebvre Simon Laurent Michel Leroy Martinez David Fontaine Da Silva Morel Fournier Dupont Bertrand Lambert Rousseau Girard Roux Vincent Lefevre Boyer Lopez Bonnet Andre Francois Mercier Muller Guerin Legrand Sanchez Garnier Chevalier Faure Perez Clement Fernandez Blanc Robin Morin Gauthier Pereira Perrin Roussel Henry Duval Gautier Nicolas Masson Marie Noel Ferreira Lemaire Mathieu Riviere Denis Marchand Rodriguez Dumont Payet Lucas Dufour Dos Santos Joly Blanchard Meunier Rodrigues Caron Gerard Fernandes Brunet Meyer Barbier Leroux Renard Goncalves Gaillard Brun Roy Picard Giraud Roger Schmitt Colin Arnaud Vidal Gonzalez Lemoine Roche Aubert Olivier Leclercq Pierre Philippe Bourgeois Renaud Martins Leclerc Guillaume Lacroix Lecomte Benoit Fabre Carpentier Vasseur Louis Hubert Jean Dumas Rolland Grondin Rey Huet Gomez Dupuis Guillot Berger Moulin Hoarau Menard Deschamps Fleury Adam Boucher Poirier Bertin Charles Aubry Da Costa Royer Dupuy Maillard Paris Baron Lopes Guyot Carre Jacquet Renault Herve Charpentier Klein Cousin Collet Leger Ribeiro Hernandez Bailly Schneider Le Gall Ruiz Langlois Bouvier Gomes Prevost Julien Lebrun Breton Germain Millet Boulanger Remy Le Roux Daniel Marques Maillot Leblanc Le Goff Barre Perrot Leveque Marty Benard Monnier Hamon Pelletier Alves Etienne Marchal Poulain Tessier Lemaitre Guichard Besson Mallet Hoareau Gillet Weber Jacob Collin Chevallier Perrier Michaud Carlier Delaunay Chauvin Alexandre Marechal Antoine Lebon Cordier Lejeune Bouchet Pasquier Legros Delattre Humbert De Oliveira Briand Lamy Launay Gilbert Perret Lesage Gay Nguyen Navarro Besnard Pichon Hebert Cohen Pons Lebreton Sauvage De Sousa Pineau Albert Jacques Pinto Barthelemy Turpin Bigot Lelievre Georges Reynaud Ollivier Martel Voisin Leduc Guillet Vallee Coulon Camus Marin Teixeira Costa Mahe Didier Charrier Gaudin Bodin Guillou Gregoire Gros Blanchet Buisson Blondel Paul Dijoux Barbe Hardy Laine Evrard Laporte Rossi Joubert Regnier Tanguy Gimenez Allard Devaux Morvan Levy Dias Courtois Lenoir Berthelot Pascal Vaillant Guilbert Thibault Moreno Duhamel Colas Masse Baudry Bruneau Verdier Delorme Blin Guillon Mary Coste Pruvost Maury Allain Valentin Godard Joseph Brunel Marion Texier Seguin Raynaud Bourdon Raymond Bonneau Chauvet Maurice Legendre Loiseau Ferrand Toussaint Techer Lombard Lefort Couturier Bousquet Diaz Riou Clerc Weiss Imbert Jourdan Delahaye Gilles Guibert Begue Descamps Delmas Peltier Dupre Chartier Martineau Laroche Leconte Maillet Parent Labbe Potier Bazin Normand Pottier Torres Lagarde Blot Jacquot Lemonnier Grenier Rocher Bonnin Boutin Fischer Munoz Neveu Lacombe Mendes Delannoy Auger Wagner Fouquet Mace Ramos Pages Petitjean Chauveau Foucher Peron Guyon Gallet Rousset Traore Bernier Vallet Letellier Bouvet Hamel Chretien Faivre Boulay Thierry Samson Ledoux Salmon Gosselin Lecoq Pires Leleu Becker Diallo Merle Valette)
|
17
|
+
|
18
|
+
# randomized? (FRENCH) prefix!
|
19
|
+
#
|
20
|
+
def prefix
|
21
|
+
PREFIX.rand
|
22
|
+
end
|
23
|
+
|
24
|
+
def last_name
|
25
|
+
LAST_NAMES.rand
|
26
|
+
end
|
27
|
+
|
28
|
+
def first_name
|
29
|
+
FIRST_NAMES.rand
|
30
|
+
end
|
31
|
+
|
32
|
+
def name
|
33
|
+
case rand(10)
|
34
|
+
when 7 then "#{first_name} #{prefix} #{last_name}"
|
35
|
+
when 5 then "#{first_name} #{prefix} #{last_name}"
|
36
|
+
when 3 then "#{first_name} #{last_name}"
|
37
|
+
when 0 then "#{first_name} #{last_name}"
|
38
|
+
else "#{first_name} #{last_name}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
data/lib/ffaker/skill.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
module Faker
|
2
|
+
module Skill
|
3
|
+
extend ModuleUtils
|
4
|
+
extend self
|
5
|
+
|
6
|
+
def tech_skill
|
7
|
+
TECH_SKILLS.rand
|
8
|
+
end
|
9
|
+
|
10
|
+
def tech_skills(num = 3)
|
11
|
+
TECH_SKILLS.random_pick(num)
|
12
|
+
end
|
13
|
+
|
14
|
+
def specialty
|
15
|
+
"%s %s" % [SPECIALTY_START.rand, SPECIALTY_END.rand]
|
16
|
+
end
|
17
|
+
|
18
|
+
def specialties(num = 3)
|
19
|
+
(1..num).map { specialty }
|
20
|
+
end
|
21
|
+
|
22
|
+
TECH_SKILLS = k %w(Ajax XHR AWS Bootstrap CodeIgniter
|
23
|
+
CSS3 Django Git HTML5 JavaScript JQuery JSON LAMP
|
24
|
+
Linux Mac OSX MongoDB MySQL Photoshop PHP Python
|
25
|
+
REST Ruby Rails SublimeText SVN TextMate Cassandra
|
26
|
+
Heroku Memcached PostgreSQL SOAP XML YAML
|
27
|
+
Backbone.JS Marionette.JS CakePHP ExtJS Sinatra
|
28
|
+
Struts Typo3 Zend ActionScript ASP Java JSP Perl
|
29
|
+
Shell Flash Illustrator Visio Angular.JS)
|
30
|
+
|
31
|
+
|
32
|
+
SPECIALTY_START = k %w(Web Database Resource Team
|
33
|
+
Prototype Project Software Hardware Firmware Area
|
34
|
+
Multi-tier Global Template Modular Statistical
|
35
|
+
Visual Mental Performance)
|
36
|
+
|
37
|
+
|
38
|
+
SPECIALTY_END = k %w(Development Management Design
|
39
|
+
Architecture Methods Optimization Modularization
|
40
|
+
Testing Profiling Prototyping Analysis Instruction
|
41
|
+
Metrics Research)
|
42
|
+
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
data/lib/ffaker/unit.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
module Faker
|
3
|
+
module Unit
|
4
|
+
extend ModuleUtils
|
5
|
+
extend self
|
6
|
+
|
7
|
+
def time_name
|
8
|
+
time.name
|
9
|
+
end
|
10
|
+
|
11
|
+
def time_abbr
|
12
|
+
time.abbreviation
|
13
|
+
end
|
14
|
+
|
15
|
+
def temperature_name
|
16
|
+
temperature.name
|
17
|
+
end
|
18
|
+
|
19
|
+
def temperature_abbr
|
20
|
+
temperature.abbreviation
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
def time
|
25
|
+
OpenStruct.new TIME_UNITS.rand
|
26
|
+
end
|
27
|
+
|
28
|
+
def temperature
|
29
|
+
OpenStruct.new TEMPERATURE_UNITS.rand
|
30
|
+
end
|
31
|
+
|
32
|
+
TIME_UNITS = k [ {:name => 'Years', :abbreviation => 'yr'}, {:name => 'Days', :abbreviation => 'd'}, {:name => 'Hours', :abbreviation => 'Minutes'}, {:name => 'Seconds', :abbreviation => 's'}, {:name => 'Milliseconds', :abbreviation => 'msec'} ]
|
33
|
+
|
34
|
+
TEMPERATURE_UNITS = k [ {:name => 'Kelvin', :abbreviation => 'K'}, {:name => 'Celsius', :abbreviation => 'C'}, {:name => 'Fahrenheit', :abbreviation => 'F'} ]
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
module Faker
|
3
|
+
module UnitEnglish
|
4
|
+
include Faker::Unit
|
5
|
+
extend ModuleUtils
|
6
|
+
extend self
|
7
|
+
|
8
|
+
def mass_name
|
9
|
+
mass.name
|
10
|
+
end
|
11
|
+
|
12
|
+
def mass_abbr
|
13
|
+
mass.abbreviation
|
14
|
+
end
|
15
|
+
|
16
|
+
def length_name
|
17
|
+
length.name
|
18
|
+
end
|
19
|
+
|
20
|
+
def length_abbr
|
21
|
+
length.abbreviation
|
22
|
+
end
|
23
|
+
|
24
|
+
def liquid_name
|
25
|
+
liquid.name
|
26
|
+
end
|
27
|
+
|
28
|
+
def liquid_abbr
|
29
|
+
liquid.abbreviation
|
30
|
+
end
|
31
|
+
|
32
|
+
def volume_name
|
33
|
+
volume.name
|
34
|
+
end
|
35
|
+
|
36
|
+
def volume_abbr
|
37
|
+
volume.abbreviation
|
38
|
+
end
|
39
|
+
|
40
|
+
def area_name
|
41
|
+
area.name
|
42
|
+
end
|
43
|
+
|
44
|
+
def area_abbr
|
45
|
+
area.abbreviation
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def length
|
51
|
+
OpenStruct.new LENGTH_UNITS.rand
|
52
|
+
end
|
53
|
+
|
54
|
+
def mass
|
55
|
+
OpenStruct.new MASS_UNITS.rand
|
56
|
+
end
|
57
|
+
|
58
|
+
def liquid
|
59
|
+
OpenStruct.new LIQUID_UNITS.rand
|
60
|
+
end
|
61
|
+
|
62
|
+
def volume
|
63
|
+
OpenStruct.new VOLUME_UNITS.rand
|
64
|
+
end
|
65
|
+
|
66
|
+
def area
|
67
|
+
OpenStruct.new AREA_UNITS.rand
|
68
|
+
end
|
69
|
+
|
70
|
+
LENGTH_UNITS = k [ { :name =>"inch", :abbreviation => "in"}, { :name =>"foot", :abbreviation => "ft"},{ :name =>"yard", :abbreviation => "yd"}, { :name =>"furlong", :abbreviation => "fur"}, { :name =>"mile", :abbreviation => "m"}]
|
71
|
+
|
72
|
+
MASS_UNITS = k [ { :name => "grains", :abbreviation => "gr"}, { :name => "ounces", :abbreviation => "oz"}, { :name => "pounds", :abbreviation => "lb" }, { :name => "hundredweight", :abbreviation => "cwt"}, { :name => "ton", :abbreviation => "t" } ]
|
73
|
+
|
74
|
+
LIQUID_UNITS = k [ { :name => "fluid ounce", :abbreviation => "fl oz"}, { :name => "gill", :abbreviation => "gi"}, { :name => "pint", :abbreviation => "pt"}, { :name => "quart", :abbreviation => "qt"} ]
|
75
|
+
|
76
|
+
VOLUME_UNITS = k [ { :name =>"cubic inch", :abbreviation => "CI"}, { :name =>"cubic foot", :abbreviation => "CFT"}, { :name =>"cubic yard", :abbreviation => "CY"} ]
|
77
|
+
|
78
|
+
AREA_UNITS = k [ { :name =>"square inch", :abbreviation => "sq. in"}, { :name =>"square foot", :abbreviation => "sq ft"}, { :name =>"square yard", :abbreviation => "sq yd"}, { :name =>"acre", :abbreviation => "ac"}, { :name =>"section", :abbreviation => "s"}, { :name =>"square mile", :abbreviation => "sq mi"}, { :name =>"township", :abbreviation => "Twp"}]
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
module Faker
|
3
|
+
module UnitMetric
|
4
|
+
include Faker::Unit
|
5
|
+
extend ModuleUtils
|
6
|
+
extend self
|
7
|
+
|
8
|
+
def mass_name
|
9
|
+
mass.name
|
10
|
+
end
|
11
|
+
|
12
|
+
def mass_abbr
|
13
|
+
mass.abbreviation
|
14
|
+
end
|
15
|
+
|
16
|
+
def length_name
|
17
|
+
length.name
|
18
|
+
end
|
19
|
+
|
20
|
+
def length_abbr
|
21
|
+
length.abbreviation
|
22
|
+
end
|
23
|
+
|
24
|
+
def liquid_name
|
25
|
+
liquid.name
|
26
|
+
end
|
27
|
+
|
28
|
+
def liquid_abbr
|
29
|
+
liquid.abbreviation
|
30
|
+
end
|
31
|
+
|
32
|
+
def volume_name
|
33
|
+
volume.name
|
34
|
+
end
|
35
|
+
|
36
|
+
def volume_abbr
|
37
|
+
volume.abbreviation
|
38
|
+
end
|
39
|
+
|
40
|
+
def area_name
|
41
|
+
area.name
|
42
|
+
end
|
43
|
+
|
44
|
+
def area_abbr
|
45
|
+
area.abbreviation
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def length
|
51
|
+
OpenStruct.new LENGTH_UNITS.rand
|
52
|
+
end
|
53
|
+
|
54
|
+
def mass
|
55
|
+
OpenStruct.new MASS_UNITS.rand
|
56
|
+
end
|
57
|
+
|
58
|
+
def liquid
|
59
|
+
OpenStruct.new LIQUID_UNITS.rand
|
60
|
+
end
|
61
|
+
|
62
|
+
def volume
|
63
|
+
OpenStruct.new VOLUME_UNITS.rand
|
64
|
+
end
|
65
|
+
|
66
|
+
def area
|
67
|
+
OpenStruct.new AREA_UNITS.rand
|
68
|
+
end
|
69
|
+
|
70
|
+
LENGTH_UNITS = k [ { :name =>"millimeters", :abbreviation => "mm"}, { :name =>"centimeters", :abbreviation => "cm"},{ :name =>"meters", :abbreviation => "m"}, { :name =>"kilometers", :abbreviation => "km"}]
|
71
|
+
|
72
|
+
MASS_UNITS = k [ { :name => "gram", :abbreviation => "g"}, { :name => "kilogram", :abbreviation => "kg" }, { :name => "metric ton", :abbreviation => "mt"} ]
|
73
|
+
|
74
|
+
LIQUID_UNITS = k [ { :name => "milliliters", :abbreviation => "ml"}, { :name => "liters", :abbreviation => "L"} ]
|
75
|
+
|
76
|
+
VOLUME_UNITS = k [ { :name => " cubic centimeters", :abbreviation => "cm^3"}, { :name => "cubic meters", :abbreviation => "m^3"} ]
|
77
|
+
|
78
|
+
AREA_UNITS = k [ { :name => "centimeters squared", :abbreviation => "cm^2"}, { :name => "meters squared", :abbreviation => "m^2"}, { :name => "hectares", :abbreviation => "ha"}, { :name => "kilometers", :abbreviation => "km" } ]
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# => author: PapePathe github.com/PapePathe
|
4
|
+
# => email: pathe.sene@gmail.com
|
5
|
+
|
6
|
+
require 'helper'
|
7
|
+
|
8
|
+
class TestFakerNameFR < Test::Unit::TestCase
|
9
|
+
|
10
|
+
def setup
|
11
|
+
@tester = Faker::NameFR
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_last_name
|
15
|
+
assert Faker::NameFR::LAST_NAMES.include?(@tester.last_name)
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_first_name
|
19
|
+
assert Faker::NameFR::FIRST_NAMES.include?(@tester.first_name)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_prefix
|
23
|
+
assert Faker::NameFR::PREFIX.include?(@tester.prefix)
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
def test_name
|
28
|
+
# => split the name into an array of words
|
29
|
+
parts = @tester.name.split(' ')
|
30
|
+
|
31
|
+
if parts.count == 3
|
32
|
+
# the value at the index 1 should be a valid! prefix
|
33
|
+
assert Faker::NameFR::PREFIX.include?(parts[1])
|
34
|
+
|
35
|
+
# the value at the index 0 should be a valid! male_first_name
|
36
|
+
assert Faker::NameFR::FIRST_NAMES.include?(parts[0])
|
37
|
+
|
38
|
+
# the value at the index 2 should be a valid! last_name
|
39
|
+
assert Faker::NameFR::LAST_NAMES.include?(parts[2])
|
40
|
+
|
41
|
+
elsif parts.count == 2
|
42
|
+
# the value at the index 0 should be a valid! prefix
|
43
|
+
assert Faker::NameFR::FIRST_NAMES.include?(parts[0])
|
44
|
+
|
45
|
+
# the value at the index 1 should be a valid! last_name
|
46
|
+
assert Faker::NameFR::LAST_NAMES.include?(parts[1])
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
end
|
data/test/test_skill.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestSkill < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_tech_skill
|
6
|
+
assert_match /[a-z]+/i, Faker::Skill.tech_skill
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_tech_skills
|
10
|
+
tech_skills = Faker::Skill.tech_skills
|
11
|
+
assert_instance_of Array, tech_skills
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_specialty
|
15
|
+
assert_match /[ a-z]+/i, Faker::Skill.specialty
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_specialties
|
19
|
+
specialties = Faker::Skill.specialties
|
20
|
+
assert_instance_of Array, specialties
|
21
|
+
end
|
22
|
+
end
|
data/test/test_units.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# => author: lurraca github.com/lurraca
|
3
|
+
require 'helper'
|
4
|
+
|
5
|
+
class TestUnits < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@tester = Faker::Unit
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_time_name
|
12
|
+
time_name = @tester.time_name
|
13
|
+
assert Faker::Unit::TIME_UNITS.any?{ |hash| hash[:name] == time_name }
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_time_abbr
|
17
|
+
time_abbr = @tester.time_abbr
|
18
|
+
assert Faker::Unit::TIME_UNITS.any?{ |hash| hash[:abbreviation] == time_abbr }
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_temperature_name
|
22
|
+
temperature_name = @tester.temperature_name
|
23
|
+
assert Faker::Unit::TEMPERATURE_UNITS.any?{ |hash| hash[:name] == temperature_name }
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_temperature_abbr
|
27
|
+
temperature_abbr = @tester.temperature_abbr
|
28
|
+
assert Faker::Unit::TEMPERATURE_UNITS.any?{ |hash| hash[:abbreviation] == temperature_abbr }
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# => author: lurraca github.com/lurraca
|
3
|
+
require 'helper'
|
4
|
+
|
5
|
+
class TestUnitsEnglish < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@tester = Faker::UnitEnglish
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_length_name
|
12
|
+
length_name = @tester.length_name
|
13
|
+
assert Faker::UnitEnglish::LENGTH_UNITS.any?{ |hash| hash[:name] == length_name }
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_length_abbrev
|
17
|
+
length_abbr = @tester.length_abbr
|
18
|
+
assert Faker::UnitEnglish::LENGTH_UNITS.any?{ |hash| hash[:abbreviation] == length_abbr }
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_mass_name
|
22
|
+
mass_name = @tester.mass_name
|
23
|
+
assert Faker::UnitEnglish::MASS_UNITS.any?{ |hash| hash[:name] == mass_name }
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_mass_abbr
|
27
|
+
mass_abbr = @tester.mass_abbr
|
28
|
+
assert Faker::UnitEnglish::MASS_UNITS.any?{ |hash| hash[:abbreviation] == mass_abbr }
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_liquid_name
|
32
|
+
liquid_name = @tester.liquid_name
|
33
|
+
assert Faker::UnitEnglish::LIQUID_UNITS.any?{ |hash| hash[:name] == liquid_name }
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_liquid_abbr
|
37
|
+
liquid_abbr = @tester.liquid_abbr
|
38
|
+
assert Faker::UnitEnglish::LIQUID_UNITS.any?{ |hash| hash[:abbreviation] == liquid_abbr }
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_volume_name
|
42
|
+
volume_name = @tester.volume_name
|
43
|
+
assert Faker::UnitEnglish::VOLUME_UNITS.any?{ |hash| hash[:name] == volume_name }
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_volume_abbr
|
47
|
+
volume_abbr = @tester.volume_abbr
|
48
|
+
assert Faker::UnitEnglish::VOLUME_UNITS.any?{ |hash| hash[:abbreviation] == volume_abbr }
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_area_name
|
52
|
+
area_name = @tester.area_name
|
53
|
+
assert Faker::UnitEnglish::AREA_UNITS.any?{ |hash| hash[:name] == area_name }
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_area_abbr
|
57
|
+
area_abbr = @tester.area_abbr
|
58
|
+
assert Faker::UnitEnglish::AREA_UNITS.any?{ |hash| hash[:abbreviation] == area_abbr }
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# => author: lurraca github.com/lurraca
|
3
|
+
require 'helper'
|
4
|
+
|
5
|
+
class TestUnitsMetric < Test::Unit::TestCase
|
6
|
+
def setup
|
7
|
+
@tester = Faker::UnitMetric
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_length_name
|
11
|
+
length_name = @tester.length_name
|
12
|
+
assert Faker::UnitMetric::LENGTH_UNITS.any?{ |hash| hash[:name] == length_name }
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_length_abbrev
|
16
|
+
length_abbr = @tester.length_abbr
|
17
|
+
assert Faker::UnitMetric::LENGTH_UNITS.any?{ |hash| hash[:abbreviation] == length_abbr }
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_mass_name
|
21
|
+
mass_name = @tester.mass_name
|
22
|
+
assert Faker::UnitMetric::MASS_UNITS.any?{ |hash| hash[:name] == mass_name }
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_mass_abbr
|
26
|
+
mass_abbr = @tester.mass_abbr
|
27
|
+
assert Faker::UnitMetric::MASS_UNITS.any?{ |hash| hash[:abbreviation] == mass_abbr }
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_liquid_name
|
31
|
+
liquid_name = @tester.liquid_name
|
32
|
+
assert Faker::UnitMetric::LIQUID_UNITS.any?{ |hash| hash[:name] == liquid_name }
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_liquid_abbr
|
36
|
+
liquid_abbr = @tester.liquid_abbr
|
37
|
+
assert Faker::UnitMetric::LIQUID_UNITS.any?{ |hash| hash[:abbreviation] == liquid_abbr }
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_volume_name
|
41
|
+
volume_name = @tester.volume_name
|
42
|
+
assert Faker::UnitMetric::VOLUME_UNITS.any?{ |hash| hash[:name] == volume_name }
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_volume_abbr
|
46
|
+
volume_abbr = @tester.volume_abbr
|
47
|
+
assert Faker::UnitMetric::VOLUME_UNITS.any?{ |hash| hash[:abbreviation] == volume_abbr }
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_area_name
|
51
|
+
area_name = @tester.area_name
|
52
|
+
assert Faker::UnitMetric::AREA_UNITS.any?{ |hash| hash[:name] == area_name }
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_area_abbr
|
56
|
+
area_abbr = @tester.area_abbr
|
57
|
+
assert Faker::UnitMetric::AREA_UNITS.any?{ |hash| hash[:abbreviation] == area_abbr }
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
metadata
CHANGED
@@ -1,41 +1,46 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.21.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Emmanuel Oga
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-
|
12
|
+
date: 2013-11-15 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rake
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- - '>='
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '0'
|
20
22
|
type: :development
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- - '>='
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0'
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: test-unit
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- - '>='
|
35
|
+
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: '0'
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- - '>='
|
43
|
+
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '0'
|
41
46
|
description: Faster Faker, generates dummy data.
|
@@ -91,6 +96,7 @@ files:
|
|
91
96
|
- lib/ffaker/name_cs.rb
|
92
97
|
- lib/ffaker/name_da.rb
|
93
98
|
- lib/ffaker/name_de.rb
|
99
|
+
- lib/ffaker/name_fr.rb
|
94
100
|
- lib/ffaker/name_ga.rb
|
95
101
|
- lib/ffaker/name_ja.rb
|
96
102
|
- lib/ffaker/name_kr.rb
|
@@ -109,10 +115,14 @@ files:
|
|
109
115
|
- lib/ffaker/phone_number_sg.rb
|
110
116
|
- lib/ffaker/phone_number_sn.rb
|
111
117
|
- lib/ffaker/product.rb
|
118
|
+
- lib/ffaker/skill.rb
|
112
119
|
- lib/ffaker/ssn.rb
|
113
120
|
- lib/ffaker/ssn_se.rb
|
114
121
|
- lib/ffaker/string.rb
|
115
122
|
- lib/ffaker/time.rb
|
123
|
+
- lib/ffaker/unit.rb
|
124
|
+
- lib/ffaker/unit_english.rb
|
125
|
+
- lib/ffaker/unit_metric.rb
|
116
126
|
- lib/ffaker/utils/array_utils.rb
|
117
127
|
- lib/ffaker/utils/module_utils.rb
|
118
128
|
- lib/ffaker/venue.rb
|
@@ -145,6 +155,7 @@ files:
|
|
145
155
|
- test/test_faker_name_cn.rb
|
146
156
|
- test/test_faker_name_cs.rb
|
147
157
|
- test/test_faker_name_de.rb
|
158
|
+
- test/test_faker_name_fr.rb
|
148
159
|
- test/test_faker_name_ga.rb
|
149
160
|
- test/test_faker_name_ja.rb
|
150
161
|
- test/test_faker_name_kr.rb
|
@@ -173,32 +184,38 @@ files:
|
|
173
184
|
- test/test_phone_number_se.rb
|
174
185
|
- test/test_phone_number_sg.rb
|
175
186
|
- test/test_phone_number_sn.rb
|
187
|
+
- test/test_skill.rb
|
176
188
|
- test/test_ssn.rb
|
177
189
|
- test/test_ssn_se.rb
|
178
190
|
- test/test_string.rb
|
179
191
|
- test/test_time.rb
|
192
|
+
- test/test_units.rb
|
193
|
+
- test/test_units_english.rb
|
194
|
+
- test/test_units_metric.rb
|
180
195
|
- test/test_venue.rb
|
181
196
|
homepage: http://github.com/emmanueloga/ffaker
|
182
|
-
licenses:
|
183
|
-
|
197
|
+
licenses:
|
198
|
+
- MIT
|
184
199
|
post_install_message:
|
185
200
|
rdoc_options:
|
186
201
|
- --charset=UTF-8
|
187
202
|
require_paths:
|
188
203
|
- lib
|
189
204
|
required_ruby_version: !ruby/object:Gem::Requirement
|
205
|
+
none: false
|
190
206
|
requirements:
|
191
|
-
- - '>='
|
207
|
+
- - ! '>='
|
192
208
|
- !ruby/object:Gem::Version
|
193
209
|
version: '0'
|
194
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
|
+
none: false
|
195
212
|
requirements:
|
196
|
-
- - '>='
|
213
|
+
- - ! '>='
|
197
214
|
- !ruby/object:Gem::Version
|
198
215
|
version: '0'
|
199
216
|
requirements: []
|
200
217
|
rubyforge_project: ffaker
|
201
|
-
rubygems_version:
|
218
|
+
rubygems_version: 1.8.25
|
202
219
|
signing_key:
|
203
220
|
specification_version: 2
|
204
221
|
summary: Faster Faker, generates dummy data.
|
@@ -228,6 +245,7 @@ test_files:
|
|
228
245
|
- test/test_faker_name_cn.rb
|
229
246
|
- test/test_faker_name_cs.rb
|
230
247
|
- test/test_faker_name_de.rb
|
248
|
+
- test/test_faker_name_fr.rb
|
231
249
|
- test/test_faker_name_ga.rb
|
232
250
|
- test/test_faker_name_ja.rb
|
233
251
|
- test/test_faker_name_kr.rb
|
@@ -256,8 +274,12 @@ test_files:
|
|
256
274
|
- test/test_phone_number_se.rb
|
257
275
|
- test/test_phone_number_sg.rb
|
258
276
|
- test/test_phone_number_sn.rb
|
277
|
+
- test/test_skill.rb
|
259
278
|
- test/test_ssn.rb
|
260
279
|
- test/test_ssn_se.rb
|
261
280
|
- test/test_string.rb
|
262
281
|
- test/test_time.rb
|
282
|
+
- test/test_units.rb
|
283
|
+
- test/test_units_english.rb
|
284
|
+
- test/test_units_metric.rb
|
263
285
|
- test/test_venue.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 40ff7326085b49510116b097a49856d9c7f47b1e
|
4
|
-
data.tar.gz: eee9e6968fb1e1c2282bb260f313d27af338b0e8
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 30f3fa9f66ffd7fe0fd1ce5335fbd70186d4aafbed9a2cede06c01801b402a2ce93dd946dcc9fb05f7a7aa25d88879cf033d8eecbec6b5d5aa2496bdb8766701
|
7
|
-
data.tar.gz: 308d681d2c39fb3a605fd1b5051f1394cfa30fcb42abd50b5743505f7cdb23fec7992ea169d918b63a35817f8195d5f5fea4e8186aa0c03a4073eb0c2b3c7c2f
|