### Home Classes Methods

### In Files

- lib/stella.rb
- lib/stella/utils.rb
- lib/stella/testplan.rb
- lib/stella/client.rb
- lib/stella/engine.rb
- lib/stella/report.rb

### Parent

Object

### Namespace

- MODULE Stella::Asserts
- MODULE Stella::Common
- MODULE Stella::Engine
- MODULE Stella::Utils
- MODULE Stella::VERSION
- CLASS Stella::API
- CLASS Stella::CLI
- CLASS Stella::Client
- CLASS Stella::ET
- CLASS Stella::EventTemplate
- CLASS Stella::ForcedRedirect
- CLASS Stella::HTTPError
- CLASS Stella::Log
- CLASS Stella::PageError
- CLASS Stella::RT
- CLASS Stella::RepeatRequest
- CLASS Stella::Report
- CLASS Stella::RequestError
- CLASS Stella::RequestTemplate
- CLASS Stella::Session
- CLASS Stella::StringTemplate
- CLASS Stella::TP
- CLASS Stella::Testplan
- CLASS Stella::TestplanQuit
- CLASS Stella::Testrun
- CLASS Stella::TimeoutError
- CLASS Stella::UC
- CLASS Stella::Usecase
- CLASS Stella::UsecaseError
- CLASS Stella::UsecaseFail

### Methods

- ::canonical_host
- ::canonical_uri
- ::checkup
- ::debug?
- ::get
- ::ld
- ::le
- ::li
- ::new
- ::now
- ::quiet?
- ::rescue

### 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

### Constants

ET
IMAGE_EXT
RT
TP
UC

### Attributes

agent[RW]
debug[RW]
log[RW]
noise[RW]
quiet[RW]
stdout[RW]
plan[R]

### Public Class Methods

canonical_host(host) click to toggle source

blamestella.com/ => blamestella.com blamestella.com/ => blamestella.com:443

    # File lib/stella.rb, line 161
    def canonical_host(host)
      return nil if host.nil?
      if host.kind_of?(URI)
        uri = host
      else
        host &&= host.to_s
        host.strip!
        host = host.to_s unless String === host
        host = "http://#{host}" unless host.match(/^https?:\/\//)
        uri = URI.parse(host)
      end
      str = "#{uri.host}".downcase
      #str << ":#{uri.port}" if uri.port && uri.port != 80
      str
    end

canonical_uri(uri) click to toggle source

    # File lib/stella.rb, line 177
    def canonical_uri(uri)
      return nil if uri.nil?
      if uri.kind_of?(URI)
        uri = Addressable::URI.parse uri.to_s
      elsif uri.kind_of?(String)
        uri &&= uri.to_s
        uri.strip! unless uri.frozen?
        uri = "http://#{uri}" unless uri.match(/^https?:\/\//)
        uri = Addressable::URI.parse(uri)
      end
      uri.scheme ||= 'http'
      uri.path = '/' if uri.path.to_s.empty?
      uri
    end

checkup(uri, opts={}) click to toggle source

    # File lib/stella.rb, line 150
    def checkup(uri, opts={})
      plan = Stella::Testplan.new uri
      run = Stella::Testrun.new plan, :checkup, opts
      Stella::Engine.run run
      run
    end

debug?() click to toggle source

    # File lib/stella.rb, line 129
    def debug?()        @debug == true  end

get(uri, opts={}) click to toggle source

    # File lib/stella.rb, line 139
    def get(uri, opts={})
      opts[:concurrency] ||= 1
      opts[:repetitions] ||= 1
      run = checkup uri, opts
      report = run.report
      if report.processed? && report.content && report.statuses.success?
        report.content.response_body
      else
        nil
      end
    end

ld(*msg) click to toggle source

    # File lib/stella.rb, line 133
    def ld(*msg)
      return unless Stella.debug?
      prefix = "D(#{Thread.current.object_id}):  "
      li("#{prefix}#{msg.join("#{$/}#{prefix}")}")
    end

le(*msg) click to toggle source

    # File lib/stella.rb, line 132
    def le(*msg); li "  " << msg.join("#{$/}  ") end

li(*msg) click to toggle source

    # File lib/stella.rb, line 131
    def li(*msg) STDERR.puts *msg unless quiet? end

new(*args) click to toggle source

    # File lib/stella.rb, line 110
    def initialize *args
      @plan = Stella::TP === args.first ?
        args.first.clone : Stella::TP.new(args.first)
      #@plan.freeze
      @runner
    end

now() click to toggle source

    # File lib/stella.rb, line 156
    def now
      Time.now.utc.to_f
    end

quiet?() click to toggle source

    # File lib/stella.rb, line 130
    def quiet?()        @quiet == true  end

rescue(&blk) click to toggle source

    # File lib/stella.rb, line 192
    def rescue(&blk)
      blk.call
    rescue StellaError => ex
      Stella.le ex.message
      Stella.ld ex.backtrace
    #rescue => ex
    #  Stella.le ex.message
    #  Stella.le ex.backtrace
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.