trent 0.4.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c24028242dbee5242968caf0debba171505838ed9ea679f67c1a45080bba48d
4
- data.tar.gz: 4e08149c17144b39350bfce96733a7efe0f53d77b66383700bf81a743a7b390d
3
+ metadata.gz: fdf25e770aeae2915d5b48e3985fe1870b42e431202ce6633be269ee8c71d8f1
4
+ data.tar.gz: 07bce951325ff1f42536ece4ec95971232a9475bea43d7ba3c8a36be48a0d115
5
5
  SHA512:
6
- metadata.gz: b7b9184aae962c908747e33a35482d8c7f470c52dd5fd9ea9f249fc0f0d6fca2edf4e863d670fa9e116691f56d94d4dd33a0513671e3bd730ca26c712318798c
7
- data.tar.gz: dab47c51d9b65bc25753d91b2ad6507e893809f50a7e16e4844f9a22c651798a5387425cea9c8139cf9a9268c0933c4ee615dd3f2e28ecee792cbe6322956843
6
+ metadata.gz: 303ffba9c1a02c66041063bb50c23b9d96d2127127f4674fe2505f4ed649213cf7464eb2338169639bf4a4e055c79df9d755a8bf51bcc032a6b5c6644c41725f
7
+ data.tar.gz: e2ab9621d83ae07fbf01dcb2fa07c25a023e457f418a820dea6424ba1d05acabbe3a3a31380093aa2065e43326b8bdfc5c25a33d04bc0a9093522d47690ff654
@@ -1,3 +1,8 @@
1
+ ### [0.5.0] 2019-12-04
2
+
3
+ ### Changed
4
+ - **Breaking change** `config_ssh` now takes in an options hash instead of password as 3rd parameter.
5
+
1
6
  ### [0.4.0] 2019-03-07
2
7
 
3
8
  ### Added
data/README.md CHANGED
@@ -92,19 +92,21 @@ ci.sh("false", :fail_non_success => false)
92
92
  ci.path("docker-compose", "/opt/bin/docker-compose")
93
93
  ```
94
94
 
95
- # Run remote SSH shell commmands
95
+ # Run remote SSH shell commands
96
96
 
97
97
  ```ruby
98
98
  require 'trent'
99
99
 
100
100
  ci = Trent.new()
101
- ci.config_ssh('username', '111.111.234.332')
101
+ ci.config_ssh('username', '111.111.234.332', { :port => 22 })
102
102
 
103
103
  result = ci.ssh("echo 'foo'")
104
104
 
105
105
  puts result
106
106
  ```
107
107
 
108
+ *Note: The 3rd parameter to `config_ssh` is a hash passed to [the options parameter of net/ssh](http://net-ssh.github.io/net-ssh/Net/SSH.html#method-c-start) to allow full customization.*
109
+
108
110
  When you run the script, you will see:
109
111
 
110
112
  ```
@@ -4,15 +4,15 @@ require 'net/ssh'
4
4
 
5
5
  # Run SSH commands remotely on a server.
6
6
  class SSH
7
- def initialize(username, host, password = nil)
7
+ def initialize(username, host, options)
8
8
  @username = username
9
9
  @host = host
10
- @password = password
10
+ @options = options
11
11
  end
12
12
 
13
13
  # Run the SSH command on the server
14
14
  def run(command)
15
- Net::SSH.start(@host, @username, password: @password) do |ssh|
15
+ Net::SSH.start(@host, @username, @options) do |ssh|
16
16
  output = ''
17
17
  exit_code = nil
18
18
  ssh.open_channel do |channel|
@@ -24,8 +24,8 @@ class Trent
24
24
  end
25
25
 
26
26
  # Configure how to run remote SSH commmands on server.
27
- def config_ssh(username, host, password = nil)
28
- @ssh = SSH.new(username, host, password: password)
27
+ def config_ssh(username, host, options = nil)
28
+ @ssh = SSH.new(username, host, options)
29
29
  end
30
30
 
31
31
  # Configure how to communicate with GitHub
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Levi Bostian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-08 00:00:00.000000000 Z
11
+ date: 2019-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -96,20 +96,20 @@ dependencies:
96
96
  requirements:
97
97
  - - "~>"
98
98
  - !ruby/object:Gem::Version
99
- version: '12.3'
99
+ version: '13.0'
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: 12.3.1
102
+ version: 13.0.1
103
103
  type: :development
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '12.3'
109
+ version: '13.0'
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
- version: 12.3.1
112
+ version: 13.0.1
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rspec
115
115
  requirement: !ruby/object:Gem::Requirement