Class: FirePHRuby::CGI

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/firephruby.rb

Constant Summary

Constants included from Common

FirePHRuby::Common::FPHR_INIT_HEADERS, FirePHRuby::Common::FPHR_INIT_HEADERS_DUMP, FirePHRuby::Common::FPHR_INIT_HEADERS_LOG, FirePHRuby::Common::FPHR_KINDS, FirePHRuby::Common::FPHR_LEGACY_WARNING, FirePHRuby::Common::MAX_LENGTH

Instance Method Summary collapse

Methods included from Common

#_firephruby_build_headers, #_firephruby_initialize_request, #_firephruby_mask_ruby_types, #_firephruby_set_options, #firephruby_internal_log

Constructor Details

#initialize(options = {}) ⇒ CGI

Returns a new instance of CGI.



107
108
109
110
111
112
113
# File 'lib/firephruby.rb', line 107

def initialize options={}
	_firephruby_set_options options
	ENV['HTTP_USER_AGENT'] = 'FirePHP/0.2.b.7' unless ENV['HTTP_USER_AGENT'] # for being callable from shell
	headers = _firephruby_initialize_request ENV['HTTP_USER_AGENT'] 
	return if @firephpruby_skip
	headers.each_pair { |k,v| puts "#{k}: #{v}" }
end

Instance Method Details

#dump(obj, label = '') ⇒ Object



120
121
122
# File 'lib/firephruby.rb', line 120

def dump obj, label=''
	firelog obj,'DUMP', label
end

#firelog(msg, kind = 'LOG', label = nil) ⇒ Object



114
115
116
117
118
# File 'lib/firephruby.rb', line 114

def firelog msg,kind='LOG', label=nil
	return if @firephpruby_skip
	headers = _firephruby_build_headers msg,kind,label
	headers.each { |h| puts "#{h[0]}: #{h[1]}" }
end

#send_index_headerObject

not needed since 0.2.b.4 or something like



123
124
125
# File 'lib/firephruby.rb', line 123

def send_index_header # not needed since 0.2.b.4 or something like
	puts "X-Wf-1-Index: #{@fire_msg_index.to_s}"
end