Module: Backy

Defined in:
lib/backy/db.rb,
lib/backy/s3.rb,
lib/backy_rb.rb,
lib/backy/cli.rb,
lib/backy/list.rb,
lib/backy/logger.rb,
lib/backy/pg_dump.rb,
lib/backy/railtie.rb,
lib/backy/s3_list.rb,
lib/backy/s3_load.rb,
lib/backy/s3_save.rb,
lib/backy/version.rb,
lib/backy/app_config.rb,
lib/backy/pg_restore.rb,
lib/backy/configuration.rb

Defined Under Namespace

Modules: AppConfig, Db, S3 Classes: CLI, Configuration, Error, List, Logger, PgDump, PgRestore, Railtie, S3List, S3Load, S3Save

Constant Summary collapse

VERSION =
"0.2.1"

Class Method Summary collapse

Class Method Details

.configurationObject



30
31
32
# File 'lib/backy_rb.rb', line 30

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



26
27
28
# File 'lib/backy_rb.rb', line 26

def self.configure
  yield(configuration)
end

.setupObject



34
35
36
37
38
# File 'lib/backy_rb.rb', line 34

def self.setup
  Logger.log("Setting up Backy...")
  configuration.load
  setup_logging
end

.setup_loggingObject



40
41
42
43
44
# File 'lib/backy_rb.rb', line 40

def self.setup_logging
  log_file = configuration.log_file
  log_dir = File.dirname(log_file)
  FileUtils.mkdir_p(log_dir) unless Dir.exist?(log_dir)
end