123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Core::Formatters::DeprecationFormatter Private

Do not use. This class is for internal use only.

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#count (readonly)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 10

attr_reader :count, :deprecation_stream, :summary_stream

#deprecation_stream (readonly) Also known as: #output

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 10

attr_reader :count, :deprecation_stream, :summary_stream

#output (readonly)

Alias for #deprecation_stream.

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 18

alias :output :deprecation_stream

#summary_stream (readonly)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 10

attr_reader :count, :deprecation_stream, :summary_stream

Instance Method Details

#deprecation(notification)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 32

def deprecation(notification)
  return if @seen_deprecations.include? notification

  @count += 1
  printer.print_deprecation_message notification
  @seen_deprecations << notification
end

#deprecation_message_for(data)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 44

def deprecation_message_for(data)
  if data.message
    SpecifiedDeprecationMessage.new(data)
  else
    GeneratedDeprecationMessage.new(data)
  end
end

#deprecation_summary(_notification)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 40

def deprecation_summary(_notification)
  printer.deprecation_summary
end

#printer

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 20

def printer
  @printer ||= case deprecation_stream
               when File
                 ImmediatePrinter.new(FileStream.new(deprecation_stream),
                                      summary_stream, self)
               when RaiseErrorStream
                 ImmediatePrinter.new(deprecation_stream, summary_stream, self)
               else
                 DelayedPrinter.new(deprecation_stream, summary_stream, self)
               end
end