def create_config(text = nil, config_file = nil)
      config_file ||= Backup::Config.config_file
      config_path = File.dirname(config_file)

      unless text.to_s.empty?
        indent = text.lines.first.match(/^ */)[0].length
        text = text.lines.map { |l| l[indent..-1] }.join
      end
      config = <<-EOS.gsub(/^        /, "")
        # encoding: utf-8

        Backup::Utilities.configure do
          # silence the log output produced by the auto-detection
          tar_dist :gnu
        end

        Backup::Logger.configure do
          console.quiet = true
          logfile.enabled = false
        end

        Backup::Storage::Local.defaults do |local|
          local.path = "#{LOCAL_STORAGE_PATH}"
        end

        #{text}

        #{CONFIG_TEMPLATE}
      EOS

      # Create models path, since models are always relative to the config file.
      FileUtils.mkdir_p File.join(config_path, "models")
      File.open(config_file, "w") { |f| f.write config }
    end
def create_config(text = nil, config_file = nil)
      config_file ||= Backup::Config.config_file
      config_path = File.dirname(config_file)

      unless text.to_s.empty?
        indent = text.lines.first.match(/^ */)[0].length
        text = text.lines.map { |l| l[indent..-1] }.join
      end
      config = <<-EOS.gsub(/^        /, "")
        # encoding: utf-8

        Backup::Utilities.configure do
          # silence the log output produced by the auto-detection
          tar_dist :gnu
        end

        Backup::Logger.configure do
          console.quiet = true
          logfile.enabled = false
        end

        Backup::Storage::Local.defaults do |local|
          local.path = "#{LOCAL_STORAGE_PATH}"
        end

        #{text}

        #{CONFIG_TEMPLATE}
      EOS

      # Create models path, since models are always relative to the config file.
      FileUtils.mkdir_p File.join(config_path, "models")
      File.open(config_file, "w") { |f| f.write config }
    end
Creates the config.rb file.

 By default, this will be created as ~/Backup/config.rb,
 since Backup::Config is reset before each example.

 If paths will be changed when calling backup_perform(),
 like --config-file or --root-path, then the full path to
 the config file must be given here in +config_file+.

 The config file created here will disable console log output
 and file logging, but this may be overridden in +text+.

 Note that the first line in +text+ will set the indent for the text being
 given and that indent will be removed from all lines in +text+

 If you don"t intend to change the default config.rb contents or path,
 you can omit this method from your example. Calling create_model()
 will call this method if the +config_file+ does not exist.