Sha256: dc7dba7df8f035e12c5f09ef2a1e6977b31a8d39c4e184c8c1f88a9819a3b818

Contents?: true

Size: 1.14 KB

Versions: 6

Compression:

Stored size: 1.14 KB

Contents

require "snapshotar/configuration"
require "snapshotar/version"
require "snapshotar/core"
require "snapshotar/tasks"

##
# Make a snapshot of your staging environment and pull back on your dev machine.

module Snapshotar

  class << self

    ##
    # Configuration object. Create a *snapshotar.rb* initializer under
    # config/initializers and add your configuation inside:
    #
    #    Snapshotar.configure do |config|
    #      config.storage_type = :file # :s3
    #
    #      config.models << [Event, :name, :date]
    #      config.models << [Artist, :name]
    #    end
    attr_accessor :configuration
  end

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

  def self.configure
    yield(configuration) if block_given?
  end

  def self.core
    @core ||= Core.new
  end

  ##
  # List available snapshots
  #
  def self.list
    self.core.list
  end

  ##
  # Create a snapshot
  #
  def self.create(name = nil)
    self.core.export(name)
  end

  ##
  # Load a snapshot
  #
  def self.load(name)
    self.core.import(name)
  end

  ##
  # Delete a snapshot
  #
  def self.delete(name)
    self.core.delete(name)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
snapshotar-0.0.7 lib/snapshotar.rb
snapshotar-0.0.6 lib/snapshotar.rb
snapshotar-0.0.4 lib/snapshotar.rb
snapshotar-0.0.3 lib/snapshotar.rb
snapshotar-0.0.2 lib/snapshotar.rb
snapshotar-0.0.1 lib/snapshotar.rb