apt-spy2 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +6 -0
- data/Gemfile.lock +7 -1
- data/README.md +43 -18
- data/Rakefile +11 -0
- data/apt-spy2.gemspec +2 -0
- data/bin/apt-spy2 +3 -0
- data/lib/apt/spy2.rb +40 -18
- data/lib/apt/spy2/country.rb +33 -0
- data/lib/apt/spy2/downloader.rb +30 -0
- data/lib/apt/spy2/launchpad.rb +36 -0
- data/lib/apt/spy2/ubuntu_mirrors.rb +19 -0
- data/lib/apt/spy2/version.rb +1 -1
- data/tests/country_test.rb +27 -0
- data/tests/fixtures/launchpad.html +8345 -0
- data/tests/launchpad_test.rb +13 -0
- data/var/country-names.txt +250 -0
- metadata +43 -2
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'apt/spy2/launchpad'
|
2
|
+
|
3
|
+
class LaunchpadTest < Minitest::Test
|
4
|
+
def setup
|
5
|
+
@download_fixture = File.read(File.expand_path(File.dirname(__FILE__) + "/fixtures/launchpad.html"))
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_german_mirrors
|
9
|
+
lp = Apt::Spy2::Launchpad.new(@download_fixture)
|
10
|
+
mirrors = lp.get_mirrors('Germany')
|
11
|
+
assert_equal(false, mirrors.empty?)
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,250 @@
|
|
1
|
+
Country Name;ISO 3166-1-alpha-2 code
|
2
|
+
AFGHANISTAN;AF
|
3
|
+
ÅLAND ISLANDS;AX
|
4
|
+
ALBANIA;AL
|
5
|
+
ALGERIA;DZ
|
6
|
+
AMERICAN SAMOA;AS
|
7
|
+
ANDORRA;AD
|
8
|
+
ANGOLA;AO
|
9
|
+
ANGUILLA;AI
|
10
|
+
ANTARCTICA;AQ
|
11
|
+
ANTIGUA AND BARBUDA;AG
|
12
|
+
ARGENTINA;AR
|
13
|
+
ARMENIA;AM
|
14
|
+
ARUBA;AW
|
15
|
+
AUSTRALIA;AU
|
16
|
+
AUSTRIA;AT
|
17
|
+
AZERBAIJAN;AZ
|
18
|
+
BAHAMAS;BS
|
19
|
+
BAHRAIN;BH
|
20
|
+
BANGLADESH;BD
|
21
|
+
BARBADOS;BB
|
22
|
+
BELARUS;BY
|
23
|
+
BELGIUM;BE
|
24
|
+
BELIZE;BZ
|
25
|
+
BENIN;BJ
|
26
|
+
BERMUDA;BM
|
27
|
+
BHUTAN;BT
|
28
|
+
BOLIVIA, PLURINATIONAL STATE OF;BO
|
29
|
+
BONAIRE, SINT EUSTATIUS AND SABA;BQ
|
30
|
+
BOSNIA AND HERZEGOVINA;BA
|
31
|
+
BOTSWANA;BW
|
32
|
+
BOUVET ISLAND;BV
|
33
|
+
BRAZIL;BR
|
34
|
+
BRITISH INDIAN OCEAN TERRITORY;IO
|
35
|
+
BRUNEI DARUSSALAM;BN
|
36
|
+
BULGARIA;BG
|
37
|
+
BURKINA FASO;BF
|
38
|
+
BURUNDI;BI
|
39
|
+
CAMBODIA;KH
|
40
|
+
CAMEROON;CM
|
41
|
+
CANADA;CA
|
42
|
+
CAPE VERDE;CV
|
43
|
+
CAYMAN ISLANDS;KY
|
44
|
+
CENTRAL AFRICAN REPUBLIC;CF
|
45
|
+
CHAD;TD
|
46
|
+
CHILE;CL
|
47
|
+
CHINA;CN
|
48
|
+
CHRISTMAS ISLAND;CX
|
49
|
+
COCOS (KEELING) ISLANDS;CC
|
50
|
+
COLOMBIA;CO
|
51
|
+
COMOROS;KM
|
52
|
+
CONGO;CG
|
53
|
+
CONGO, THE DEMOCRATIC REPUBLIC OF THE;CD
|
54
|
+
COOK ISLANDS;CK
|
55
|
+
COSTA RICA;CR
|
56
|
+
CÔTE D'IVOIRE;CI
|
57
|
+
CROATIA;HR
|
58
|
+
CUBA;CU
|
59
|
+
CURAÇAO;CW
|
60
|
+
CYPRUS;CY
|
61
|
+
CZECH REPUBLIC;CZ
|
62
|
+
DENMARK;DK
|
63
|
+
DJIBOUTI;DJ
|
64
|
+
DOMINICA;DM
|
65
|
+
DOMINICAN REPUBLIC;DO
|
66
|
+
ECUADOR;EC
|
67
|
+
EGYPT;EG
|
68
|
+
EL SALVADOR;SV
|
69
|
+
EQUATORIAL GUINEA;GQ
|
70
|
+
ERITREA;ER
|
71
|
+
ESTONIA;EE
|
72
|
+
ETHIOPIA;ET
|
73
|
+
FALKLAND ISLANDS (MALVINAS);FK
|
74
|
+
FAROE ISLANDS;FO
|
75
|
+
FIJI;FJ
|
76
|
+
FINLAND;FI
|
77
|
+
FRANCE;FR
|
78
|
+
FRENCH GUIANA;GF
|
79
|
+
FRENCH POLYNESIA;PF
|
80
|
+
FRENCH SOUTHERN TERRITORIES;TF
|
81
|
+
GABON;GA
|
82
|
+
GAMBIA;GM
|
83
|
+
GEORGIA;GE
|
84
|
+
GERMANY;DE
|
85
|
+
GHANA;GH
|
86
|
+
GIBRALTAR;GI
|
87
|
+
GREECE;GR
|
88
|
+
GREENLAND;GL
|
89
|
+
GRENADA;GD
|
90
|
+
GUADELOUPE;GP
|
91
|
+
GUAM;GU
|
92
|
+
GUATEMALA;GT
|
93
|
+
GUERNSEY;GG
|
94
|
+
GUINEA;GN
|
95
|
+
GUINEA-BISSAU;GW
|
96
|
+
GUYANA;GY
|
97
|
+
HAITI;HT
|
98
|
+
HEARD ISLAND AND MCDONALD ISLANDS;HM
|
99
|
+
HOLY SEE (VATICAN CITY STATE);VA
|
100
|
+
HONDURAS;HN
|
101
|
+
HONG KONG;HK
|
102
|
+
HUNGARY;HU
|
103
|
+
ICELAND;IS
|
104
|
+
INDIA;IN
|
105
|
+
INDONESIA;ID
|
106
|
+
IRAN, ISLAMIC REPUBLIC OF;IR
|
107
|
+
IRAQ;IQ
|
108
|
+
IRELAND;IE
|
109
|
+
ISLE OF MAN;IM
|
110
|
+
ISRAEL;IL
|
111
|
+
ITALY;IT
|
112
|
+
JAMAICA;JM
|
113
|
+
JAPAN;JP
|
114
|
+
JERSEY;JE
|
115
|
+
JORDAN;JO
|
116
|
+
KAZAKHSTAN;KZ
|
117
|
+
KENYA;KE
|
118
|
+
KIRIBATI;KI
|
119
|
+
KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF;KP
|
120
|
+
KOREA, REPUBLIC OF;KR
|
121
|
+
KUWAIT;KW
|
122
|
+
KYRGYZSTAN;KG
|
123
|
+
LAO PEOPLE'S DEMOCRATIC REPUBLIC;LA
|
124
|
+
LATVIA;LV
|
125
|
+
LEBANON;LB
|
126
|
+
LESOTHO;LS
|
127
|
+
LIBERIA;LR
|
128
|
+
LIBYA;LY
|
129
|
+
LIECHTENSTEIN;LI
|
130
|
+
LITHUANIA;LT
|
131
|
+
LUXEMBOURG;LU
|
132
|
+
MACAO;MO
|
133
|
+
MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF;MK
|
134
|
+
MADAGASCAR;MG
|
135
|
+
MALAWI;MW
|
136
|
+
MALAYSIA;MY
|
137
|
+
MALDIVES;MV
|
138
|
+
MALI;ML
|
139
|
+
MALTA;MT
|
140
|
+
MARSHALL ISLANDS;MH
|
141
|
+
MARTINIQUE;MQ
|
142
|
+
MAURITANIA;MR
|
143
|
+
MAURITIUS;MU
|
144
|
+
MAYOTTE;YT
|
145
|
+
MEXICO;MX
|
146
|
+
MICRONESIA, FEDERATED STATES OF;FM
|
147
|
+
MOLDOVA, REPUBLIC OF;MD
|
148
|
+
MONACO;MC
|
149
|
+
MONGOLIA;MN
|
150
|
+
MONTENEGRO;ME
|
151
|
+
MONTSERRAT;MS
|
152
|
+
MOROCCO;MA
|
153
|
+
MOZAMBIQUE;MZ
|
154
|
+
MYANMAR;MM
|
155
|
+
NAMIBIA;NA
|
156
|
+
NAURU;NR
|
157
|
+
NEPAL;NP
|
158
|
+
NETHERLANDS;NL
|
159
|
+
NEW CALEDONIA;NC
|
160
|
+
NEW ZEALAND;NZ
|
161
|
+
NICARAGUA;NI
|
162
|
+
NIGER;NE
|
163
|
+
NIGERIA;NG
|
164
|
+
NIUE;NU
|
165
|
+
NORFOLK ISLAND;NF
|
166
|
+
NORTHERN MARIANA ISLANDS;MP
|
167
|
+
NORWAY;NO
|
168
|
+
OMAN;OM
|
169
|
+
PAKISTAN;PK
|
170
|
+
PALAU;PW
|
171
|
+
PALESTINE, STATE OF;PS
|
172
|
+
PANAMA;PA
|
173
|
+
PAPUA NEW GUINEA;PG
|
174
|
+
PARAGUAY;PY
|
175
|
+
PERU;PE
|
176
|
+
PHILIPPINES;PH
|
177
|
+
PITCAIRN;PN
|
178
|
+
POLAND;PL
|
179
|
+
PORTUGAL;PT
|
180
|
+
PUERTO RICO;PR
|
181
|
+
QATAR;QA
|
182
|
+
RÉUNION;RE
|
183
|
+
ROMANIA;RO
|
184
|
+
RUSSIAN FEDERATION;RU
|
185
|
+
RWANDA;RW
|
186
|
+
SAINT BARTHÉLEMY;BL
|
187
|
+
SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA;SH
|
188
|
+
SAINT KITTS AND NEVIS;KN
|
189
|
+
SAINT LUCIA;LC
|
190
|
+
SAINT MARTIN (FRENCH PART);MF
|
191
|
+
SAINT PIERRE AND MIQUELON;PM
|
192
|
+
SAINT VINCENT AND THE GRENADINES;VC
|
193
|
+
SAMOA;WS
|
194
|
+
SAN MARINO;SM
|
195
|
+
SAO TOME AND PRINCIPE;ST
|
196
|
+
SAUDI ARABIA;SA
|
197
|
+
SENEGAL;SN
|
198
|
+
SERBIA;RS
|
199
|
+
SEYCHELLES;SC
|
200
|
+
SIERRA LEONE;SL
|
201
|
+
SINGAPORE;SG
|
202
|
+
SINT MAARTEN (DUTCH PART);SX
|
203
|
+
SLOVAKIA;SK
|
204
|
+
SLOVENIA;SI
|
205
|
+
SOLOMON ISLANDS;SB
|
206
|
+
SOMALIA;SO
|
207
|
+
SOUTH AFRICA;ZA
|
208
|
+
SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS;GS
|
209
|
+
SOUTH SUDAN;SS
|
210
|
+
SPAIN;ES
|
211
|
+
SRI LANKA;LK
|
212
|
+
SUDAN;SD
|
213
|
+
SURINAME;SR
|
214
|
+
SVALBARD AND JAN MAYEN;SJ
|
215
|
+
SWAZILAND;SZ
|
216
|
+
SWEDEN;SE
|
217
|
+
SWITZERLAND;CH
|
218
|
+
SYRIAN ARAB REPUBLIC;SY
|
219
|
+
TAIWAN, PROVINCE OF CHINA;TW
|
220
|
+
TAJIKISTAN;TJ
|
221
|
+
TANZANIA, UNITED REPUBLIC OF;TZ
|
222
|
+
THAILAND;TH
|
223
|
+
TIMOR-LESTE;TL
|
224
|
+
TOGO;TG
|
225
|
+
TOKELAU;TK
|
226
|
+
TONGA;TO
|
227
|
+
TRINIDAD AND TOBAGO;TT
|
228
|
+
TUNISIA;TN
|
229
|
+
TURKEY;TR
|
230
|
+
TURKMENISTAN;TM
|
231
|
+
TURKS AND CAICOS ISLANDS;TC
|
232
|
+
TUVALU;TV
|
233
|
+
UGANDA;UG
|
234
|
+
UKRAINE;UA
|
235
|
+
UNITED ARAB EMIRATES;AE
|
236
|
+
UNITED KINGDOM;GB
|
237
|
+
UNITED STATES;US
|
238
|
+
UNITED STATES MINOR OUTLYING ISLANDS;UM
|
239
|
+
URUGUAY;UY
|
240
|
+
UZBEKISTAN;UZ
|
241
|
+
VANUATU;VU
|
242
|
+
VENEZUELA, BOLIVARIAN REPUBLIC OF;VE
|
243
|
+
VIET NAM;VN
|
244
|
+
VIRGIN ISLANDS, BRITISH;VG
|
245
|
+
VIRGIN ISLANDS, U.S.;VI
|
246
|
+
WALLIS AND FUTUNA;WF
|
247
|
+
WESTERN SAHARA;EH
|
248
|
+
YEMEN;YE
|
249
|
+
ZAMBIA;ZM
|
250
|
+
ZIMBABWE;ZW
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apt-spy2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.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: 2013-
|
12
|
+
date: 2013-09-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -59,6 +59,22 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: nokogiri
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.6.0
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.6.0
|
62
78
|
- !ruby/object:Gem::Dependency
|
63
79
|
name: bundler
|
64
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -91,6 +107,22 @@ dependencies:
|
|
91
107
|
- - ! '>='
|
92
108
|
- !ruby/object:Gem::Version
|
93
109
|
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: minitest
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 5.0.8
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 5.0.8
|
94
126
|
description: Keep your /etc/apt/sources.list up to date
|
95
127
|
email:
|
96
128
|
- till@php.net
|
@@ -100,6 +132,7 @@ extensions: []
|
|
100
132
|
extra_rdoc_files: []
|
101
133
|
files:
|
102
134
|
- .gitignore
|
135
|
+
- .travis.yml
|
103
136
|
- Gemfile
|
104
137
|
- Gemfile.lock
|
105
138
|
- README.md
|
@@ -108,8 +141,16 @@ files:
|
|
108
141
|
- apt-spy2.gemspec
|
109
142
|
- bin/apt-spy2
|
110
143
|
- lib/apt/spy2.rb
|
144
|
+
- lib/apt/spy2/country.rb
|
145
|
+
- lib/apt/spy2/downloader.rb
|
146
|
+
- lib/apt/spy2/launchpad.rb
|
147
|
+
- lib/apt/spy2/ubuntu_mirrors.rb
|
111
148
|
- lib/apt/spy2/version.rb
|
112
149
|
- lib/apt/spy2/writer.rb
|
150
|
+
- tests/country_test.rb
|
151
|
+
- tests/fixtures/launchpad.html
|
152
|
+
- tests/launchpad_test.rb
|
153
|
+
- var/country-names.txt
|
113
154
|
homepage: https://github.com/lagged/apt-spy2
|
114
155
|
licenses:
|
115
156
|
- BSD
|