Class: Frank::Publish::Base
- Inherits:
-
Object
- Object
- Frank::Publish::Base
- Defined in:
- lib/frank/publish/base.rb
Instance Attribute Summary collapse
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#local_path ⇒ Object
Returns the value of attribute local_path.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#remote_path ⇒ Object
Returns the value of attribute remote_path.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(options) ⇒ Base
constructor
A new instance of Base.
-
#perform! ⇒ Object
Performs the backup transfer.
Constructor Details
#initialize(options) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 17 18 |
# File 'lib/frank/publish/base.rb', line 11 def initialize() @username = .user || .username @password = .password @hostname = .host @remote_path = .path @port = .port @local_path = "/tmp/frank-publish-#{Frank.proj_name}-#{Time.now.to_i}" end |
Instance Attribute Details
#hostname ⇒ Object
Returns the value of attribute hostname.
6 7 8 |
# File 'lib/frank/publish/base.rb', line 6 def hostname @hostname end |
#local_path ⇒ Object
Returns the value of attribute local_path.
8 9 10 |
# File 'lib/frank/publish/base.rb', line 8 def local_path @local_path end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/frank/publish/base.rb', line 5 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
6 7 8 |
# File 'lib/frank/publish/base.rb', line 6 def port @port end |
#remote_path ⇒ Object
Returns the value of attribute remote_path.
7 8 9 |
# File 'lib/frank/publish/base.rb', line 7 def remote_path @remote_path end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/frank/publish/base.rb', line 5 def username @username end |
Instance Method Details
#perform! ⇒ Object
Performs the backup transfer
22 23 24 25 26 27 28 29 30 |
# File 'lib/frank/publish/base.rb', line 22 def perform! export! begin transfer! rescue SocketError "Transfer failed. SocketError. Do you have internet?" end cleanup! end |