train 3.0.3 → 3.1.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: cd36160ed5b3b0fa8b2438edc6f7747dfa5f7ed159b8ddcb93bf998e064606fa
4
- data.tar.gz: c676d7fe7703fd39e557e003cc995a02a52d223c1dea1e7cf94db77ca0e90356
3
+ metadata.gz: 822b69fa9ee45bff40a62fcce80d792e4605d86d7f55511c289b0bfff86f1d11
4
+ data.tar.gz: 2052e5189271479302b9079fafb1ed2b612fe02d876a5e35dd468f407ad62270
5
5
  SHA512:
6
- metadata.gz: 23ec80fdd4e13921f06cc2b288a55f951eb977c8127db09f364f3c5eeebfcb1f0f4df31fe1123c50b17f7d67c2d6c6df6c5795116edbcb8fd043b2230e6d71c2
7
- data.tar.gz: 278d82b9b2203c0af3672ebd391a948f7e87fb3c36821d297a29602bef96368ecae994e2145688d8ce7e0a6d9bb24cb474e1392c7b888ac402cca925a0ffccbc
6
+ metadata.gz: 52685bfaa63eb3db6db5c36477c2fad2b272264064f30a6da0c5e59ae419d328a392eaa96bc42a1e2c573cfa86e88ba4a0661d97bb39af21c3fdfd8494cb36c6
7
+ data.tar.gz: b30555ac34ee0fcb74ea05e77db4a78a8570424f8d5843911be532f8cd656bb52813b3e11ba5eed404e2d040a817ba2875cb0a78f919d1513ad733e7ab603863
@@ -37,11 +37,11 @@ module Train::Platforms::Detect::Helpers
37
37
 
38
38
  raw.lines.each_with_object({}) do |line, memo|
39
39
  line.strip!
40
+ next if line.nil? || line.empty?
40
41
  next if line.start_with?("#")
41
- next if line.empty?
42
42
 
43
43
  key, value = line.split("=", 2)
44
- memo[key] = value.gsub(/\A"|"\Z/, "") unless value.empty?
44
+ memo[key] = value.gsub(/\A"|"\Z/, "") unless value.nil? || value.empty?
45
45
  end
46
46
  end
47
47
 
@@ -33,7 +33,7 @@ module Train::Transports
33
33
  }
34
34
 
35
35
  # rubocop:disable Metrics/ParameterLists
36
- # rubocop:disable Lint/Eval
36
+ # rubocop:disable Security/Eval
37
37
  set_trace_func(proc { |event, _file, _line, id, binding, classname|
38
38
  unless classname.to_s.start_with?("Train::Transports::Mock") &&
39
39
  (event == "call") &&
@@ -103,8 +103,10 @@ module Train::Transports
103
103
 
104
104
  if options[:auth_methods] == ["none"]
105
105
  if ssh_known_identities.empty?
106
- raise Train::ClientError,
107
- "Your SSH Agent has no keys added, and you have not specified a password or a key file"
106
+ raise Train::ClientError.new(
107
+ "Your SSH Agent has no keys added, and you have not specified a password or a key file",
108
+ :no_ssh_password_or_key_available
109
+ )
108
110
  else
109
111
  logger.debug("[SSH] Using Agent keys as no password or key file have been specified")
110
112
  options[:auth_methods].push("publickey")
@@ -149,6 +149,11 @@ class Train::Transports::SSH
149
149
  "ssh://#{@username}@#{@hostname}:#{@port}"
150
150
  end
151
151
 
152
+ # remote_port_forwarding
153
+ def forward_remote(port, host, remote_port, remote_host = "127.0.0.1")
154
+ @session.forward.remote(port, host, remote_port, remote_host)
155
+ end
156
+
152
157
  private
153
158
 
154
159
  PING_COMMAND = "echo '[SSH] Established'".freeze
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = "3.0.3".freeze
6
+ VERSION = "3.1.3".freeze
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-28 00:00:00.000000000 Z
11
+ date: 2019-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json