train-core 3.3.13 → 3.3.16

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: 49d500e3ff1e260a0879ff7da716c7407934e53deef0f15df171c03cd26c9dff
4
- data.tar.gz: 54d6e4b4907efcccc7c99cae92c6e81b7d34c172d8601faa8b9a725a2edb9590
3
+ metadata.gz: 731da693988617c1fba632079b251048ff772e266341a405f9d7fa668081c460
4
+ data.tar.gz: e2f44528bdaeab154923632381ea82ab7393b58800c92ed2ce34665b5c87922e
5
5
  SHA512:
6
- metadata.gz: 846c9daf8a830259f3919a44fe6e12f5e5911a01c63d6a3362ec7dc05bd644e332189c94e878435ca622c697d2cfd33e903f599e41cfd5b42fb6c346d81705f3
7
- data.tar.gz: 105276a39b26b161a41cefc2b9f1ebaa989055d08d08d246927dfe1f2843c66cdaa5f4520b1ded0478d88b8d13e3b381daa9f4674fd4e1fcf8ffe1e96cbf08dc
6
+ metadata.gz: 4faaad47791222859169e2e7eaca6e641b1b0645b206966200ab303da77565a54fc052640583317f6505f74816fe141284d0f06eff45c5d7c638e6580aa6d26f
7
+ data.tar.gz: 87fe382ff4951bad855289e72e4687d69a71c70733d7240edbde19d773e6b5caee446a17b3aef2c621f33e403badb8ee68aaaa8583fca17f0c08f86fdaea0d7e
@@ -6,7 +6,7 @@ require_relative "train/options"
6
6
  require_relative "train/plugins"
7
7
  require_relative "train/errors"
8
8
  require_relative "train/platforms"
9
- require "addressable/uri"
9
+ require "addressable/uri" unless defined?(Addressable::URI)
10
10
 
11
11
  module Train
12
12
  # Create a new transport instance, with the plugin indicated by the
@@ -1,4 +1,4 @@
1
- require "shellwords"
1
+ require "shellwords" unless defined?(Shellwords)
2
2
  require_relative "../../extras/stat"
3
3
 
4
4
  module Train
@@ -1,4 +1,4 @@
1
- require "shellwords"
1
+ require "shellwords" unless defined?(Shellwords)
2
2
 
3
3
  module Train
4
4
  class File
@@ -1,6 +1,6 @@
1
1
  require_relative "os_linux"
2
2
  require_relative "os_windows"
3
- require "rbconfig"
3
+ require "rbconfig" unless defined?(RbConfig)
4
4
 
5
5
  module Train::Platforms::Detect::Helpers
6
6
  module OSCommon
@@ -37,8 +37,8 @@ module Train::Platforms::Detect::Helpers
37
37
  res = @backend.run_command(cmd)
38
38
  stdout = res.stdout
39
39
  stderr = res.stderr
40
- # When you try to execute command using ssh connction as root user and you have provided ssh user identity file
41
- # it gives standard output to login as authorised user other than root. To show this standard ouput as an error
40
+ # When you try to execute command using ssh connection as root user and you have provided ssh user identity file
41
+ # it gives standard output to login as authorized user other than root. To show this standard output as an error
42
42
  # to user we are matching the string of stdout and raising the error here so that user gets exact information.
43
43
  if @backend.class.to_s == "Train::Transports::SSH::Connection"
44
44
  if stdout =~ /Please login as the user/
@@ -165,7 +165,7 @@ module Train::Platforms::Detect::Helpers
165
165
  def json_cmd(cmd)
166
166
  cmd = @backend.run_command(cmd)
167
167
  if cmd.exit_status == 0 && !cmd.stdout.empty?
168
- require "json"
168
+ require "json" unless defined?(JSON)
169
169
  eos_ver = JSON.parse(cmd.stdout)
170
170
  @platform[:release] = eos_ver["version"]
171
171
  @platform[:arch] = eos_ver["architecture"]
@@ -128,7 +128,7 @@ module Train::Platforms::Detect::Specifications
128
128
 
129
129
  declare_lsb("scientific", "Scientific Linux", "redhat", /scientific/i)
130
130
 
131
- declare_lsb("xenserver", "Xenserer Linux", "redhat", /xenserver/i)
131
+ declare_lsb("xenserver", "Xenserver Linux", "redhat", /xenserver/i)
132
132
 
133
133
  declare_instance("parallels-release", "Parallels Linux", "redhat") do
134
134
  if (raw = unix_file_contents("/etc/parallels-release"))
@@ -1,6 +1,6 @@
1
1
  require "digest/sha1"
2
- require "securerandom"
3
- require "json"
2
+ require "securerandom" unless defined?(SecureRandom)
3
+ require "json" unless defined?(JSON)
4
4
 
5
5
  module Train::Platforms::Detect
6
6
  class UUID
@@ -45,7 +45,7 @@ module Train::Platforms
45
45
  @uuid ||= Train::Platforms::Detect::UUID.new(self).find_or_create_uuid.downcase
46
46
  end
47
47
 
48
- # This is for backwords compatability with
48
+ # This is for backwards compatibility with
49
49
  # the current inspec os resource.
50
50
  def[](name)
51
51
  if respond_to?(name)
@@ -13,13 +13,13 @@ require "minitest/spec"
13
13
  require "minitest/autorun"
14
14
 
15
15
  # Data formats commonly used in testing
16
- require "json"
17
- require "ostruct"
16
+ require "json" unless defined?(JSON)
17
+ require "ostruct" unless defined?(OpenStruct)
18
18
 
19
19
  # Utilities often needed
20
- require "fileutils"
21
- require "tmpdir"
22
- require "pathname"
20
+ require "fileutils" unless defined?(FileUtils)
21
+ require "tmpdir" unless defined?(Dir.mktmpdir)
22
+ require "pathname" unless defined?(Pathname)
23
23
 
24
24
  # You might want to put some debugging tools here. We run tests to find bugs,
25
25
  # after all.
@@ -23,7 +23,7 @@ module Train
23
23
  # Create a versioned plugin by providing the transport layer plugin version
24
24
  # to this method. It will then select the correct class to inherit from.
25
25
  #
26
- # The plugin version determins what methods will be available to your plugin.
26
+ # The plugin version determines what methods will be available to your plugin.
27
27
  #
28
28
  # @param [Int] version = 1 the plugin version to use
29
29
  # @return [Transport] the versioned transport base class
@@ -158,7 +158,7 @@ class Train::Plugins::Transport
158
158
  # service is preferred to simply waiting on a socket to become
159
159
  # available.
160
160
  def wait_until_ready
161
- # this method may be left unimplemented if that is applicablelog
161
+ # this method may be left unimplemented if that is applicable log
162
162
  end
163
163
 
164
164
  private
@@ -4,7 +4,7 @@
4
4
 
5
5
  require_relative "../plugins"
6
6
  require_relative "../errors"
7
- require "mixlib/shellout"
7
+ require "mixlib/shellout" unless defined?(Mixlib::ShellOut)
8
8
 
9
9
  module Train::Transports
10
10
  class Local < Train.plugin(1)
@@ -111,7 +111,7 @@ module Train::Transports
111
111
  end
112
112
 
113
113
  class WindowsShellRunner
114
- require "json"
114
+ require "json" unless defined?(JSON)
115
115
  require "base64"
116
116
 
117
117
  def initialize(powershell_cmd = "powershell")
@@ -135,9 +135,9 @@ module Train::Transports
135
135
  end
136
136
 
137
137
  class WindowsPipeRunner
138
- require "json"
138
+ require "json" unless defined?(JSON)
139
139
  require "base64"
140
- require "securerandom"
140
+ require "securerandom" unless defined?(SecureRandom)
141
141
 
142
142
  def initialize(powershell_cmd = "powershell")
143
143
  @powershell_cmd = powershell_cmd
@@ -146,7 +146,7 @@ module Train::Transports
146
146
  end
147
147
 
148
148
  # @param cmd The command to execute
149
- # @return Local::ComandResult with stdout, stderr and exitstatus
149
+ # @return Local::CommandResult with stdout, stderr and exitstatus
150
150
  # Note that exitstatus ($?) in PowerShell is boolean, but we use a numeric exit code.
151
151
  # A command that succeeds without setting an exit code will have exitstatus 0
152
152
  # A command that exits with an exit code will have that value as exitstatus
@@ -17,7 +17,7 @@
17
17
  # See the License for the specific language governing permissions and
18
18
  # limitations under the License.
19
19
 
20
- require "net/ssh"
20
+ require "net/ssh" unless defined?(Net::SSH)
21
21
  require "net/scp"
22
22
  require_relative "../errors"
23
23
 
@@ -237,7 +237,7 @@ module Train::Transports
237
237
  # Creates a new SSH Connection instance and save it for potential future
238
238
  # reuse.
239
239
  #
240
- # @param options [Hash] conneciton options
240
+ # @param options [Hash] connection options
241
241
  # @return [Ssh::Connection] an SSH Connection instance
242
242
  # @api private
243
243
  def create_new_connection(options, &block)
@@ -17,9 +17,9 @@
17
17
  # See the License for the specific language governing permissions and
18
18
  # limitations under the License.
19
19
 
20
- require "net/ssh"
20
+ require "net/ssh" unless defined?(Net::SSH)
21
21
  require "net/scp"
22
- require "timeout"
22
+ require "timeout" unless defined?(Timeout)
23
23
 
24
24
  class Train::Transports::SSH
25
25
  # A Connection instance can be generated and re-generated, given new
@@ -2,5 +2,5 @@
2
2
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
3
3
 
4
4
  module Train
5
- VERSION = "3.3.13".freeze
5
+ VERSION = "3.3.16".freeze
6
6
  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.3.13
4
+ version: 3.3.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef InSpec Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-20 00:00:00.000000000 Z
11
+ date: 2020-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable