Module: Oboe::Rails::Helpers

Extended by:
ActiveSupport::Concern
Defined in:
lib/oboe/frameworks/rails.rb

Constant Summary collapse

@@rum_xhr_tmpl =
File.read(File.dirname(__FILE__) + '/rails/helpers/rum/rum_ajax_header.js.erb')
@@rum_hdr_tmpl =
File.read(File.dirname(__FILE__) + '/rails/helpers/rum/rum_header.js.erb')
@@rum_ftr_tmpl =
File.read(File.dirname(__FILE__) + '/rails/helpers/rum/rum_footer.js.erb')

Instance Method Summary collapse

Instance Method Details



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/oboe/frameworks/rails.rb', line 29

def oboe_rum_footer
  begin
    return unless Oboe::Config.rum_id
    if Oboe.tracing?
      # Even though the footer template is named xxxx.erb, there are no ERB tags in it so we'll
      # skip that step for now
      return raw(@@rum_ftr_tmpl)
    end
  rescue Exception => e
    Oboe.logger.warn "oboe_rum_footer: #{e.message}."
    return ""
  end
end

#oboe_rum_headerObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/oboe/frameworks/rails.rb', line 13

def oboe_rum_header
  begin
    return unless Oboe::Config.rum_id
    if Oboe.tracing?
      if request.xhr?
        return raw(ERB.new(@@rum_xhr_tmpl).result)
      else
        return raw(ERB.new(@@rum_hdr_tmpl).result)
      end
    end
  rescue Exception => e  
    Oboe.logger.warn "oboe_rum_header: #{e.message}."
    return ""
  end
end