Class: RorVsWild::Plugin::ActionView

Inherits:
Object
  • Object
show all
Defined in:
lib/rorvswild/plugin/action_view.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.setupObject


4
5
6
7
8
9
10
# File 'lib/rorvswild/plugin/action_view.rb', line 4

def self.setup
  return if @installed
  return unless defined?(::ActiveSupport::Notifications.subscribe)
  ActiveSupport::Notifications.subscribe("render_partial.action_view", new)
  ActiveSupport::Notifications.subscribe("render_template.action_view", new)
  @installed = true
end

Instance Method Details

#finish(name, id, payload) ⇒ Object


16
17
18
19
20
21
22
23
# File 'lib/rorvswild/plugin/action_view.rb', line 16

def finish(name, id, payload)
  RorVsWild::Section.stop do |section|
    section.kind = "view".freeze
    section.command = RorVsWild.agent.locator.relative_path(payload[:identifier])
    section.file = section.command
    section.line = 1
  end
end

#start(name, id, payload) ⇒ Object


12
13
14
# File 'lib/rorvswild/plugin/action_view.rb', line 12

def start(name, id, payload)
  RorVsWild::Section.start
end