Class: RailsWithFirePHP::CGI

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

Constant Summary

Constants included from Common

RailsWithFirePHP::Common::MAX_LENGTH, RailsWithFirePHP::Common::RWFP_INIT_HEADERS, RailsWithFirePHP::Common::RWFP_INIT_HEADERS_DUMP, RailsWithFirePHP::Common::RWFP_INIT_HEADERS_LOG, RailsWithFirePHP::Common::RWFP_KINDS, RailsWithFirePHP::Common::RWFP_LEGACY_WARNING

Instance Method Summary collapse

Methods included from Common

#_rwfp_build_headers, #_rwfp_initialize_request, #_rwfp_mask_ruby_types, #_rwfp_set_options, #rwfp_internal_log, #toUnicode

Constructor Details

#initialize(options = {}) ⇒ CGI

Returns a new instance of CGI.



110
111
112
113
114
115
116
# File 'lib/core/rails_with_firephp.rb', line 110

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

Instance Method Details

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



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

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

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



117
118
119
120
121
# File 'lib/core/rails_with_firephp.rb', line 117

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

#send_index_headerObject

not needed since 0.2.b.4 or something like



126
127
128
# File 'lib/core/rails_with_firephp.rb', line 126

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