Class: RubyClone::ToFolder
- Inherits:
-
Object
- Object
- RubyClone::ToFolder
- Defined in:
- lib/ruby_clone/profile.rb
Instance Attribute Summary collapse
-
#backup ⇒ Object
Returns the value of attribute backup.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #delete_files ⇒ Object
-
#initialize(path, options = {}) ⇒ ToFolder
constructor
A new instance of ToFolder.
- #ssh? ⇒ Boolean
- #to_command ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(path, options = {}) ⇒ ToFolder
Returns a new instance of ToFolder.
46 47 48 49 |
# File 'lib/ruby_clone/profile.rb', line 46 def initialize(path, = {}) @path = path = end |
Instance Attribute Details
#backup ⇒ Object
Returns the value of attribute backup.
43 44 45 |
# File 'lib/ruby_clone/profile.rb', line 43 def backup @backup end |
#path ⇒ Object
Returns the value of attribute path.
44 45 46 |
# File 'lib/ruby_clone/profile.rb', line 44 def path @path end |
Instance Method Details
#delete_files ⇒ Object
51 52 53 |
# File 'lib/ruby_clone/profile.rb', line 51 def delete_files @backup.delete_files if @backup end |
#ssh? ⇒ Boolean
64 65 66 67 68 69 70 |
# File 'lib/ruby_clone/profile.rb', line 64 def ssh? if [:ssh] true else false end end |
#to_command ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'lib/ruby_clone/profile.rb', line 55 def to_command command = "" command << "--delete " if [:delete] command << "--delete-excluded " if [:delete_excluded] command << backup.to_command if backup command.strip end |
#to_s ⇒ Object
72 73 74 75 |
# File 'lib/ruby_clone/profile.rb', line 72 def to_s return "#{@options[:ssh]}:#{@path}" if [:ssh] return @path if not [:ssh] end |