lib/vos/drivers/ssh.rb in vos-0.3.13 vs lib/vos/drivers/ssh.rb in vos-0.3.14

- old
+ new

@@ -1,18 +1,18 @@ require 'net/ssh' require 'net/sftp' module Vos module Drivers - class Ssh < Abstract + class Ssh DEFAULT_OPTIONS = { config: true } - def initialize options = {} - super + def initialize options = {}, root = '' raise ":host not provided!" unless options[:host] + @root = root @options = DEFAULT_OPTIONS.merge options # config_options = Net::SSH.configuration_for(options[:host]) # options = DEFAULT_OPTIONS.merge(config_options).merge options # raise ":user not provided (provide explicitly or in .ssh/config)!" unless options[:user] @@ -57,11 +57,10 @@ # # Vfs # include SshVfsStorage - alias_method :open_fs, :open # # Shell # @@ -88,10 +87,10 @@ # def to_s; options[:host] end def host; options[:host] end protected - attr_accessor :ssh, :sftp + attr_accessor :ssh, :sftp, :options def fix_path path path.sub(/^\~/, home) end \ No newline at end of file