Multiple changes to help support Windows native ssh with sshscript workers.
Defaults are to assume a non-hostile posix environment.
- Don't hardcode the tempdir separator character.
- Allow overrides in the payload of any exposed net-ssh options.
- Allow setting of the "delete" command for script cleanup (ie, 'del')
- Allow running the script via a specific interpreter.
An example payload to make this work with Windows native ssh/powershell
to execute a ruby script:
payload = {
'compression' => false,
'delete_cmd' => 'del',
'run_binary' => 'ruby',
'tempdir' => ''
}
#!/usr/bin/ruby
# coding: utf-8
# vim: set nosta noet ts=4 sw=4:
require 'pathname'
BASEDIR = Pathname( __FILE__ ).dirname.parent
LIBDIR = BASEDIR + 'lib'
$LOAD_PATH.unshift( LIBDIR.to_s )
# SimpleCov test coverage reporting; enable this using the :coverage rake task
require 'simplecov' if ENV['COVERAGE']
require 'loggability'
require 'loggability/spechelpers'
require 'configurability'
require 'configurability/behavior'
require 'rspec'
require 'symphony'
Loggability.format_with( :color ) if $stdout.tty?
### RSpec helper functions.
module Loggability::SpecHelpers
end
### Mock with RSpec
RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
# config.order = 'random'
config.expect_with( :rspec )
config.mock_with( :rspec ) do |mock|
mock.syntax = :expect
end
config.include( Loggability::SpecHelpers )
end