Sha256: 7cc0425858282760cad1dcb5c10b00acca0cc132b6ca4b723061eae2e1102a99

Contents?: true

Size: 506 Bytes

Versions: 31

Compression:

Stored size: 506 Bytes

Contents

module SSHKit
  class DeprecationLogger
    def initialize(out)
      @out = out
      @previous_warnings = Set.new
    end

    def log(message)
      return if @out.nil?
      warning_msg = "[Deprecated] #{message}\n"
      caller_line = caller.find { |line| !line.include?('lib/sshkit') }
      warning_msg << "    (Called from #{caller_line})\n" unless caller_line.nil?
      @out << warning_msg unless @previous_warnings.include?(warning_msg)
      @previous_warnings << warning_msg
    end
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
sshkit-1.21.3 lib/sshkit/deprecation_logger.rb
sshkit-1.21.2 lib/sshkit/deprecation_logger.rb
sshkit-1.21.1 lib/sshkit/deprecation_logger.rb
sshkit-1.21.0 lib/sshkit/deprecation_logger.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/sshkit-1.18.2/lib/sshkit/deprecation_logger.rb
sshkit-1.20.0 lib/sshkit/deprecation_logger.rb
sshkit-1.19.1 lib/sshkit/deprecation_logger.rb
sshkit-1.19.0 lib/sshkit/deprecation_logger.rb
sshkit-1.18.2 lib/sshkit/deprecation_logger.rb
sshkit-1.18.1 lib/sshkit/deprecation_logger.rb
sshkit-1.18.0 lib/sshkit/deprecation_logger.rb
sshkit-1.17.0 lib/sshkit/deprecation_logger.rb
sshkit-1.16.1 lib/sshkit/deprecation_logger.rb
sshkit-1.16.0 lib/sshkit/deprecation_logger.rb
sshkit-1.15.1 lib/sshkit/deprecation_logger.rb
sshkit-1.15.0 lib/sshkit/deprecation_logger.rb
sshkit-1.14.0 lib/sshkit/deprecation_logger.rb
sshkit-1.13.1 lib/sshkit/deprecation_logger.rb
sshkit-1.13.0 lib/sshkit/deprecation_logger.rb
sshkit-1.12.0 lib/sshkit/deprecation_logger.rb