Class: WpBackup::Config
- Inherits:
-
Object
- Object
- WpBackup::Config
- Defined in:
- lib/wp_backup/config.rb
Class Method Summary collapse
Instance Method Summary collapse
- #database ⇒ Object
-
#initialize(file) ⇒ Config
constructor
A new instance of Config.
- #s3 ⇒ Object
- #site ⇒ Object
Constructor Details
#initialize(file) ⇒ Config
Returns a new instance of Config.
6 7 8 9 |
# File 'lib/wp_backup/config.rb', line 6 def initialize(file) @config = YAML.load_file(file) @bucket_name = @config['aws'].delete('bucket') end |
Class Method Details
.write_sample(file) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/wp_backup/config.rb', line 27 def self.write_sample(file) File.open(file, 'w') do |file| file.puts(<<-EOF database: name: user: password: wordpress: home: # this allows you to specify which directories to backup. if it's not # included or the list is empty the entire directory is backed up. backup_paths: - aws: access_key_id: secret_access_key: bucket: EOF ) end end |
Instance Method Details
#database ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/wp_backup/config.rb', line 15 def database Database.new( database_config['name'], database_config['user'], database_config['password'] ) end |