Class: RemoteDirectory
- Inherits:
-
Source
show all
- Defined in:
- lib/blanket/plugins/sources/remote_directory.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Utils
included, #method_missing, #noop
Constructor Details
Returns a new instance of RemoteDirectory.
3
4
5
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 3
def initialize(reader)
@reader = reader
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Utils
Class Method Details
.attribute_symbols ⇒ Object
7
8
9
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 7
def self.attribute_symbols
[:source_type, :host, :user, :password, :remote_directory, :local_path ]
end
|
.default_host ⇒ Object
15
16
17
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 15
def self.default_host
"yourhost.com"
end
|
.default_local_path ⇒ Object
31
32
33
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 31
def self.default_local_path
"/path/to/local/blanket"
end
|
.default_password ⇒ Object
23
24
25
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 23
def self.default_password
"password"
end
|
.default_remote_directory ⇒ Object
27
28
29
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 27
def self.default_remote_directory
"/path/to/remote/target/directory"
end
|
.default_source_type ⇒ Object
11
12
13
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 11
def self.default_source_type
"Confluence"
end
|
.default_user ⇒ Object
19
20
21
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 19
def self.default_user
"username"
end
|
Instance Method Details
#cleanup_command ⇒ Object
61
62
63
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 61
def cleanup_command
noop
end
|
#full_tarfile ⇒ Object
53
54
55
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 53
def full_tarfile
[tar_directory, tarfile].join("/")
end
|
#local_backup_path ⇒ Object
39
40
41
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 39
def local_backup_path
local_path
end
|
#prep_command ⇒ Object
57
58
59
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 57
def prep_command
"tar cvf #{full_tarfile} #{remote_directory}; gzip -f #{full_tarfile}"
end
|
#remote_backup_path ⇒ Object
35
36
37
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 35
def remote_backup_path
full_tarfile+".gz"
end
|
#tar_directory ⇒ Object
43
44
45
46
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 43
def tar_directory
rp = Pathname.new(remote_directory)
rp.dirname.to_s
end
|
#tarfile ⇒ Object
48
49
50
51
|
# File 'lib/blanket/plugins/sources/remote_directory.rb', line 48
def tarfile
rp = Pathname.new(remote_directory)
rp.basename.to_s+".tar"
end
|