view_source_map 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1f1752b94a52f0a1dd7b7c23211aa5dc258a905
4
- data.tar.gz: 074a240f754becf81cbc2184a1ff7df86028308a
3
+ metadata.gz: a46428774848ad5926c3e7eaa44cd25e64f02c2f
4
+ data.tar.gz: 39ad2625b2fdc51a20c57b5597cc7aecedb532c4
5
5
  SHA512:
6
- metadata.gz: 2e25e018dc470c70c6e1bad4be6f88b6c00d172fe8140288357c27161dcd27023552f6d3f57f1a1e6792c4230171d8085164f382656ca3bb63b8ab4d2cebdb28
7
- data.tar.gz: 09f708458cf74e5d4a9f2c5cbc1804efba6c25ca4ffb5ca1f4b1efa4a98ee5f229702fdb2fb5323ec6cc02fb353203d53f4a2450cd5172bb628a3d1f3bf5cc40
6
+ metadata.gz: eaae7f0cd607816fcecb44f2b6e52d65798f3c2a7c33d3dd9afc9c1b7ae78644d6857ea4d0058483151d71f6775f1bfb0a75537703fe1b944f1c093f1179c4cb
7
+ data.tar.gz: 3cbf71e8e57be162823f5d16392ead133defcbf8d66926cc171bfc4993566e62ac5db287d14c5c0044a49e7cd6df0ae55941ce57a449cbbbfab19ad2da6f8f85
@@ -29,13 +29,19 @@ module ViewSourceMap
29
29
 
30
30
  ActionView::TemplateRenderer.class_eval do
31
31
  def render_template_with_path_comment(template, layout_name = nil, locals = {})
32
- content = render_template_without_path_comment(template, layout_name, locals)
33
- if @lookup_context.rendered_format == :html
34
- path = Pathname.new(template.identifier)
35
- name = path.relative_path_from(Rails.root)
36
- "<!-- BEGIN #{name} -->#{content}<!-- END #{name} -->".html_safe
37
- else
38
- content
32
+ view, locals = @view, locals || {}
33
+
34
+ render_with_layout(layout_name, locals) do |layout|
35
+ instrument(:template, :identifier => template.identifier, :layout => layout.try(:virtual_path)) do
36
+ content = template.render(view, locals) { |*name| view._layout_for(*name) }
37
+ if @lookup_context.rendered_format == :html
38
+ path = Pathname.new(template.identifier)
39
+ name = path.relative_path_from(Rails.root)
40
+ "<!-- BEGIN #{name} -->#{content}<!-- END #{name} -->".html_safe
41
+ else
42
+ content
43
+ end
44
+ end
39
45
  end
40
46
  end
41
47
  alias_method_chain :render_template, :path_comment
@@ -1,3 +1,3 @@
1
1
  module ViewSourceMap
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_source_map
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-25 00:00:00.000000000 Z
11
+ date: 2014-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails