Sha256: aab75e872403670d39d431e8293d3e530187469ca949d95cfe2bc6fc732a74fa

Contents?: true

Size: 952 Bytes

Versions: 18

Compression:

Stored size: 952 Bytes

Contents

# encoding: utf-8

module Backup
  class Package

    ##
    # The time when the backup initiated (in format: 2011.02.20.03.29.59)
    attr_reader :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

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

    def initialize(model)
      @time = model.time
      @trigger = model.trigger
      @extension = 'tar'
      @chunk_suffixes = Array.new
      @version = Backup::Version.current
    end

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

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

  end
end

Version data entries

18 entries across 18 versions & 3 rubygems

Version Path
backup-3.3.2 lib/backup/package.rb
backup-3.3.1 lib/backup/package.rb
backup-3.3.0 lib/backup/package.rb
backup-3.2.0 lib/backup/package.rb
backup-3.1.3 lib/backup/package.rb
backup-3.1.2 lib/backup/package.rb
backup-3.1.1 lib/backup/package.rb
backup-3.1.0 lib/backup/package.rb
backup-agoddard-3.0.28 lib/backup/package.rb
backup-agoddard-3.0.27 lib/backup/package.rb
ey-vendored-backup-3.0.27 lib/backup/package.rb
backup-3.0.27 lib/backup/package.rb
backup-3.0.26 lib/backup/package.rb
backup-3.0.25 lib/backup/package.rb
backup-3.0.24 lib/backup/package.rb
backup-3.0.23 lib/backup/package.rb
backup-3.0.22 lib/backup/package.rb
backup-3.0.21 lib/backup/package.rb