Sha256: dd90f910a532305b0983c4c47fc628db979e6a8a0b982340f2ee60c04120ec0d

Contents?: true

Size: 844 Bytes

Versions: 5

Compression:

Stored size: 844 Bytes

Contents

require 'active_support/deprecation'

module ArJdbc

  class << self

    def warn(message, once = nil)
      super(message) || true if warn?(message, once)
    end

    def deprecate(message, once = nil) # adds a "DEPRECATION WARNING: " prefix
      ::ActiveSupport::Deprecation.warn(message, caller) || true if warn?(message, once)
    end

    private

    @@warns = nil
    @@warns = false if ENV_JAVA['arjdbc.warn'].eql? 'false'

    def warn?(message, once)
      return nil if @@warns.equal?(false) || ! message
      warns = @@warns ||= ( require 'set'; Set.new )
      return false if warns.include?(message)
      warns << message.dup if once
      true
    end

  end

  require 'arjdbc/jdbc/adapter'

  if ENV_JAVA['arjdbc.extensions.discover'].eql? 'true'
    self.discover_extensions
  else
    require 'arjdbc/discover'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
activerecord-jdbc-adapter-1.3.16 lib/arjdbc/jdbc.rb
activerecord-jdbc-adapter-1.3.15 lib/arjdbc/jdbc.rb
activerecord-jdbc-adapter-1.3.14 lib/arjdbc/jdbc.rb
activerecord-jdbc-adapter-1.3.13 lib/arjdbc/jdbc.rb
activerecord-jdbc-adapter-1.3.12 lib/arjdbc/jdbc.rb