train-core 3.0.3 → 3.1.3

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: ff278846198210c45fe05daa6eaff50e05f71057bdae9e37c787bac254baa44c
4
- data.tar.gz: 52fb5e70145c39ae35d6d6cfea4771a49b8fe4a6cdcdea1c0d3e7e2876e09d1d
3
+ metadata.gz: 498cde88401e4600e70ca7a11c60e22000252b8e6e453849e050f005bd5fa0eb
4
+ data.tar.gz: fb23a404a78eb64b4918ab4e5726d0f9cff1270cc750b9f5b77e6d9b67ec0ecd
5
5
  SHA512:
6
- metadata.gz: 3a76bbe2ff1923a243bfef8b788519e75533bc6697a9cc2b4a52dcec26accd6d6d7d184b3fcbc03b0210404775065972c30e4acd43b7c07e4d0807ffc6264a8a
7
- data.tar.gz: eeadedc9f8afbddbe64a4e4f69821dbe976dde40c18bc7248ec34887cadab2911c4ad4c615effac0d5fc91f1d1fe81d0372b82135640e41c5bc132f3583123a5
6
+ metadata.gz: be868622834db36c1c07c3c8221a13b7cc112c94c176db9fdd923160945bb28b0436d9405c8f9dd58175dbbc234278eab847cd55f866eaa56adf13c416868e25
7
+ data.tar.gz: a166c00d0eda33cc8942ed19cb2926433997c9f2975322e701c6a01ea52c9f614684e7d53df0489b8fbbf53e35375bf05cdc85eb7af5c2ee800cb12c531aacb3
@@ -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-core
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