Sha256: 59e003efe6d2bc7f40c1aec9592043143a89e0646091b19b7d5a8fd236ae4d83
Contents?: true
Size: 989 Bytes
Versions: 2
Compression:
Stored size: 989 Bytes
Contents
namespace :backup do task :s3_config => :environment do @config = YAML.load_file(File.join(RAILS_ROOT, 'config', 'backup', 's3.yml')) @config.each do |key, value| value.each do |k, v| if @config[key][k].is_a?(String) @config[key][k] = @config[key][k][v].gsub(/:rails_root/, RAILS_ROOT) end if @config[key][k].is_a?(Array) @config[key][k].map! {|string| string.gsub(/:rails_root/, RAILS_ROOT)} end end end end task :ssh_config => :environment do @config = YAML.load_file(File.join(RAILS_ROOT, 'config', 'backup', 'ssh.yml')) @config.each do |key, value| value.each do |k, v| if @config[key][k].is_a?(String) @config[key][k] = @config[key][k][v].gsub(/:rails_root/, RAILS_ROOT) end if @config[key][k].is_a?(Array) @config[key][k].map! {|string| string.gsub(/:rails_root/, RAILS_ROOT)} end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
backup-1.1.0 | generators/backup_files/templates/config.rake |
backup-1.0.0 | generators/backup_tasks/templates/config.rake |