Sha256: dc53425b00b417bdbde8809217820f00c11255566723128f61a406034f782109

Contents?: true

Size: 816 Bytes

Versions: 2

Compression:

Stored size: 816 Bytes

Contents

require "active_support/all"
require "i18n"

require "protector/version"
require "protector/dsl"
require "protector/adapters/active_record"
require "protector/adapters/sequel"

require "protector/engine" if defined?(Rails)

I18n.load_path += Dir[File.expand_path File.join('..', 'locales', '*.yml'), File.dirname(__FILE__)]

module Protector
  class << self
    ADAPTERS = [
      Protector::Adapters::ActiveRecord,
      Protector::Adapters::Sequel
    ]

    attr_accessor :paranoid

    # Allows executing any code having Protector globally disabled
    def insecurely(&block)
      Thread.current[:protector_disabled] = true
      yield
    ensure
      Thread.current[:protector_disabled] = false
    end

    def activate!
      ADAPTERS.each{|adapter| adapter.activate!}
    end
  end
end

Protector.activate!

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
protector-0.4.1 lib/protector.rb
protector-0.4.0 lib/protector.rb