Sha256: e187071155b122ce1803c2bcc1625db9e14b9ae7cdb19200a20f34d4474de340

Contents?: true

Size: 749 Bytes

Versions: 18

Compression:

Stored size: 749 Bytes

Contents

module DataMigrate
  include ActiveSupport::Configurable
  class << self

    def configure
      yield config
    end

    def config
      @config ||= Config.new
    end
  end

  class Config
    attr_accessor :data_migrations_path, :data_template_path, :db_configuration, :spec_name

    DEFAULT_DATA_TEMPLATE_PATH = "data_migration.rb"

    def initialize
      @data_migrations_path = "db/data/"
      @data_template_path = DEFAULT_DATA_TEMPLATE_PATH
      @db_configuration = nil
      @spec_name = nil
    end

    def data_template_path=(value)
      @data_template_path = value.tap do |path|
        raise ArgumentError, "File not found: '#{path}'" unless path == DEFAULT_DATA_TEMPLATE_PATH || File.exist?(path)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
data_migrate-11.2.0 lib/data_migrate/config.rb
data_migrate-11.1.0 lib/data_migrate/config.rb
data_migrate-9.1.3 lib/data_migrate/config.rb
data_migrate-9.1.2 lib/data_migrate/config.rb
data_migrate-11.0.0 lib/data_migrate/config.rb
data_migrate-11.0.0.rc3 lib/data_migrate/config.rb
data_migrate-11.0.0.rc lib/data_migrate/config.rb
data_migrate-9.4.4 lib/data_migrate/config.rb
data_migrate-9.4.2 lib/data_migrate/config.rb
data_migrate-9.4.1 lib/data_migrate/config.rb
data_migrate-9.4.0 lib/data_migrate/config.rb
data_migrate-9.3.0 lib/data_migrate/config.rb
data_migrate-9.2.0 lib/data_migrate/config.rb
data_migrate-9.1.1 lib/data_migrate/config.rb
data_migrate-9.1.0 lib/data_migrate/config.rb
data_migrate-10.0.3.rc lib/data_migrate/config.rb
data_migrate-10.0.0.rc1 lib/data_migrate/config.rb
data_migrate-9.0.0 lib/data_migrate/config.rb