Sha256: 49203fb62f29ef0194c276c72eb072504107b669ebbcb4ed98e7436ff5f357d8

Contents?: true

Size: 643 Bytes

Versions: 2

Compression:

Stored size: 643 Bytes

Contents

require "active_support/all"
require "i18n"

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

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

Protector::Adapters::ActiveRecord.activate! if defined?(ActiveRecord)
Protector::Adapters::Sequel.activate! if defined?(Sequel)

module Protector

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
protector-0.3.2 lib/protector.rb
protector-0.3.1 lib/protector.rb