Sha256: 2444979bb573608e4252e378b7917945ea48192561ba178974b26858b8a267fd
Contents?: true
Size: 950 Bytes
Versions: 1
Compression:
Stored size: 950 Bytes
Contents
require 'escape' module Wordmove class LocalHost attr_reader :options attr_reader :logger attr_reader :ssh_extras def initialize(options = {}) @options = Hashie::Mash.new(options) @logger = @options[:logger] @ssh_extras = {} [ :port, :password ].each do |p| @ssh_extras.merge!( { p => options.ssh[p] } ) if @options.ssh[p] end end def run(*args) command = shell_command(*args) logger.verbose "Executing locally #{command}" unless system(command) raise Thor::Error, "Error executing \"#{command}\"" end end def close end protected def shell_command(*args) options = args.extract_options! command = Escape.shell_command(args) if options[:stdin] command += " < #{options[:stdin]}" end if options[:stdout] command += " > #{options[:stdout]}" end command end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
wordmove-sshbump-0.0.6 | lib/wordmove/hosts/local_host.rb |