render_debug 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -2
- data/lib/render_debug/pre_render_callout.rb +12 -5
- data/lib/render_debug/railtie.rb +1 -1
- data/lib/render_debug/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33f006a06c607e0d8d8ce2d4990ffad50204a02b
|
4
|
+
data.tar.gz: b581f2b5e821d19395988474ce7688a794cb1322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ff6ecbb719cf49ea5bd268e5f58d7f5f030fa2d8fbf436134ad4b3801f242e48778af213049659516e3ea13181346995cca18e895f27d36c12c5872290b6bf5
|
7
|
+
data.tar.gz: 2b1b0260b0c4bed5cc6745fecc28c37f4eba64edbbe2d71d30dfc9563fb3e725bf41b8354d46ea2df285a7dac36ace57ae59f845f163369e1765a34c4c230fa1
|
data/Rakefile
CHANGED
@@ -8,9 +8,8 @@ require 'rdoc/task'
|
|
8
8
|
|
9
9
|
RDoc::Task.new(:rdoc) do |rdoc|
|
10
10
|
rdoc.rdoc_dir = 'rdoc'
|
11
|
-
rdoc.title = '
|
11
|
+
rdoc.title = 'RenderDebug'
|
12
12
|
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.rdoc')
|
14
13
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
14
|
end
|
16
15
|
|
@@ -5,12 +5,19 @@ module RenderDebug
|
|
5
5
|
alias_method_chain :render, :callout
|
6
6
|
end
|
7
7
|
|
8
|
-
def render_with_callout(context, options
|
9
|
-
initial_render = render_without_callout(context, options
|
10
|
-
|
11
|
-
|
8
|
+
def render_with_callout(context, options)
|
9
|
+
initial_render = render_without_callout(context, options)
|
10
|
+
tag = ""
|
11
|
+
if(options[:partial])
|
12
|
+
tag = "PARTIAL #{options[:partial]}"
|
13
|
+
elsif(options[:template])
|
14
|
+
tag = "ACTION #{options[:template]} INVOKED FROM #{context.controller.class.to_s}"
|
15
|
+
end
|
16
|
+
|
17
|
+
if(tag.blank?)
|
18
|
+
initial_render.html_safe
|
12
19
|
else
|
13
|
-
"<!--
|
20
|
+
"<!-- #{tag} -->#{initial_render}<!-- END #{tag}-->".html_safe
|
14
21
|
end
|
15
22
|
end
|
16
23
|
end
|
data/lib/render_debug/railtie.rb
CHANGED
@@ -2,7 +2,7 @@ module RenderDebug
|
|
2
2
|
class Railtie < Rails::Railtie
|
3
3
|
initializer "render_debug.setup" do |app|
|
4
4
|
ActiveSupport.on_load(:action_view) do
|
5
|
-
ActionView::
|
5
|
+
ActionView::Renderer.send(:include, RenderDebug::PreRenderCallout)
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
data/lib/render_debug/version.rb
CHANGED