Class: Chef::Provider::RemoteFile::SFTP

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/provider/remote_file/sftp.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, new_resource, current_resource) ⇒ SFTP

Returns a new instance of SFTP.



36
37
38
39
40
41
42
# File 'lib/chef/provider/remote_file/sftp.rb', line 36

def initialize(uri, new_resource, current_resource)
  @uri = uri
  @new_resource = new_resource
  @current_resource = current_resource
  validate_path!
  validate_userinfo!
end

Instance Attribute Details

#current_resourceObject (readonly)

Returns the value of attribute current_resource.



34
35
36
# File 'lib/chef/provider/remote_file/sftp.rb', line 34

def current_resource
  @current_resource
end

#new_resourceObject (readonly)

Returns the value of attribute new_resource.



33
34
35
# File 'lib/chef/provider/remote_file/sftp.rb', line 33

def new_resource
  @new_resource
end

#uriObject (readonly)

Returns the value of attribute uri.



32
33
34
# File 'lib/chef/provider/remote_file/sftp.rb', line 32

def uri
  @uri
end

Instance Method Details

#fetchObject



56
57
58
# File 'lib/chef/provider/remote_file/sftp.rb', line 56

def fetch
  get
end

#hostnameObject



44
45
46
# File 'lib/chef/provider/remote_file/sftp.rb', line 44

def hostname
  @uri.host
end

#portObject



48
49
50
# File 'lib/chef/provider/remote_file/sftp.rb', line 48

def port
  @uri.port
end

#userObject



52
53
54
# File 'lib/chef/provider/remote_file/sftp.rb', line 52

def user
  CGI.unescape(uri.user)
end