### Home Classes Methods

### In Files

- lib/stella/report.rb

### Parent

Storable

### Namespace

- MODULE Stella::Report::Content::ReportMethods

### Methods

- #binary?
- #image?
- #process

### Included Modules

- Gibbler::Complex
- Stella::Report::Plugin

### Files

- LICENSE.txt
- TODO

### Class/Module Index

Quicksearch

- Stella
- Stella::API
- Stella::API::Unauthorized
- Stella::Asserts
- Stella::CLI
- Stella::Client
- Stella::Common
- Stella::Common::PrivacyMethods
- Stella::ET
- Stella::Engine
- Stella::Engine::Base
- Stella::Engine::Base::ClassMethods
- Stella::Engine::Checkup
- Stella::EventTemplate
- Stella::ForcedRedirect
- Stella::HTTPError
- Stella::Log
- Stella::Log::HTTP
- Stella::PageError
- Stella::RT
- Stella::RepeatRequest
- Stella::Report
- Stella::Report::Content
- Stella::Report::Content::ReportMethods
- Stella::Report::Errors
- Stella::Report::Errors::ReportMethods
- Stella::Report::Headers
- Stella::Report::Metrics
- Stella::Report::Metrics::ReportMethods
- Stella::Report::Plugin
- Stella::Report::Plugin::ClassMethods
- Stella::Report::Statuses
- Stella::Report::Statuses::ReportMethods
- Stella::RequestError
- Stella::RequestTemplate
- Stella::Session
- Stella::StringTemplate
- Stella::TP
- Stella::Testplan
- Stella::Testplan::ClassMethods
- Stella::TestplanQuit
- Stella::Testrun
- Stella::TimeoutError
- Stella::UC
- Stella::Usecase
- Stella::Usecase::ClassMethods
- Stella::UsecaseError
- Stella::UsecaseFail
- Stella::Utils
- Stella::VERSION
- Addressable
- Addressable::URI
- Time
- Time::Units
- Array
- DefaultTestplan
- Float
- Hash
- MatchData
- MetricsPack
- Numeric
- Object
- OpenStruct
- StellaBehavior
- StellaError
- String
- Symbol
- Thread

No matching classes.

# Stella::Report::Content

### Public Instance Methods

binary?() click to toggle source

    # File lib/stella/report.rb, line 131
    def binary?
      @is_binary == true
    end

image?() click to toggle source

    # File lib/stella/report.rb, line 134
    def image?
      @is_image == true
    end

process(filter={}) click to toggle source

    # File lib/stella/report.rb, line 137
    def process(filter={})
      if report.errors.exceptions?
        @log = report.errors.exceptions
      elsif report.errors.fubars?
        @log = report.errors.fubars
      elsif report.errors.timeouts?
        @log = report.errors.timeouts
      else
        @log = report.timeline.messages.filter(:kind => :http_log, :state => :nominal)
      end

      return if @log.empty?

      unless Stella::Utils.binary?(@log.first.request_body) || Stella::Utils.image?(@log.first.request_body)
        @request_body = @log.first.request_body
      end

      @request_body_digest = @log.first.request_body.digest
      @is_binary = Stella::Utils.binary?(@log.first.response_body)
      @is_image = Stella::Utils.image?(@log.first.response_body)
      unless binary? || image?
        @response_body = @log.first.response_body.to_s
        if @response_body.size >= 250_000
          @response_body = @response_body.slice 0, 249_999
          @response_body << ' [truncated]'
        end
        @response_body.force_encoding("UTF-8") if RUBY_VERSION >= "1.9.0"
        begin
          if defined?(Pismo) && @response_body
            doc = Pismo::Document.new @response_body
            @keywords = doc.keywords rescue nil  # BUG: undefined method `downcase' for nil:NilClass
            @title = doc.title
            @favicon = doc.favicon
            @author = doc.author
            @lede = doc.lede
            @description = doc.description
          end
        rescue => ex
          Stella.li ex.message
          # /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.1/lib/nokogiri/xml/fragment_handler.rb:37: [BUG] Segmentation fault
          #  ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
        end
      end
      @response_body_digest = @log.first.response_body.digest
      @log.each { |entry| entry.response_body = ''; entry.request_body = '' }
      processed!
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.