ffaker 1.13.0 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ == 1.14.0
2
+
3
+ AddressSN (thanks PapePethe), and a bugfix on Faker::Product.model (thanks finarfin).
4
+
1
5
  == 1.13.0
2
6
 
3
7
  Education bug fix, Faker::Job (thanks Piotr Usewicz)
data/README.rdoc CHANGED
@@ -78,8 +78,7 @@ $ cat scripts/benchmark.rb
78
78
  * Ben Wisleey ( https://github.com/wiseleyb )
79
79
  * Simon Russel ( https://github.com/simonrussell )
80
80
  * Piotr Usewicz ( https://github.com/pusewicz )
81
-
82
- * See complete list: https://github.com/EmmanuelOga/ffaker/network
81
+ * And others... see complete list: https://github.com/EmmanuelOga/ffaker/network/members
83
82
 
84
83
  == TODO
85
84
 
data/ffaker.gemspec CHANGED
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
5
5
  s.rubygems_version = '1.3.5'
6
6
 
7
7
  s.name = 'ffaker'
8
- s.version = '1.13.0'
9
- s.date = '2012-02-27'
8
+ s.version = '1.14.0'
9
+ s.date = '2012-03-25'
10
10
  s.rubyforge_project = 'ffaker'
11
11
 
12
12
  s.summary = "Faster Faker, generates dummy data."
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
33
33
  lib/ffaker/address_au.rb
34
34
  lib/ffaker/address_ca.rb
35
35
  lib/ffaker/address_de.rb
36
+ lib/ffaker/address_sn.rb
36
37
  lib/ffaker/address_uk.rb
37
38
  lib/ffaker/address_us.rb
38
39
  lib/ffaker/company.rb
@@ -64,10 +65,12 @@ Gem::Specification.new do |s|
64
65
  test/test_address_au.rb
65
66
  test/test_address_ca.rb
66
67
  test/test_address_de.rb
68
+ test/test_address_sn.rb
67
69
  test/test_address_uk.rb
68
70
  test/test_address_us.rb
69
71
  test/test_array_utils.rb
70
72
  test/test_company.rb
73
+ test/test_education.rb
71
74
  test/test_faker.rb
72
75
  test/test_faker_internet.rb
73
76
  test/test_faker_job.rb
@@ -90,4 +93,9 @@ Gem::Specification.new do |s|
90
93
  # = MANIFEST =
91
94
 
92
95
  s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
96
+
97
+ # TODO add development dependencies
98
+ #s.add_development_dependency 'rake'
99
+ #s.add_development_dependency 'test-unit'
100
+
93
101
  end
data/lib/ffaker.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Faker
2
- VERSION = "1.13.0"
2
+ VERSION = "1.14.0"
3
3
 
4
4
  require 'ffaker/utils/array_utils'
5
5
  require 'ffaker/utils/module_utils'
@@ -28,6 +28,7 @@ module Faker
28
28
  autoload :AddressAU, 'ffaker/address_au'
29
29
  autoload :AddressCA, 'ffaker/address_ca'
30
30
  autoload :AddressDE, 'ffaker/address_de'
31
+ autoload :AddressSN, 'ffaker/address_sn'
31
32
  autoload :AddressUK, 'ffaker/address_uk'
32
33
  autoload :AddressUS, 'ffaker/address_us'
33
34
  autoload :Company, 'ffaker/company'
@@ -0,0 +1,49 @@
1
+ # encoding: utf-8
2
+
3
+ # => author: PapePathe github.com/PapePathe
4
+ # => email: pathe.sene@gmail.com
5
+
6
+ module Faker
7
+
8
+ module AddressSN
9
+
10
+ include Faker::Address
11
+ extend ModuleUtils
12
+ extend self
13
+
14
+ # Constantes
15
+
16
+ # Arrondissements
17
+ #
18
+ ARRONDISSEMENTS = k ['Biscuiterie', 'Cambérène', 'Dieuppeul-Derklé', 'Fann-Point E-Amitié', 'Gueule Tapée-Fass-Colobane', 'Gorée', 'Grand Yoff', 'Grand Dakar', 'Hann Bel-Air', 'HLM', 'Médina', 'Mermoz-Sacré-Cœur', 'Ngor', 'Ouakam', 'Parcelles Assainies', 'Patte Doie', 'Dakar-Plateau',' Sicap-Liberté', 'Yoff', 'Dalifort', 'Djidah Thiaroye Kaw', 'Guinaw Rail Nord', 'Guinaw Rail Sud', 'Pikine Est', ' Pikine Nord', 'Pikine Ouest', 'Keur Massar', 'Malika', 'Yeumbeul Nord', 'Yeumbeul Sud', 'Diamaguène', 'Sicap Mbao', 'Mbao', 'Thiaroye Gare', 'Thiaroye Sur Mer', 'Tivaouane Diacksao', 'Golf Sud', 'Médina Gounass', 'Ndiarème Limamoulaye', 'Sam Notaire', 'Wakhinane Nimzatt', 'Rufisque Est', 'Rufisque Nord', 'Rufisque Ouest', 'Thiès Est', 'Thiès Nord', 'Thiès Ouest']
19
+
20
+ # Departements
21
+ #
22
+ DEPARTEMENTS = k ['dakar', 'pikine', 'guediawaye', 'rufisque', 'bambey', 'diourbel', 'mbacke', 'fatick', 'foundiougne', 'gossas', 'Kaolack', 'Guinguineo', 'nioro du rip', 'kolda', 'velingara', 'medina yoro foulah', 'Kebemer', 'Linguere', 'Louga', 'Kanel', 'Matam', 'Ranerou', 'Dagana', 'Podor', 'Saint-Louis', 'Bakel', 'Koumpentoum', 'Tambacounda', 'Mbour', 'Thies', 'Tivaouane', 'Bignogna', 'Oussouye', 'Ziguinchor', 'Birkilane','Kaffrine', 'Malem Hodar', 'Kedougou', 'Salemata', 'Saraya', 'Bounkiling', 'Goudomp', 'Sedhiou' ]
23
+
24
+ # Régions
25
+ #
26
+ REGIONS = k ['dakar', 'diourbel', 'fatick', 'kaffrine', 'kaolack', 'kolda', 'kedougou', 'louga', 'matam', 'saint louis', 'sedhiou', 'tambacouda', 'thies', 'ziguinchor']
27
+
28
+
29
+ # region
30
+ #
31
+ def region
32
+ REGIONS.rand
33
+ end
34
+
35
+ # departement
36
+ #
37
+ def departement
38
+ DEPARTEMENTS.rand
39
+ end
40
+
41
+ # arrondissement
42
+ #
43
+ def arrondissement
44
+ ARRONDISSEMENTS.rand
45
+ end
46
+
47
+ end
48
+
49
+ end
@@ -1,9 +1,10 @@
1
1
  # encoding: utf-8
2
2
 
3
- # => author: xarala
4
- # => email: pathe.sene@xarala.sn
5
- # => website: http://www.xarala.sn
3
+ # => author: PapePathe github.com/PapePathe
4
+ # => email: pathe.sene@gmail.com
5
+
6
6
  # => the names & first names in this module were found at this url : http://www.senegalaisement.com/senegal/noms_et_prenoms.html
7
+
7
8
  module Faker
8
9
  module NameSN
9
10
  extend ModuleUtils
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- # => author: xarala
3
+ # => author: PapePathe
4
4
  # => email: pathe.sene@xarala.sn
5
5
  # => website: http://www.xarala.sn
6
6
  module Faker
@@ -30,7 +30,7 @@ module Faker
30
30
  def model
31
31
  case rand(2)
32
32
  when 0 then "#{LETTERS.rand.upcase}#{rand(90)}" # N90
33
- when 1 then "#{letters(0..rand(2))}-#{rand(9900)}" # N-9400
33
+ when 1 then "#{letters(1..rand(1..2))}-#{rand(9900)}" # N-9400
34
34
  end
35
35
  end
36
36
 
@@ -0,0 +1,26 @@
1
+ # encoding: utf-8
2
+
3
+ # => author: PapePathe github.com/PapePathe
4
+ # => email: pathe.sene@gmail.com
5
+
6
+ require "helper"
7
+
8
+ class TestAddressSn < Test::Unit::TestCase
9
+
10
+ def setup
11
+ @subject = Faker::AddressSN
12
+ end
13
+
14
+ def test_region
15
+ assert Faker::AddressSN::REGIONS.include?(Faker::AddressSN.region)
16
+ end
17
+
18
+ def test_departement
19
+ assert Faker::AddressSN::DEPARTEMENTS.include?(Faker::AddressSN.departement)
20
+ end
21
+
22
+ def test_arrondissement
23
+ assert Faker::AddressSN::ARRONDISSEMENTS.include?(Faker::AddressSN.arrondissement)
24
+ end
25
+
26
+ end
@@ -0,0 +1,32 @@
1
+ require 'helper'
2
+
3
+ class TestFakerEducation < Test::Unit::TestCase
4
+ def setup
5
+ @tester = Faker::Education
6
+ end
7
+
8
+ def test_degree_short
9
+ assert @tester.degree_short.match(/.+ in .+/)
10
+ end
11
+
12
+ def test_degree
13
+ assert @tester.degree.match(/.+ in .+/)
14
+ end
15
+
16
+ def test_major
17
+ assert @tester.major.match(/.+ .+/)
18
+ end
19
+
20
+ def test_school_name
21
+ assert @tester.school_name.match(/.+/)
22
+ end
23
+
24
+ def test_school_generic_name
25
+ assert @tester.school_name.match(/.+/)
26
+ end
27
+
28
+ def test_school
29
+ assert @tester.school.match(/.+ .+( .+)?/)
30
+ end
31
+ end
32
+
@@ -1,4 +1,8 @@
1
1
  # encoding: utf-8
2
+
3
+ # => author: PapePathe github.com/PapePathe
4
+ # => email: pathe.sene@gmail.com
5
+
2
6
  require 'helper'
3
7
 
4
8
  class TestFakerNameSn < Test::Unit::TestCase
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: 1.13.0
4
+ version: 1.14.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-27 00:00:00.000000000 Z
12
+ date: 2012-03-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Faster Faker, generates dummy data.
15
15
  email: EmmanuelOga@gmail.com
@@ -30,6 +30,7 @@ files:
30
30
  - lib/ffaker/address_au.rb
31
31
  - lib/ffaker/address_ca.rb
32
32
  - lib/ffaker/address_de.rb
33
+ - lib/ffaker/address_sn.rb
33
34
  - lib/ffaker/address_uk.rb
34
35
  - lib/ffaker/address_us.rb
35
36
  - lib/ffaker/company.rb
@@ -61,10 +62,12 @@ files:
61
62
  - test/test_address_au.rb
62
63
  - test/test_address_ca.rb
63
64
  - test/test_address_de.rb
65
+ - test/test_address_sn.rb
64
66
  - test/test_address_uk.rb
65
67
  - test/test_address_us.rb
66
68
  - test/test_array_utils.rb
67
69
  - test/test_company.rb
70
+ - test/test_education.rb
68
71
  - test/test_faker.rb
69
72
  - test/test_faker_internet.rb
70
73
  - test/test_faker_job.rb
@@ -104,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
107
  version: '0'
105
108
  requirements: []
106
109
  rubyforge_project: ffaker
107
- rubygems_version: 1.8.10
110
+ rubygems_version: 1.8.21
108
111
  signing_key:
109
112
  specification_version: 2
110
113
  summary: Faster Faker, generates dummy data.
@@ -113,10 +116,12 @@ test_files:
113
116
  - test/test_address_au.rb
114
117
  - test/test_address_ca.rb
115
118
  - test/test_address_de.rb
119
+ - test/test_address_sn.rb
116
120
  - test/test_address_uk.rb
117
121
  - test/test_address_us.rb
118
122
  - test/test_array_utils.rb
119
123
  - test/test_company.rb
124
+ - test/test_education.rb
120
125
  - test/test_faker.rb
121
126
  - test/test_faker_internet.rb
122
127
  - test/test_faker_job.rb