rails_view_annotator 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Readme.md CHANGED
@@ -17,9 +17,9 @@ end
17
17
  Now rendered content will have instructive comments.
18
18
 
19
19
  ````html
20
- <!-- begin: app/views/user/_bio.html.haml (from app/views/layouts/user/show.html.haml:4) -->
20
+ <!-- begin: app/views/user/_bio.html.haml (from app/views/user/show.html.haml:4) -->
21
21
  <div class='bio'>Ed's Bio</div>
22
- <!-- end: app/views/user/_bio.html.haml (from app/views/layouts/user/show.html.haml:4) -->
22
+ <!-- end: app/views/user/_bio.html.haml (from app/views/user/show.html.haml:4) -->
23
23
  ````
24
24
 
25
25
  ## License
@@ -6,17 +6,11 @@ module RailsViewAnnotator
6
6
  render = klass.instance_method :render
7
7
  klass.send(:define_method, :render) do |*args|
8
8
  inner = render.bind(self).call(*args)
9
+ return unless identifier
9
10
  short_identifier = Pathname.new(identifier).relative_path_from Rails.root
10
11
 
11
- backtrace = nil
12
- begin
13
- raise ContextError
14
- rescue ContextError => e
15
- backtrace = e.backtrace
16
- end
17
-
18
12
  r = /^#{Regexp.escape(Rails.root.to_s)}\/([^:]+:\d+)/
19
- backtrace.find { |line| line.match r }
13
+ caller.find { |line| line.match r }
20
14
  called_from = context = $1
21
15
 
22
16
  descriptor = "#{short_identifier} (from #{called_from})"
@@ -1,3 +1,3 @@
1
1
  module RailsViewAnnotator
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_view_annotator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-28 00:00:00.000000000 Z
12
+ date: 2012-05-30 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: The Rails View Annotator makes it easy to find out which partial generated
15
15
  which output