Sha256: 1d497e4d83e8565fe8734b9c7eeca8488713cba4481285114277270817f64e30

Contents?: true

Size: 936 Bytes

Versions: 5

Compression:

Stored size: 936 Bytes

Contents

# External dependencies
require 'active_support/all'
require 'set'

# Schemacop module
module Schemacop
  CONTEXT_THREAD_KEY = :schemacop_schema_context

  mattr_accessor :load_paths
  self.load_paths = ['app/schemas']

  mattr_accessor :default_schema_version
  self.default_schema_version = 3

  def self.with_context(context)
    prev_context = Thread.current[CONTEXT_THREAD_KEY]
    Thread.current[CONTEXT_THREAD_KEY] = context
    return yield
  ensure
    Thread.current[CONTEXT_THREAD_KEY] = prev_context
  end

  def self.context
    Thread.current[CONTEXT_THREAD_KEY] ||= V3::Context.new
  end
end

# Load shared
require 'schemacop/scoped_env'
require 'schemacop/exceptions'
require 'schemacop/base_schema'
require 'schemacop/schema2'
require 'schemacop/schema3'
require 'schemacop/schema'

# Load individual versions
require 'schemacop/v2'
require 'schemacop/v3'

# Load Railtie
require 'schemacop/railtie' if defined?(Rails)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
schemacop-3.0.0.rc4 lib/schemacop.rb
schemacop-3.0.0.rc3 lib/schemacop.rb
schemacop-3.0.0.rc2 lib/schemacop.rb
schemacop-3.0.0.rc1 lib/schemacop.rb
schemacop-3.0.0.rc0 lib/schemacop.rb