tdffaker 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/tdffaker.rb +131 -0
- metadata +45 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: b75f8caab3b8fd49c5e2d6444ed8b158a1857b70
|
|
4
|
+
data.tar.gz: 1e2526378971a0b67c6cde1219007bd94f40d63f
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: edd9e634a290fea0121dad82e4b7df03128426537be732bee112e84cca09f1e37dc646f0433130681e5b8a26f124289daafdb36ea0a16a30bca0823e90219bd7
|
|
7
|
+
data.tar.gz: e10724ae669bd03ac04ef9e0425aef97ac402d421cbd1fba175ca3891f21c0ba799e89ab1424af27ee237a0ac46d49e61e3f15193c1ab936ec989618c80f7fd2
|
data/lib/tdffaker.rb
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
module TDFFaker
|
|
2
|
+
class GeneralClassification
|
|
3
|
+
|
|
4
|
+
YEAR, COUNTRY, NAME = 0, 1, 2
|
|
5
|
+
|
|
6
|
+
DATA =
|
|
7
|
+
[
|
|
8
|
+
['1903', 'France' , 'Maurice Garin'],
|
|
9
|
+
['1904', 'France' , 'Henri Cornet'],
|
|
10
|
+
['1905', 'France' , 'Louis Trousselier'],
|
|
11
|
+
['1906', 'France' , 'René Pottier'],
|
|
12
|
+
['1907', 'France' , 'Lucien Petit-Breton'],
|
|
13
|
+
['1908', 'France' , 'Lucien Petit-Breton'],
|
|
14
|
+
['1909', 'Luxembourg', 'François Faber'],
|
|
15
|
+
['1910', 'France' , 'Octave Lapize'],
|
|
16
|
+
['1911', 'France' , 'Gustave Garrigou'],
|
|
17
|
+
['1912', 'Belgium' , 'Odile Defraye'],
|
|
18
|
+
['1913', 'Belgium' , 'Philippe Thys'],
|
|
19
|
+
['1914', 'Belgium' , 'Philippe Thys'],
|
|
20
|
+
['1919', 'Belgium' , 'Firmin Lambot'],
|
|
21
|
+
['1920', 'Belgium' , 'Philippe Thys'],
|
|
22
|
+
['1921', 'Belgium' , 'Léon Scieur'],
|
|
23
|
+
['1922', 'Belgium' , 'Firmin Lambot'],
|
|
24
|
+
['1923', 'France' , 'Henri Pélissier'],
|
|
25
|
+
['1924', 'Italy' , 'Ottavio Bottecchia'],
|
|
26
|
+
['1925', 'Italy' , 'Ottavio Bottecchia'],
|
|
27
|
+
['1926', 'Belgium' , 'Lucien Buysse'],
|
|
28
|
+
['1927', 'Luxembourg', 'Nicolas Frantz'],
|
|
29
|
+
['1928', 'Luxembourg', 'Nicolas Frantz'],
|
|
30
|
+
['1929', 'Belgium' , 'Maurice De Waele'],
|
|
31
|
+
['1930', 'France' , 'André Leducq'],
|
|
32
|
+
['1931', 'France' , 'Antonin Magne'],
|
|
33
|
+
['1932', 'France' , 'André Leducq'],
|
|
34
|
+
['1933', 'France' , 'Georges Speicher'],
|
|
35
|
+
['1934', 'France' , 'Antonin Magne'],
|
|
36
|
+
['1935', 'Belgium' , 'Romain Maes'],
|
|
37
|
+
['1936', 'Belgium' , 'Sylvère Maes'],
|
|
38
|
+
['1937', 'France' , 'Roger Lapébie'],
|
|
39
|
+
['1938', 'Italy' , 'Gino Bartali'],
|
|
40
|
+
['1939', 'Belgium' , 'Sylvère Maes'],
|
|
41
|
+
['1947', 'France' , 'Jean Robic'],
|
|
42
|
+
['1948', 'Italy' , 'Gino Bartali'],
|
|
43
|
+
['1949', 'Italy' , 'Fausto Coppi'],
|
|
44
|
+
['1950', 'Switzerland', 'Ferdinand Kübler'],
|
|
45
|
+
['1951', 'Switzerland', 'Hugo Koblet'],
|
|
46
|
+
['1952', 'Italy' , 'Fausto Coppi'],
|
|
47
|
+
['1953', 'France' , 'Louison Bobet'],
|
|
48
|
+
['1954', 'France' , 'Louison Bobet'],
|
|
49
|
+
['1955', 'France' , 'Louison Bobet'],
|
|
50
|
+
['1956', 'France' , 'Roger Walkowiak'],
|
|
51
|
+
['1957', 'France' , 'Jacques Anquetil'],
|
|
52
|
+
['1958', 'Luxembourg', 'Charly Gaul'],
|
|
53
|
+
['1959', 'Spain' , 'Federico Bahamontes'],
|
|
54
|
+
['1960', 'Italy' , 'Gastone Nencini'],
|
|
55
|
+
['1961', 'France' , 'Jacques Anquetil'],
|
|
56
|
+
['1962', 'France' , 'Jacques Anquetil'],
|
|
57
|
+
['1963', 'France' , 'Jacques Anquetil'],
|
|
58
|
+
['1964', 'France' , 'Jacques Anquetil'],
|
|
59
|
+
['1965', 'Italy' , 'Felice Gimondi'],
|
|
60
|
+
['1966', 'France' , 'Lucien Aimar'],
|
|
61
|
+
['1967', 'France' , 'Roger Pingeon'],
|
|
62
|
+
['1968', 'Netherlands', 'Jan Janssen'],
|
|
63
|
+
['1969', 'Belgium' , 'Eddy Merckx'],
|
|
64
|
+
['1970', 'Belgium' , 'Eddy Merckx'],
|
|
65
|
+
['1971', 'Belgium' , 'Eddy Merckx'],
|
|
66
|
+
['1972', 'Belgium' , 'Eddy Merckx'],
|
|
67
|
+
['1973', 'Spain' , 'Luis Ocaña'],
|
|
68
|
+
['1974', 'Belgium' , 'Eddy Merckx'],
|
|
69
|
+
['1975', 'France' , 'Bernard Thévenet'],
|
|
70
|
+
['1976', 'Belgium' , 'Lucien Van Impe'],
|
|
71
|
+
['1977', 'France' , 'Bernard Thévenet'],
|
|
72
|
+
['1978', 'France' , 'Bernard Hinault'],
|
|
73
|
+
['1979', 'France' , 'Bernard Hinault'],
|
|
74
|
+
['1980', 'Netherlands', 'Joop Zoetemelk'],
|
|
75
|
+
['1981', 'France' , 'Bernard Hinault'],
|
|
76
|
+
['1982', 'France' , 'Bernard Hinault'],
|
|
77
|
+
['1983', 'France' , 'Laurent Fignon'],
|
|
78
|
+
['1984', 'France' , 'Laurent Fignon'],
|
|
79
|
+
['1985', 'France' , 'Bernard Hinault'],
|
|
80
|
+
['1986', 'United States', 'Greg LeMond'],
|
|
81
|
+
['1987', 'Ireland' , 'Stephen Roche'],
|
|
82
|
+
['1988', 'Spain' , 'Pedro Delgado'],
|
|
83
|
+
['1989', 'United States', 'Greg LeMond'],
|
|
84
|
+
['1990', 'United States', 'Greg LeMond'],
|
|
85
|
+
['1991', 'Spain' , 'Miguel Indurain'],
|
|
86
|
+
['1992', 'Spain' , 'Miguel Indurain'],
|
|
87
|
+
['1993', 'Spain' , 'Miguel Indurain'],
|
|
88
|
+
['1994', 'Spain' , 'Miguel Indurain'],
|
|
89
|
+
['1995', 'Spain' , 'Miguel Indurain'],
|
|
90
|
+
['1996', 'Denmark' , 'Bjarne Riis'],
|
|
91
|
+
['1997', 'Germany' , 'Jan Ullrich'],
|
|
92
|
+
['1998', 'Italy' , 'Marco Pantani'],
|
|
93
|
+
['2006', 'Spain' , 'Óscar Pereiro'],
|
|
94
|
+
['2007', 'Spain' , 'Alberto Contador'],
|
|
95
|
+
['2008', 'Spain' , 'Carlos Sastre'],
|
|
96
|
+
['2009', 'Spain' , 'Alberto Contador'],
|
|
97
|
+
['2010', 'Luxembourg', 'Andy Schleck'],
|
|
98
|
+
['2011', 'Australia' , 'Cadel Evans'],
|
|
99
|
+
['2012', 'Great Britain', 'Bradley Wiggins'],
|
|
100
|
+
['2013', 'Great Britain', 'Chris Froome'],
|
|
101
|
+
['2014', 'Italy' , 'Vincenzo Nibali'],
|
|
102
|
+
['2015', 'Great Britain', 'Chris Froome'],
|
|
103
|
+
['2016', 'Great Britain', 'Chris Froome'],
|
|
104
|
+
['2017', 'Great Britain', 'Chris Froome']
|
|
105
|
+
]
|
|
106
|
+
|
|
107
|
+
def self.full_name ; DATA.sample[NAME] end
|
|
108
|
+
def self.first_name; full_name.split.first end
|
|
109
|
+
def self.surname ; full_name.split[1..-1].join(" ") end
|
|
110
|
+
|
|
111
|
+
def self.country; DATA.sample[COUNTRY] end
|
|
112
|
+
def self.year; DATA.sample[YEAR] end
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def self.winner_from country
|
|
117
|
+
unless all_countries.include? country
|
|
118
|
+
"Unrecognised country"
|
|
119
|
+
else
|
|
120
|
+
DATA.select{ |record| record[COUNTRY] == country}.sample[NAME]
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
private
|
|
126
|
+
def self.all_countries
|
|
127
|
+
DATA.map{ |record| record[COUNTRY] }
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
end
|
|
131
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: tdffaker
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Tim Ash
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2018-03-14 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Faker, but for Tour de France fake data
|
|
14
|
+
email:
|
|
15
|
+
- tim.custard@gmail.com
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- lib/tdffaker.rb
|
|
21
|
+
homepage: https://rubygems.org/gems/tdffaker
|
|
22
|
+
licenses:
|
|
23
|
+
- MIT
|
|
24
|
+
metadata: {}
|
|
25
|
+
post_install_message:
|
|
26
|
+
rdoc_options: []
|
|
27
|
+
require_paths:
|
|
28
|
+
- lib
|
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
requirements: []
|
|
40
|
+
rubyforge_project:
|
|
41
|
+
rubygems_version: 2.5.2.1
|
|
42
|
+
signing_key:
|
|
43
|
+
specification_version: 4
|
|
44
|
+
summary: Easily generate fake Tour de France data
|
|
45
|
+
test_files: []
|