Sha256: 5f2ad8d437d1ade16524b66c02814478baa7083f35555e1b37dda6255d1f8fc7

Contents?: true

Size: 961 Bytes

Versions: 16

Compression:

Stored size: 961 Bytes

Contents

# External dependencies
require 'ruby2_keywords'
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

16 entries across 16 versions & 1 rubygems

Version Path
schemacop-3.0.14 lib/schemacop.rb
schemacop-3.0.13 lib/schemacop.rb
schemacop-3.0.12 lib/schemacop.rb
schemacop-3.0.11 lib/schemacop.rb
schemacop-3.0.10 lib/schemacop.rb
schemacop-3.0.9 lib/schemacop.rb
schemacop-3.0.8 lib/schemacop.rb
schemacop-3.0.7 lib/schemacop.rb
schemacop-3.0.6 lib/schemacop.rb
schemacop-3.0.5 lib/schemacop.rb
schemacop-3.0.4 lib/schemacop.rb
schemacop-3.0.3 lib/schemacop.rb
schemacop-3.0.2 lib/schemacop.rb
schemacop-3.0.1 lib/schemacop.rb
schemacop-3.0.0 lib/schemacop.rb
schemacop-3.0.0.rc5 lib/schemacop.rb