sshkit 1.21.3 → 1.21.5

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: aefa716eaeb8369c4f3ab62fce395c84f43d2c8970acaa3d9322c8ab763977c7
4
- data.tar.gz: c271da1544ea98cc4df40c00893832f103c165b90c91362a0ae605c3abc3f8be
3
+ metadata.gz: 45797b636d02d174676019185c1199342f1ca21f8b72c09acd1cbebf44bb9263
4
+ data.tar.gz: fc271769aefc5c107ff1c406a54d3d085d062d8a24dbd0946b9763170f338d19
5
5
  SHA512:
6
- metadata.gz: 96e66f27d9bd8d3b27708fc219cf965ce8f56a312341fd4e67595649e335686699cf4299947cc34c72bc0e41a0b87f60e954e94910609c1f4f57e921b72f952b
7
- data.tar.gz: ee176de7ee2325c91b2b713cee0268e2ad954f3ed07c1412e4b8c81e393dd2f9d4f24394c3aa0d817c6cfb6e8bc605a43546ce85ee24875126a84fc17195416b
6
+ metadata.gz: 30396905e750c8f3a82466eb90486eb0287bd716db6762fa9cdb67953369f42decbb44c19915983253286d57cc8a7ba061c05c5cc06f623fcdc884473af7fc1d
7
+ data.tar.gz: 6d15cb5f1d640fec3767d7a1130fe2ce5c723364b9e1678b94baeb55994bb2978de03e1790aca017f894efbd4b8f29d5b02556967cbbebcea43e31ea360d599f
@@ -0,0 +1,113 @@
1
+ name: test on CI
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ pull_request:
6
+ jobs:
7
+ test:
8
+ runs-on: ubuntu-latest
9
+ strategy:
10
+ matrix:
11
+ ruby: ["2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "head"]
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ - name: Set up Ruby
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: ${{ matrix.ruby }}
18
+ bundler-cache: true
19
+ - name: Run tests
20
+ run: bundle exec rake test:units
21
+
22
+ test-legacy:
23
+ runs-on: ubuntu-20.04
24
+ strategy:
25
+ matrix:
26
+ ruby: ["2.0", "2.1", "2.2"]
27
+ steps:
28
+ - uses: actions/checkout@v3
29
+ - name: Set up Ruby
30
+ uses: ruby/setup-ruby@v1
31
+ with:
32
+ ruby-version: ${{ matrix.ruby }}
33
+ bundler-cache: true
34
+ - name: Run tests
35
+ run: bundle exec rake test:units
36
+
37
+ test-all:
38
+ runs-on: ubuntu-latest
39
+ needs: [test, test-legacy]
40
+ if: always()
41
+ steps:
42
+ - name: All tests ok
43
+ if: ${{ !(contains(needs.*.result, 'failure')) }}
44
+ run: exit 0
45
+ - name: Some tests failed
46
+ if: ${{ contains(needs.*.result, 'failure') }}
47
+ run: exit 1
48
+
49
+ rubocop:
50
+ runs-on: ubuntu-latest
51
+ steps:
52
+ - uses: actions/checkout@v3
53
+ - name: Set up Ruby
54
+ uses: ruby/setup-ruby@v1
55
+ with:
56
+ ruby-version: "2.7"
57
+ bundler-cache: true
58
+ - name: Run rubocop
59
+ run: bundle exec rake lint
60
+
61
+ functional:
62
+ runs-on: macos-12
63
+ strategy:
64
+ matrix:
65
+ ruby:
66
+ [
67
+ "2.0",
68
+ "2.1",
69
+ "2.2",
70
+ "2.3",
71
+ "2.4",
72
+ "2.5",
73
+ "2.6",
74
+ "2.7",
75
+ "3.0",
76
+ "3.1",
77
+ "3.2",
78
+ "head",
79
+ ]
80
+ steps:
81
+ - uses: actions/checkout@v3
82
+
83
+ - name: Cache Vagrant boxes
84
+ uses: actions/cache@v3
85
+ with:
86
+ path: ~/.vagrant.d/boxes
87
+ key: ${{ runner.os }}-vagrant-v2-${{ hashFiles('Vagrantfile') }}
88
+ restore-keys: |
89
+ ${{ runner.os }}-vagrant-v2-
90
+
91
+ - name: Run vagrant up
92
+ run: vagrant up
93
+
94
+ - name: Set up Ruby
95
+ uses: ruby/setup-ruby@v1
96
+ with:
97
+ ruby-version: ${{ matrix.ruby }}
98
+ bundler-cache: true
99
+
100
+ - name: Run functional tests
101
+ run: bundle exec rake test:functional
102
+
103
+ functional-all:
104
+ runs-on: ubuntu-latest
105
+ needs: [functional]
106
+ if: always()
107
+ steps:
108
+ - name: All tests ok
109
+ if: ${{ !(contains(needs.*.result, 'failure')) }}
110
+ run: exit 0
111
+ - name: Some tests failed
112
+ if: ${{ contains(needs.*.result, 'failure') }}
113
+ run: exit 1
@@ -7,6 +7,6 @@ jobs:
7
7
  steps:
8
8
  - uses: actions/checkout@master
9
9
  - name: Draft Release
10
- uses: toolmantim/release-drafter@v5.20.1
10
+ uses: toolmantim/release-drafter@v5.24.0
11
11
  env:
12
12
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  more servers.
5
5
 
6
6
  [![Gem Version](https://badge.fury.io/rb/sshkit.svg)](https://rubygems.org/gems/sshkit)
7
- [![Build Status](https://travis-ci.org/capistrano/sshkit.svg?branch=master)](https://travis-ci.org/capistrano/sshkit)
7
+ [![Build Status](https://github.com/capistrano/sshkit/actions/workflows/ci.yml/badge.svg)](https://github.com/capistrano/sshkit/actions/workflows/ci.yml)
8
8
 
9
9
  ## Example
10
10
 
data/Vagrantfile CHANGED
@@ -1,10 +1,14 @@
1
1
  VAGRANTFILE_API_VERSION = "2"
2
2
 
3
3
  Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
4
- config.vm.box = 'hashicorp/precise64'
4
+ config.vm.box = 'bento/ubuntu-22.10'
5
+
6
+ config.vm.boot_timeout = 600 # seconds
7
+ config.ssh.insert_key = false
5
8
  config.vm.provision "shell", inline: <<-SHELL
6
- echo 'ClientAliveInterval 1' >> /etc/ssh/sshd_config
7
- echo 'ClientAliveCountMax 1' >> /etc/ssh/sshd_config
9
+ echo 'ClientAliveInterval 3' >> /etc/ssh/sshd_config
10
+ echo 'ClientAliveCountMax 3' >> /etc/ssh/sshd_config
11
+ echo 'MaxAuthTries 6' >> /etc/ssh/sshd_config
8
12
  service ssh restart
9
13
  SHELL
10
14
 
@@ -1,3 +1,5 @@
1
+ require 'set'
2
+
1
3
  module SSHKit
2
4
  class DeprecationLogger
3
5
  def initialize(out)
@@ -1,3 +1,3 @@
1
1
  module SSHKit
2
- VERSION = "1.21.3".freeze
2
+ VERSION = "1.21.5".freeze
3
3
  end
@@ -75,14 +75,14 @@ module SSHKit
75
75
 
76
76
  def test_group_netssh
77
77
  Netssh.new(a_host) do
78
- as user: :root, group: :admin do
78
+ as user: :root, group: :root do
79
79
  execute :touch, 'restart.txt'
80
80
  end
81
81
  end.run
82
82
  command_lines = @output.lines.select { |line| line.start_with?('Command:') }
83
83
  assert_equal [
84
84
  "Command: if ! sudo -u root whoami > /dev/null; then echo \"You cannot switch to user 'root' using sudo, please check the sudoers file\" 1>&2; false; fi\n",
85
- "Command: sudo -u root -- sh -c sg\\ admin\\ -c\\ /usr/bin/env\\\\\\ touch\\\\\\ restart.txt\n"
85
+ "Command: sudo -u root -- sh -c sg\\ root\\ -c\\ /usr/bin/env\\\\\\ touch\\\\\\ restart.txt\n"
86
86
  ], command_lines
87
87
  end
88
88
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sshkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.21.3
4
+ version: 1.21.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Hambley
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-09-05 00:00:00.000000000 Z
12
+ date: 2023-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ssh
@@ -182,11 +182,11 @@ extra_rdoc_files: []
182
182
  files:
183
183
  - ".github/dependabot.yml"
184
184
  - ".github/release-drafter.yml"
185
+ - ".github/workflows/ci.yml"
185
186
  - ".github/workflows/push.yml"
186
187
  - ".gitignore"
187
188
  - ".rubocop.yml"
188
189
  - ".rubocop_todo.yml"
189
- - ".travis.yml"
190
190
  - ".yardopts"
191
191
  - BREAKING_API_WISHLIST.md
192
192
  - CHANGELOG.md
@@ -291,7 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
291
291
  - !ruby/object:Gem::Version
292
292
  version: '0'
293
293
  requirements: []
294
- rubygems_version: 3.3.21
294
+ rubygems_version: 3.4.13
295
295
  signing_key:
296
296
  specification_version: 4
297
297
  summary: SSHKit makes it easy to write structured, testable SSH commands in Ruby
data/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 3.0
4
- - 2.7
5
- - 2.6
6
- - 2.5
7
- - 2.4
8
- - 2.3
9
- - 2.2
10
- - 2.1
11
- - 2.0
12
- branches:
13
- only:
14
- - master
15
- matrix:
16
- include:
17
- # Run Danger only once, on 2.5
18
- - rvm: 2.5
19
- script: bundle exec danger
20
- script: bundle exec rake test:units lint