Sha256: 4306e7297518fa2d6f267c74290f6dcd0047f1182b347a668e2d49897a09c440

Contents?: true

Size: 1.02 KB

Versions: 34

Compression:

Stored size: 1.02 KB

Contents

# encoding: utf-8

module Backup
  class Package

    ##
    # The time when the backup initiated (in format: 2011.02.20.03.29.59)
    attr_accessor :time

    ##
    # The trigger which initiated the backup process
    attr_reader :trigger

    ##
    # Extension for the final archive file(s)
    attr_accessor :extension

    ##
    # Set by the Splitter if the final archive was "chunked"
    attr_accessor :chunk_suffixes

    ##
    # If true, the Cycler will not attempt to remove the package when Cycling.
    attr_accessor :no_cycle

    ##
    # The version of Backup used to create the package
    attr_reader :version

    def initialize(model)
      @trigger = model.trigger
      @extension = 'tar'
      @chunk_suffixes = Array.new
      @no_cycle = false
      @version = VERSION
    end

    def filenames
      if chunk_suffixes.empty?
        [basename]
      else
        chunk_suffixes.map {|suffix| "#{ basename }-#{ suffix }" }
      end
    end

    def basename
      "#{ trigger }.#{ extension }"
    end

  end
end

Version data entries

34 entries across 34 versions & 5 rubygems

Version Path
backup-4.2.0 lib/backup/package.rb
backup-4.1.12 lib/backup/package.rb
backup-4.1.11 lib/backup/package.rb
backup-ssh-4.1.10 lib/backup/package.rb
backup-4.1.10 lib/backup/package.rb
backup-4.1.9 lib/backup/package.rb
backup-4.1.8 lib/backup/package.rb
backup-4.1.7 lib/backup/package.rb
backup-4.1.6 lib/backup/package.rb
backup-4.1.5 lib/backup/package.rb
backup-4.1.4 lib/backup/package.rb
backup-4.1.3 lib/backup/package.rb
venet-backup-4.1.3 lib/backup/package.rb
backup-4.1.2 lib/backup/package.rb
backup-4.1.1 lib/backup/package.rb
backup-4.1.0 lib/backup/package.rb
backup-4.0.7 lib/backup/package.rb
backup-4.0.6 lib/backup/package.rb
backup-4.0.5 lib/backup/package.rb
backup-4.0.4 lib/backup/package.rb