Class: Chef::Provider::RemoteFile::SFTP
- Inherits:
-
Object
- Object
- Chef::Provider::RemoteFile::SFTP
- Defined in:
- lib/chef/provider/remote_file/sftp.rb
Instance Attribute Summary collapse
-
#current_resource ⇒ Object
readonly
Returns the value of attribute current_resource.
-
#new_resource ⇒ Object
readonly
Returns the value of attribute new_resource.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #fetch ⇒ Object
- #hostname ⇒ Object
-
#initialize(uri, new_resource, current_resource) ⇒ SFTP
constructor
A new instance of SFTP.
- #port ⇒ Object
- #user ⇒ Object
Constructor Details
#initialize(uri, new_resource, current_resource) ⇒ SFTP
Returns a new instance of SFTP.
34 35 36 37 38 39 40 |
# File 'lib/chef/provider/remote_file/sftp.rb', line 34 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_resource ⇒ Object (readonly)
Returns the value of attribute current_resource
32 33 34 |
# File 'lib/chef/provider/remote_file/sftp.rb', line 32 def current_resource @current_resource end |
#new_resource ⇒ Object (readonly)
Returns the value of attribute new_resource
31 32 33 |
# File 'lib/chef/provider/remote_file/sftp.rb', line 31 def new_resource @new_resource end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri
30 31 32 |
# File 'lib/chef/provider/remote_file/sftp.rb', line 30 def uri @uri end |
Instance Method Details
#fetch ⇒ Object
54 55 56 |
# File 'lib/chef/provider/remote_file/sftp.rb', line 54 def fetch get end |
#hostname ⇒ Object
42 43 44 |
# File 'lib/chef/provider/remote_file/sftp.rb', line 42 def hostname @uri.host end |
#port ⇒ Object
46 47 48 |
# File 'lib/chef/provider/remote_file/sftp.rb', line 46 def port @uri.port end |
#user ⇒ Object
50 51 52 |
# File 'lib/chef/provider/remote_file/sftp.rb', line 50 def user CGI.unescape(uri.user) end |