Class: RubyClone::Backup
- Inherits:
-
Object
- Object
- RubyClone::Backup
- Defined in:
- lib/ruby_clone/profile.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #delete_files ⇒ Object
-
#initialize(path, options = { }) ⇒ Backup
constructor
A new instance of Backup.
- #to_command ⇒ Object
Constructor Details
#initialize(path, options = { }) ⇒ Backup
Returns a new instance of Backup.
95 96 97 98 99 100 |
# File 'lib/ruby_clone/profile.rb', line 95 def initialize(path, = { }) @default_suffix = '_rbcl' = { disable_suffix: false, limit: 5 }.merge() @path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
93 94 95 |
# File 'lib/ruby_clone/profile.rb', line 93 def path @path end |
Instance Method Details
#delete_files ⇒ Object
102 103 104 |
# File 'lib/ruby_clone/profile.rb', line 102 def delete_files BackupUtils.delete_files @path, @default_suffix, [:limit] if [:limit] != :unlimited end |
#to_command ⇒ Object
106 107 108 109 110 111 |
# File 'lib/ruby_clone/profile.rb', line 106 def to_command command = "-b " command << "#{create_suffix} " if not [:disable_suffix] command << "--backup-dir=#{path} " command.strip end |