apt-spy2 0.8.0 → 0.8.2

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: 456003f4c6ac4e210a1cd7ebe44888b8a58d3b9fac87d1b68f03e9b3d8c45bdf
4
- data.tar.gz: 907656e6cf49fe081152826de58348ff75d3f2ff1014f5af854dfb24f86e421d
3
+ metadata.gz: 7622e67a84b791b9ff1e03931d4b216d5a2bd879b0ac9334ee6ccc140e1c16b9
4
+ data.tar.gz: a5fc5ef8e9fc0a98e7448253d0e95dc6a55113b3586ae7fbfabb260d78f0c6ff
5
5
  SHA512:
6
- metadata.gz: 5a2c12f506751914dc44243f88ecef036e7a5ca41cab0f6595c70e4c61d7d68e3da6cc304f9879a8b4f8b36fd2daa96b664a8fd91cf5a5a9cf64a06c2723cd10
7
- data.tar.gz: '0815dfcb1e3b857aac1a30a8d0cee549e3c4a8a95ee0213e227b6747bb88939813118fbbaffc3d44ed1de663963c2ab22d7a7f03f552d4cbcd2e744183461fcb'
6
+ metadata.gz: 3f4fd668a86d485758610e2870cd7650c5875671711a027f6149a80ce63134f817b41087aa795ff40106ee39041f78f333224b5285c90d769ee4142a225f3693
7
+ data.tar.gz: d6be7ad7b4db2471f3ef28d5ae6efc4bd9e44fb09c8f3fb337330c42aed0913c784e501eab6bdc6d8f7ac252da759336d06cb2034158c4d221dce21f4fb464b9
@@ -7,3 +7,9 @@ updates:
7
7
  open-pull-requests-limit: 10
8
8
  assignees:
9
9
  - till
10
+ - package-ecosystem: "github-actions"
11
+ directory: "/"
12
+ schedule:
13
+ interval: "weekly"
14
+ assignees:
15
+ - till
@@ -38,11 +38,11 @@ jobs:
38
38
 
39
39
  steps:
40
40
  - name: Checkout repository
41
- uses: actions/checkout@v2
41
+ uses: actions/checkout@v3
42
42
 
43
43
  # Initializes the CodeQL tools for scanning.
44
44
  - name: Initialize CodeQL
45
- uses: github/codeql-action/init@v1
45
+ uses: github/codeql-action/init@v2
46
46
  with:
47
47
  languages: ${{ matrix.language }}
48
48
  # If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
53
53
  # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54
54
  # If this step fails, then you should remove it and run the build manually (see below)
55
55
  - name: Autobuild
56
- uses: github/codeql-action/autobuild@v1
56
+ uses: github/codeql-action/autobuild@v2
57
57
 
58
58
  # ℹ️ Command-line programs to run using the OS shell.
59
59
  # 📚 https://git.io/JvXDl
@@ -67,4 +67,4 @@ jobs:
67
67
  # make release
68
68
 
69
69
  - name: Perform CodeQL Analysis
70
- uses: github/codeql-action/analyze@v1
70
+ uses: github/codeql-action/analyze@v2
@@ -26,6 +26,7 @@ jobs:
26
26
  - run: ls -lah ./pkg/apt-spy2*
27
27
  - run: gem install pkg/apt-spy2*
28
28
  - run: apt-spy2 check
29
+ - run: sudo env "PATH=$PATH" apt-spy2 fix --commit
29
30
  - uses: coverallsapp/github-action@master
30
31
  with:
31
32
  github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -43,5 +44,6 @@ jobs:
43
44
  - run: ls -lah ./pkg/apt-spy2*
44
45
  - run: gem install pkg/apt-spy2*
45
46
  - run: apt-spy2 check --strict
47
+ - run: sudo env "PATH=$PATH" apt-spy2 fix --commit --strict
46
48
 
47
49
 
@@ -10,7 +10,8 @@ jobs:
10
10
  publish:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: actions/checkout@v2
13
+ - uses: actions/checkout@v3
14
+ - run: git config --global --add safe.directory /github/workspace
14
15
  - uses: ruby/setup-ruby@v1
15
16
  with:
16
17
  ruby-version: 3.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- apt-spy2 (0.8.0)
4
+ apt-spy2 (0.8.2)
5
5
  colored (>= 1.2)
6
6
  json
7
7
  nokogiri (~> 1.14.1)
data/README.md CHANGED
@@ -3,20 +3,20 @@
3
3
  … or: "apt-spy for Ubuntu"
4
4
 
5
5
  [![pr](https://github.com/lagged/apt-spy2/actions/workflows/pr.yml/badge.svg)](https://github.com/lagged/apt-spy2/actions/workflows/pr.yml)
6
- [![Gem Version](https://badge.fury.io/rb/apt-spy2.svg)](https://badge.fury.io/rb/apt-spy2)
6
+ ![apt-spy2 (including prereleases)](https://img.shields.io/gem/v/apt-spy2?include_prereleases)
7
7
  [![Code Climate](https://codeclimate.com/github/lagged/apt-spy2.png)](https://codeclimate.com/github/lagged/apt-spy2)
8
8
  [![Coverage Status](https://coveralls.io/repos/lagged/apt-spy2/badge.png)](https://coveralls.io/r/lagged/apt-spy2)
9
9
 
10
10
 
11
11
  ## Installation
12
12
 
13
- ```
13
+ ```sh
14
14
  gem install apt-spy2
15
15
  ```
16
16
 
17
17
  ## Usage
18
18
 
19
- ```
19
+ ```sh
20
20
  $ apt-spy2 [21:03:52]
21
21
  apt-spy2 commands:
22
22
  apt-spy2 check # Evaluate mirrors
@@ -30,14 +30,14 @@ apt-spy2 commands:
30
30
  Displays a list of currently available mirrors. These mirrors are automatically selected via
31
31
  [ubuntu-mirrors](http://mirrors.ubuntu.com) using your IP's location.
32
32
 
33
- ```
33
+ ```sh
34
34
  $ apt-spy2 list
35
35
  ...
36
36
  ```
37
37
 
38
38
  Since `mirrors.ubuntu.com` is frequently down, you can the list on [Launchpad](launchpad.net/ubuntu/+archivemirrors):
39
39
 
40
- ```
40
+ ```sh
41
41
  $ apt-spy2 list --launchpad --country=Germany
42
42
  ...
43
43
  ```
@@ -46,7 +46,7 @@ $ apt-spy2 list --launchpad --country=Germany
46
46
 
47
47
  `check` works like `list`, but also determines if the servers returned are working. It supports the flag `--launchpad` as well and additionally a flag `--strict` which checks if a mirror carries a certain release and distribution.
48
48
 
49
- ```
49
+ ```sh
50
50
  $ apt-spy2 check
51
51
  ...
52
52
  $ apt-spy2 check --launchpad --country=US
@@ -70,10 +70,10 @@ See `apt-spy2 help list|check|fix` for available options.
70
70
 
71
71
  ### exit codes
72
72
 
73
- * 0 - all went well
74
- * 1 - some kind of error
73
+ * 0 - all went well
74
+ * 1 - some kind of error
75
75
 
76
- ### output and non-interactiveness
76
+ ### output and non-interactive behavior
77
77
 
78
78
  See `apt-spy2 help COMMAND` for more information.
79
79
 
@@ -85,6 +85,7 @@ Generally, `apt-spy2` plays especially nice in a non-interactive environment and
85
85
 
86
86
  ### Release (procedure)
87
87
 
88
- - update version in `lib/apt/spy2/version.rb`
89
- - `bundle install`
90
- - `git commit -a -m 'New release' && git tag -a vVERSION && git push --tags`
88
+ * update version in `lib/apt/spy2/version.rb`
89
+ * `bundle install`
90
+ * `git commit -a 'Prep x.y.z'
91
+ * `git tag -a vVERSION && git push --tags`
data/apt-spy2.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # require 'English'
3
+ require 'English'
4
4
  lib = File.expand_path('lib', __dir__)
5
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
6
  require 'apt/spy2/version'
@@ -11,7 +11,10 @@ module Apt
11
11
  def initialize(url)
12
12
  uri = URI(url)
13
13
 
14
+ # sets hopefully sensible timeouts for read and connection
14
15
  http = Net::HTTP.new(uri.host, uri.port)
16
+ http.read_timeout = 10
17
+ http.open_timeout = 10
15
18
  http.use_ssl = true if uri.scheme == 'https'
16
19
 
17
20
  @http = http
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Apt
4
4
  module Spy2
5
- VERSION = '0.8.0'
5
+ VERSION = '0.8.2'
6
6
  end
7
7
  end
data/lib/apt/spy2.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'thor'
4
- require 'open-uri'
5
4
  require 'colored'
6
5
  require 'fileutils'
7
6
  require 'apt/spy2/writer'
@@ -129,10 +128,10 @@ class AptSpy2 < Thor
129
128
  t = Time.now
130
129
  r = `lsb_release -c`.split(' ')[1]
131
130
  sources = "## Updated on #{t} by apt-spy2\n"
132
- sources << "deb #{mirror} #{r} main restricted universe multiverse\n"
133
- sources << "deb #{mirror} #{r}-updates main restricted universe multiverse\n"
134
- sources << "deb #{mirror} #{r}-backports main restricted universe multiverse\n"
135
- sources << "deb #{mirror} #{r}-security main restricted universe multiverse\n"
131
+ sources += "deb #{mirror} #{r} main restricted universe multiverse\n"
132
+ sources += "deb #{mirror} #{r}-updates main restricted universe multiverse\n"
133
+ sources += "deb #{mirror} #{r}-backports main restricted universe multiverse\n"
134
+ sources += "deb #{mirror} #{r}-security main restricted universe multiverse\n"
136
135
 
137
136
  apt_sources = '/etc/apt/sources.list'
138
137
 
@@ -143,7 +142,7 @@ class AptSpy2 < Thor
143
142
  end
144
143
  rescue StandardError
145
144
  msg = "Failed updating #{apt_sources}!"
146
- msg << 'You probably need sudo!'
145
+ msg += 'You probably need sudo!'
147
146
  raise msg
148
147
  end
149
148
 
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.8.0
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - till
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-11 00:00:00.000000000 Z
11
+ date: 2023-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored