ffaker 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +10 -11
- data/VERSION +1 -1
- data/lib/ffaker/phone_number.rb +19 -24
- data/lib/ffaker/version.rb +1 -1
- data/test/test_company.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -14,7 +14,7 @@ A port of Perl's Data::Faker library that generates fake data.
|
|
14
14
|
|
15
15
|
Faker::Internet.email => "kirsten.greenholt@corkeryfisher.info"
|
16
16
|
|
17
|
-
== Ffaker / Faker
|
17
|
+
== Ffaker / Faker
|
18
18
|
|
19
19
|
This version of the gem was modified by me (Emmanuel Oga) cause I was
|
20
20
|
so annoyed on several ineficiencies on the original gem.
|
@@ -29,7 +29,7 @@ and require 'ffaker', instead of the previous "faker" with one f.
|
|
29
29
|
The API is pretty much the same. Fork/ping me if you feel like adding
|
30
30
|
more goodies to it.
|
31
31
|
|
32
|
-
== Faster
|
32
|
+
== Faster? does it really matter ?
|
33
33
|
|
34
34
|
While it may seem like the speed of good'ol faker is not such a big deal, I
|
35
35
|
really disliked the previous code base.
|
@@ -53,22 +53,21 @@ $ cat scripts/benchmark.rb
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
* ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux],
|
57
|
-
MBARI 0x6770, Ruby Enterprise Edition 2009.10
|
56
|
+
* ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2009.10
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
user system total real
|
59
|
+
Faker 9.240000 0.020000 9.260000 ( 9.297381)
|
60
|
+
Fast Faker 0.060000 0.000000 0.060000 ( 0.109047)
|
62
61
|
|
63
62
|
* ruby 1.9.1p376 (2009-12-07 revision 26041) [x86_64-linux]
|
64
63
|
|
65
|
-
|
66
|
-
Faker
|
67
|
-
Fast Faker
|
64
|
+
user system total real
|
65
|
+
Faker 74.980000 0.110000 75.090000 ( 75.881142)
|
66
|
+
Fast Faker 0.050000 0.000000 0.050000 ( 0.052292)
|
68
67
|
|
69
68
|
DISCLAIMER: I have no idea why I'm getting such bad numbers
|
70
69
|
for traditional faker on 1.9, but I'm not making up this!!!
|
71
|
-
Try it in your own machine, your
|
70
|
+
Try it in your own machine, your mileage may vary.
|
72
71
|
|
73
72
|
== Note on Patches/Pull Requests
|
74
73
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
data/lib/ffaker/phone_number.rb
CHANGED
@@ -4,34 +4,29 @@ module Faker
|
|
4
4
|
extend self
|
5
5
|
|
6
6
|
def phone_number
|
7
|
-
Faker.numerify(
|
7
|
+
Faker.numerify case rand(20)
|
8
|
+
when 0 then '###-###-#### x#####'
|
9
|
+
when 1 then '###-###-#### x####'
|
10
|
+
when 2 then '###-###-#### x###'
|
11
|
+
when 3..4 then '###-###-####'
|
12
|
+
when 5 then '###.###.#### x#####'
|
13
|
+
when 6 then '###.###.#### x####'
|
14
|
+
when 7 then '###.###.#### x###'
|
15
|
+
when 8..9 then '###.###.####'
|
16
|
+
when 10 then '(###)###-#### x#####'
|
17
|
+
when 11 then '(###)###-#### x####'
|
18
|
+
when 12 then '(###)###-#### x###'
|
19
|
+
when 13..14 then '(###)###-####'
|
20
|
+
when 15 then '1-###-###-#### x#####'
|
21
|
+
when 16 then '1-###-###-#### x####'
|
22
|
+
when 17 then '1-###-###-#### x###'
|
23
|
+
when 18..19 then '1-###-###-####'
|
24
|
+
end
|
8
25
|
end
|
9
26
|
|
10
27
|
def self.short_phone_number
|
11
|
-
Faker.numerify(
|
28
|
+
Faker.numerify('###-###-####')
|
12
29
|
end
|
13
30
|
|
14
|
-
FORMATS = k [
|
15
|
-
'###-###-####',
|
16
|
-
'(###)###-####',
|
17
|
-
'1-###-###-####',
|
18
|
-
'###.###.####',
|
19
|
-
'###-###-####',
|
20
|
-
'(###)###-####',
|
21
|
-
'1-###-###-####',
|
22
|
-
'###.###.####',
|
23
|
-
'###-###-#### x###',
|
24
|
-
'(###)###-#### x###',
|
25
|
-
'1-###-###-#### x###',
|
26
|
-
'###.###.#### x###',
|
27
|
-
'###-###-#### x####',
|
28
|
-
'(###)###-#### x####',
|
29
|
-
'1-###-###-#### x####',
|
30
|
-
'###.###.#### x####',
|
31
|
-
'###-###-#### x#####',
|
32
|
-
'(###)###-#### x#####',
|
33
|
-
'1-###-###-#### x#####',
|
34
|
-
'###.###.#### x#####'
|
35
|
-
]
|
36
31
|
end
|
37
32
|
end
|
data/lib/ffaker/version.rb
CHANGED
data/test/test_company.rb
CHANGED