File: key_store.rb

package info (click to toggle)
ruby-omniauth 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 400 kB
  • sloc: ruby: 2,483; makefile: 7
file content (22 lines) | stat: -rw-r--r-- 608 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'hashie/mash'

module OmniAuth
  # Generic helper hash that allows method access on deeply nested keys.
  class KeyStore < ::Hashie::Mash
    # Disables warnings on Hashie 3.5.0+ for overwritten keys
    def self.override_logging
      require 'hashie/version'
      return unless Gem::Version.new(Hashie::VERSION) >= Gem::Version.new('3.5.0')

      if respond_to?(:disable_warnings)
        disable_warnings
      else
        define_method(:log_built_in_message) { |*| }
        private :log_built_in_message
      end
    end

    # Disable on loading of the class
    override_logging
  end
end