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 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??? does it really matter ??? ==
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
- user system total real
60
- Faker 9.240000 0.020000 9.260000 ( 9.297381)
61
- Fast Faker 0.060000 0.000000 0.060000 ( 0.109047)
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
- user system total real
66
- Faker 74.980000 0.110000 75.090000 ( 75.881142)
67
- Fast Faker 0.050000 0.000000 0.050000 ( 0.052292)
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 milage may vary.
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.3
1
+ 0.3.4
@@ -4,34 +4,29 @@ module Faker
4
4
  extend self
5
5
 
6
6
  def phone_number
7
- Faker.numerify(FORMATS.rand)
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(FORMATS.first.dup)
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
@@ -2,7 +2,7 @@ module Faker #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- TINY = 3
5
+ TINY = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/test/test_company.rb CHANGED
@@ -14,6 +14,6 @@ class TestCompany < Test::Unit::TestCase
14
14
  end
15
15
 
16
16
  def test_suffix
17
- assert_match /[ a-z]+/, Faker::Company.suffix
17
+ assert_match /[ a-z]+/i, Faker::Company.suffix
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emmanuel Oga