apt-spy2 0.5.0 → 0.6.0
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/.dockerignore +1 -0
- data/.gitignore +3 -0
- data/.travis.yml +3 -1
- data/CONTRIBUTING.md +22 -0
- data/Dockerfile +11 -0
- data/Gemfile.lock +44 -9
- data/LICENSE +25 -0
- data/Makefile +11 -0
- data/README.md +1 -11
- data/Rakefile +4 -1
- data/apt-spy2.gemspec +3 -2
- data/lib/apt/spy2.rb +12 -7
- data/lib/apt/spy2/version.rb +1 -1
- metadata +52 -44
- data/Vagrantfile +0 -11
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8bc5fe05fc150dd3297f51674ebb8bfafbd2d97b
|
4
|
+
data.tar.gz: ea7179bfa2d4eca39e3507542c0ed040da70344c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ff651b447123c72f61d37aaf4fcb1bc5d09026bc68bd4c89c1ce3c113af8b2be2423ac77298376a2ce1fe895a01683222139a6ba9e73673bc35b23914f765c83
|
7
|
+
data.tar.gz: 7fcdd35d05da224b3c6e11a9e72a67bbb44f7326493ce1b72f67dd2c8e9a9ea034de5cbd161be139d11379e2722a23e19a0b97ebfc525181ed75ce32446b0f07
|
data/.dockerignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
vendor/bundle
|
data/.travis.yml
CHANGED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Contribute!
|
2
|
+
|
3
|
+
First off: all contributions are welcome and thanks for taking the time!
|
4
|
+
|
5
|
+
## Setup
|
6
|
+
|
7
|
+
Clone the repository and install the dependencies:
|
8
|
+
|
9
|
+
```
|
10
|
+
gem install bundler
|
11
|
+
bundle install --dev
|
12
|
+
```
|
13
|
+
|
14
|
+
## Submit
|
15
|
+
|
16
|
+
1. Make a feature branch (`topics/foo` or `bugfix/foo`).
|
17
|
+
2. Run `bundle exec rake test`.
|
18
|
+
3. Send a pull-request.
|
19
|
+
|
20
|
+
## Testing
|
21
|
+
|
22
|
+
If applicable, please add a new test. :)
|
data/Dockerfile
ADDED
data/Gemfile.lock
CHANGED
@@ -1,29 +1,64 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
apt-spy2 (0.
|
4
|
+
apt-spy2 (0.6.0)
|
5
5
|
colored (>= 1.2)
|
6
6
|
json
|
7
|
-
nokogiri (
|
7
|
+
nokogiri (>= 1.6, < 1.11)
|
8
8
|
thor (>= 0.18.1)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
13
|
colored (1.2)
|
14
|
-
|
15
|
-
|
14
|
+
coveralls (0.7.0)
|
15
|
+
multi_json (~> 1.3)
|
16
|
+
rest-client
|
17
|
+
simplecov (>= 0.7)
|
18
|
+
term-ansicolor
|
19
|
+
thor
|
20
|
+
domain_name (0.5.20190701)
|
21
|
+
unf (>= 0.0.5, < 1.0.0)
|
22
|
+
http-accept (1.7.0)
|
23
|
+
http-cookie (1.0.3)
|
24
|
+
domain_name (~> 0.5)
|
25
|
+
json (2.2.0)
|
26
|
+
mime-types (3.2.2)
|
27
|
+
mime-types-data (~> 3.2015)
|
28
|
+
mime-types-data (3.2019.0331)
|
29
|
+
mini_portile2 (2.4.0)
|
16
30
|
minitest (5.0.8)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
31
|
+
multi_json (1.8.0)
|
32
|
+
netrc (0.11.0)
|
33
|
+
nokogiri (1.10.4)
|
34
|
+
mini_portile2 (~> 2.4.0)
|
35
|
+
rake (12.3.3)
|
36
|
+
rest-client (2.1.0)
|
37
|
+
http-accept (>= 1.7.0, < 2.0)
|
38
|
+
http-cookie (>= 1.0.2, < 2.0)
|
39
|
+
mime-types (>= 1.16, < 4.0)
|
40
|
+
netrc (~> 0.8)
|
41
|
+
simplecov (0.7.1)
|
42
|
+
multi_json (~> 1.0)
|
43
|
+
simplecov-html (~> 0.7.1)
|
44
|
+
simplecov-html (0.7.1)
|
45
|
+
term-ansicolor (1.2.2)
|
46
|
+
tins (~> 0.8)
|
47
|
+
thor (0.20.3)
|
48
|
+
tins (0.11.0)
|
49
|
+
unf (0.1.4)
|
50
|
+
unf_ext
|
51
|
+
unf_ext (0.0.7.6)
|
21
52
|
|
22
53
|
PLATFORMS
|
23
54
|
ruby
|
24
55
|
|
25
56
|
DEPENDENCIES
|
26
57
|
apt-spy2!
|
27
|
-
bundler (~>
|
58
|
+
bundler (~> 2.0)
|
59
|
+
coveralls
|
28
60
|
minitest (~> 5.0.8)
|
29
61
|
rake
|
62
|
+
|
63
|
+
BUNDLED WITH
|
64
|
+
2.0.2
|
data/LICENSE
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
BSD 2-Clause License
|
2
|
+
|
3
|
+
Copyright (c) 2013-2019, Till Klampaeckel
|
4
|
+
All rights reserved.
|
5
|
+
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
10
|
+
list of conditions and the following disclaimer.
|
11
|
+
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
14
|
+
and/or other materials provided with the distribution.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
17
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
18
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
20
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
21
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
22
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
23
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
24
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
25
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/Makefile
ADDED
data/README.md
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
[](https://travis-ci.org/lagged/apt-spy2)
|
6
6
|
[](http://badge.fury.io/rb/apt-spy2)
|
7
7
|
[](https://codeclimate.com/github/lagged/apt-spy2)
|
8
|
+
[](https://coveralls.io/r/lagged/apt-spy2)
|
8
9
|
|
9
10
|
|
10
11
|
## Installation
|
@@ -80,14 +81,3 @@ Generally, `apt-spy2` plays especially nice in a non-interactive environment and
|
|
80
81
|
## License
|
81
82
|
|
82
83
|
[New BSD License](http://opensource.org/licenses/BSD-2-Clause)
|
83
|
-
|
84
|
-
## Contributions are welcome
|
85
|
-
|
86
|
-
Clone the repository and install the dependencies:
|
87
|
-
|
88
|
-
```
|
89
|
-
gem install bundler
|
90
|
-
bundle install --dev
|
91
|
-
```
|
92
|
-
|
93
|
-
Make a feature branch (`topics/foo` or `bugfix/foo`) and send a pull-request.
|
data/Rakefile
CHANGED
data/apt-spy2.gemspec
CHANGED
@@ -21,9 +21,10 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency 'thor', '>= 0.18.1'
|
22
22
|
spec.add_dependency 'colored', '>= 1.2'
|
23
23
|
spec.add_dependency 'json'
|
24
|
-
spec.add_dependency 'nokogiri', '
|
24
|
+
spec.add_dependency 'nokogiri', '>= 1.6', '< 1.11'
|
25
25
|
|
26
|
-
spec.add_development_dependency "bundler", "~>
|
26
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
27
27
|
spec.add_development_dependency "rake"
|
28
28
|
spec.add_development_dependency "minitest", "~> 5.0.8"
|
29
|
+
spec.add_development_dependency "coveralls"
|
29
30
|
end
|
data/lib/apt/spy2.rb
CHANGED
@@ -18,7 +18,7 @@ class AptSpy2 < Thor
|
|
18
18
|
def fix
|
19
19
|
working = filter(retrieve(options[:country], use_launchpad?(options)), false)
|
20
20
|
print "The closest mirror is: "
|
21
|
-
puts "#{working[0]}".
|
21
|
+
puts "#{working[0]}".bold.magenta
|
22
22
|
if !options[:commit]
|
23
23
|
puts "Run with --commit to adjust /etc/apt/sources.list".yellow
|
24
24
|
else
|
@@ -57,6 +57,12 @@ class AptSpy2 < Thor
|
|
57
57
|
puts mirrors if !@writer.json?
|
58
58
|
end
|
59
59
|
|
60
|
+
desc "version", "Show which version of apt-spy2 is installed"
|
61
|
+
def version
|
62
|
+
puts Apt::Spy2::VERSION
|
63
|
+
exit
|
64
|
+
end
|
65
|
+
|
60
66
|
private
|
61
67
|
def retrieve(country = "mirrors", launchpad = false)
|
62
68
|
|
@@ -88,10 +94,10 @@ class AptSpy2 < Thor
|
|
88
94
|
mirrors.each do |mirror|
|
89
95
|
data = {"mirror" => mirror }
|
90
96
|
begin
|
91
|
-
|
97
|
+
open(mirror)
|
92
98
|
data["status"] = "up"
|
93
99
|
working_mirrors << mirror
|
94
|
-
rescue OpenURI::HTTPError
|
100
|
+
rescue OpenURI::HTTPError
|
95
101
|
data["status"] = "broken"
|
96
102
|
rescue Errno::ECONNREFUSED
|
97
103
|
data["status"] = "down"
|
@@ -129,7 +135,7 @@ class AptSpy2 < Thor
|
|
129
135
|
end
|
130
136
|
|
131
137
|
puts "Updated '#{apt_sources}' with #{mirror}".green
|
132
|
-
puts "Run `apt-get update` to update".
|
138
|
+
puts "Run `apt-get update` to update".black_on_yellow
|
133
139
|
end
|
134
140
|
|
135
141
|
private
|
@@ -138,11 +144,10 @@ class AptSpy2 < Thor
|
|
138
144
|
return false
|
139
145
|
end
|
140
146
|
|
141
|
-
|
142
147
|
if options[:country] && options[:country] == 'mirrors'
|
143
|
-
raise "Please supply a
|
148
|
+
raise "Please supply a `--country=foo`. Launchpad cannot guess!"
|
144
149
|
end
|
145
150
|
|
146
151
|
return true
|
147
152
|
end
|
148
|
-
end
|
153
|
+
end
|
data/lib/apt/spy2/version.rb
CHANGED
metadata
CHANGED
@@ -1,128 +1,133 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apt-spy2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.6.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- till
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2019-08-26 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: thor
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 0.18.1
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 0.18.1
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: colored
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '1.2'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '1.2'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: json
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: nokogiri
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
|
-
version: 1.6
|
61
|
+
version: '1.6'
|
62
|
+
- - "<"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '1.11'
|
70
65
|
type: :runtime
|
71
66
|
prerelease: false
|
72
67
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
68
|
requirements:
|
75
|
-
- -
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '1.6'
|
72
|
+
- - "<"
|
76
73
|
- !ruby/object:Gem::Version
|
77
|
-
version: 1.
|
74
|
+
version: '1.11'
|
78
75
|
- !ruby/object:Gem::Dependency
|
79
76
|
name: bundler
|
80
77
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
78
|
requirements:
|
83
|
-
- - ~>
|
79
|
+
- - "~>"
|
84
80
|
- !ruby/object:Gem::Version
|
85
|
-
version: '
|
81
|
+
version: '2.0'
|
86
82
|
type: :development
|
87
83
|
prerelease: false
|
88
84
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
85
|
requirements:
|
91
|
-
- - ~>
|
86
|
+
- - "~>"
|
92
87
|
- !ruby/object:Gem::Version
|
93
|
-
version: '
|
88
|
+
version: '2.0'
|
94
89
|
- !ruby/object:Gem::Dependency
|
95
90
|
name: rake
|
96
91
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
92
|
requirements:
|
99
|
-
- -
|
93
|
+
- - ">="
|
100
94
|
- !ruby/object:Gem::Version
|
101
95
|
version: '0'
|
102
96
|
type: :development
|
103
97
|
prerelease: false
|
104
98
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
99
|
requirements:
|
107
|
-
- -
|
100
|
+
- - ">="
|
108
101
|
- !ruby/object:Gem::Version
|
109
102
|
version: '0'
|
110
103
|
- !ruby/object:Gem::Dependency
|
111
104
|
name: minitest
|
112
105
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
106
|
requirements:
|
115
|
-
- - ~>
|
107
|
+
- - "~>"
|
116
108
|
- !ruby/object:Gem::Version
|
117
109
|
version: 5.0.8
|
118
110
|
type: :development
|
119
111
|
prerelease: false
|
120
112
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
113
|
requirements:
|
123
|
-
- - ~>
|
114
|
+
- - "~>"
|
124
115
|
- !ruby/object:Gem::Version
|
125
116
|
version: 5.0.8
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: coveralls
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
126
131
|
description: Keep your /etc/apt/sources.list up to date
|
127
132
|
email:
|
128
133
|
- till@php.net
|
@@ -131,13 +136,17 @@ executables:
|
|
131
136
|
extensions: []
|
132
137
|
extra_rdoc_files: []
|
133
138
|
files:
|
134
|
-
- .
|
135
|
-
- .
|
139
|
+
- ".dockerignore"
|
140
|
+
- ".gitignore"
|
141
|
+
- ".travis.yml"
|
142
|
+
- CONTRIBUTING.md
|
143
|
+
- Dockerfile
|
136
144
|
- Gemfile
|
137
145
|
- Gemfile.lock
|
146
|
+
- LICENSE
|
147
|
+
- Makefile
|
138
148
|
- README.md
|
139
149
|
- Rakefile
|
140
|
-
- Vagrantfile
|
141
150
|
- apt-spy2.gemspec
|
142
151
|
- bin/apt-spy2
|
143
152
|
- lib/apt/spy2.rb
|
@@ -154,26 +163,25 @@ files:
|
|
154
163
|
homepage: https://github.com/lagged/apt-spy2
|
155
164
|
licenses:
|
156
165
|
- BSD
|
166
|
+
metadata: {}
|
157
167
|
post_install_message:
|
158
168
|
rdoc_options: []
|
159
169
|
require_paths:
|
160
170
|
- lib
|
161
171
|
required_ruby_version: !ruby/object:Gem::Requirement
|
162
|
-
none: false
|
163
172
|
requirements:
|
164
|
-
- -
|
173
|
+
- - ">="
|
165
174
|
- !ruby/object:Gem::Version
|
166
175
|
version: '0'
|
167
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
|
-
none: false
|
169
177
|
requirements:
|
170
|
-
- -
|
178
|
+
- - ">="
|
171
179
|
- !ruby/object:Gem::Version
|
172
180
|
version: '0'
|
173
181
|
requirements: []
|
174
182
|
rubyforge_project:
|
175
|
-
rubygems_version:
|
183
|
+
rubygems_version: 2.5.2.3
|
176
184
|
signing_key:
|
177
|
-
specification_version:
|
185
|
+
specification_version: 4
|
178
186
|
summary: apt-spy2, or apt-spy for ubuntu
|
179
187
|
test_files: []
|
data/Vagrantfile
DELETED