apt-spy2 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91d09bec4d6918e39405d38ee164b8215c6e04d778887c0e570bdab6cc39592e
4
- data.tar.gz: d2f69bf166ca8bf79fff732e30184270dfbc0422a41dbe616afc9ddd56b21641
3
+ metadata.gz: 89ef6a24eb7eafd20007b54eadeeeea4ffa0c10114dca7efd62d4a8b7adff3c7
4
+ data.tar.gz: e129a99d18c3e17262f7b3e0c04aafef66041861bf6fd5d144fd7d139e254f0c
5
5
  SHA512:
6
- metadata.gz: 931ef089f949e870538b77887a7825a42647bcc8a4ef577118a12b51112bcba1b1a63c235d2bbe0e1fed348608d84954c6a44c7f16a578e42c29e198a4403619
7
- data.tar.gz: 956aa4b5d89409a4366549b84846a42b95c46f7013197182fdfd22956ba07e60fddccf5f210a5eb85d0c09f3e8ff15cc730642ea1afb66b9fee81703cb172da3
6
+ metadata.gz: 33df33456da6b923723eb9253ca7c774b35bb42306d27ab00fddaf861f758fe6fe6e7d9f0993d5c4481cc0b818b859589cb3c85a8e199ee79f4da12275fb8ece
7
+ data.tar.gz: bcffd1814b734650587939c66c6c545b76c171920db3558b5551b1ddd7b657e0b5a9429842403aff1a4b976ea16c77c462f191c444a7c58414d59ef6b87a2bbd
@@ -11,6 +11,7 @@ jobs:
11
11
  strategy:
12
12
  matrix:
13
13
  ruby-version:
14
+ - '3.1'
14
15
  - '3.0'
15
16
  - 2.7
16
17
  - 2.6
@@ -24,7 +25,7 @@ jobs:
24
25
  - run: bundle exec rake build
25
26
  - run: ls -lah ./pkg/apt-spy2*
26
27
  - run: gem install pkg/apt-spy2*
27
- - run: apt-spy2
28
+ - run: apt-spy2 check
28
29
  - uses: coverallsapp/github-action@master
29
30
  with:
30
31
  github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: release
3
+
4
+ on:
5
+ push:
6
+ tags:
7
+ - 'v*'
8
+
9
+ jobs:
10
+ publish:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: 3.0
17
+ - run: bundle install
18
+ - uses: cadwallion/publish-rubygems-action@master
19
+ env:
20
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21
+ RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
22
+ RELEASE_COMMAND: bundle exec rake release
data/Dockerfile CHANGED
@@ -1,9 +1,4 @@
1
- FROM ubuntu:18.04
2
-
3
- RUN apt-get update -y \
4
- && apt-get install -y ruby ruby-dev git gcc g++ make zlib1g-dev lsb-release \
5
- && gem install bundler \
6
- && mkdir -p /work
1
+ FROM ruby:2.6-slim
7
2
 
8
3
  WORKDIR /work
9
4
  COPY . /work
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- apt-spy2 (0.7.2)
4
+ apt-spy2 (0.7.3)
5
5
  colored (>= 1.2)
6
6
  json
7
7
  nokogiri (>= 1.6, < 1.13)
@@ -13,10 +13,12 @@ GEM
13
13
  colored (1.2)
14
14
  docile (1.4.0)
15
15
  json (2.6.1)
16
+ mini_portile2 (2.6.1)
16
17
  minitest (5.15.0)
17
- nokogiri (1.12.5-x86_64-darwin)
18
+ nokogiri (1.12.5)
19
+ mini_portile2 (~> 2.6.1)
18
20
  racc (~> 1.4)
19
- racc (1.5.2)
21
+ racc (1.6.0)
20
22
  rake (13.0.6)
21
23
  simplecov (0.21.2)
22
24
  docile (~> 1.1)
data/README.md CHANGED
@@ -81,3 +81,9 @@ Generally, `apt-spy2` plays especially nice in a non-interactive environment and
81
81
  ## License
82
82
 
83
83
  [New BSD License](http://opensource.org/licenses/BSD-2-Clause)
84
+
85
+ ### Release (procedure)
86
+
87
+ - update version in `lib/apt/spy2/version.rb`
88
+ - `bundle install`
89
+ - `git commit -a -m 'New release' && git tag -a vVERSION && git push --tags`
data/apt-spy2.gemspec CHANGED
@@ -13,6 +13,8 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://github.com/lagged/apt-spy2"
14
14
  spec.license = 'BSD-2-Clause'
15
15
 
16
+ spec.required_ruby_version = '>= 2.6', '< 3.2'
17
+
16
18
  spec.files = `git ls-files`.split($/)
17
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
@@ -14,7 +14,7 @@ module Apt
14
14
  raise "Please supply a url." if url.nil?
15
15
 
16
16
  begin
17
- return open(@url).read
17
+ return URI.open(@url, :read_timeout => 10).read
18
18
  rescue OpenURI::HTTPError => the_error
19
19
  case the_error.io.status[0]
20
20
  when "404"
@@ -1,5 +1,5 @@
1
1
  module Apt
2
2
  module Spy2
3
- VERSION = "0.7.2"
3
+ VERSION = "0.7.3"
4
4
  end
5
5
  end
data/lib/apt/spy2.rb CHANGED
@@ -94,7 +94,7 @@ class AptSpy2 < Thor
94
94
  mirrors.each do |mirror|
95
95
  data = {"mirror" => mirror }
96
96
  begin
97
- open(mirror)
97
+ URI.open(mirror)
98
98
  data["status"] = "up"
99
99
  working_mirrors << mirror
100
100
  rescue OpenURI::HTTPError
@@ -0,0 +1,15 @@
1
+ require 'apt/spy2/downloader'
2
+
3
+ class DownloaderTest < Minitest::Test
4
+ # this is an integration test (needs interwebs)
5
+ def test_do()
6
+ downloader = Apt::Spy2::Downloader.new
7
+ data = downloader.do_download("http://mirrors.ubuntu.com/DE.txt")
8
+ assert(!data.empty?, "There should have been a response, unless the mirrors are down.")
9
+ end
10
+
11
+ def test_do_wrong_countrys()
12
+ downloader = Apt::Spy2::Downloader.new
13
+ assert_raises(RuntimeError) { downloader.do_download("http://mirrors.ubuntu.com/de.txt") }
14
+ end
15
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apt-spy2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - till
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-22 00:00:00.000000000 Z
11
+ date: 2021-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -153,6 +153,7 @@ files:
153
153
  - ".dockerignore"
154
154
  - ".github/dependabot.yml"
155
155
  - ".github/workflows/pr.yml"
156
+ - ".github/workflows/release.yml"
156
157
  - ".gitignore"
157
158
  - ".ruby_version"
158
159
  - CONTRIBUTING.md
@@ -173,6 +174,7 @@ files:
173
174
  - lib/apt/spy2/version.rb
174
175
  - lib/apt/spy2/writer.rb
175
176
  - tests/country_test.rb
177
+ - tests/downloader_test.rb
176
178
  - tests/fixtures/launchpad.html
177
179
  - tests/launchpad_test.rb
178
180
  - var/country-names.txt
@@ -180,7 +182,7 @@ homepage: https://github.com/lagged/apt-spy2
180
182
  licenses:
181
183
  - BSD-2-Clause
182
184
  metadata: {}
183
- post_install_message:
185
+ post_install_message:
184
186
  rdoc_options: []
185
187
  require_paths:
186
188
  - lib
@@ -188,7 +190,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
190
  requirements:
189
191
  - - ">="
190
192
  - !ruby/object:Gem::Version
191
- version: '0'
193
+ version: '2.6'
194
+ - - "<"
195
+ - !ruby/object:Gem::Version
196
+ version: '3.2'
192
197
  required_rubygems_version: !ruby/object:Gem::Requirement
193
198
  requirements:
194
199
  - - ">="
@@ -196,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
201
  version: '0'
197
202
  requirements: []
198
203
  rubygems_version: 3.2.32
199
- signing_key:
204
+ signing_key:
200
205
  specification_version: 4
201
206
  summary: apt-spy2, or apt-spy for ubuntu
202
207
  test_files: []