noisy_partials_for_rails_3 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/noisy_partials_for_rails_3.rb +17 -0
  2. metadata +88 -0
@@ -0,0 +1,17 @@
1
+ #NOTE: The following will only work in Rails 3.0.x. Rails 3.1 has
2
+ # its render method in a different place with a
3
+ # different method signature.
4
+ class ActionView::Partials::PartialRenderer
5
+ alias_method :_render_original, :render
6
+
7
+ def render
8
+ partial = ((@template = find_template) ? @template.identifier : @path)
9
+ if partial.match(/\.rhtml$|\.erb$|\.haml$|\.html$|\.htm$/)
10
+ start_explanation = "\n<!-- BEGIN #{partial} -->\n".html_safe
11
+ end_explanation = "\n<!-- END #{partial} -->\n".html_safe
12
+ (start_explanation + _render_original().to_s + end_explanation)
13
+ else
14
+ _render_original()
15
+ end
16
+ end
17
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: noisy_partials_for_rails_3
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Gwyn Morfey
14
+ - George Shaw
15
+ - masukomi
16
+ autorequire:
17
+ bindir: bin
18
+ cert_chain: []
19
+
20
+ date: 2013-02-08 00:00:00 Z
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ name: rails
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ hash: 7
31
+ segments:
32
+ - 3
33
+ - 0
34
+ - 0
35
+ version: 3.0.0
36
+ type: :runtime
37
+ version_requirements: *id001
38
+ description: |
39
+ Limited to files ending with .html,.haml,.erb, and .rhtml
40
+ and Rails 3.0.x ONLY.
41
+ See https://github.com/gwshaw/noisy_partials for a 3.1 compatibile version
42
+
43
+ email:
44
+ - masukomi@masukomi.org
45
+ executables: []
46
+
47
+ extensions: []
48
+
49
+ extra_rdoc_files: []
50
+
51
+ files:
52
+ - lib/noisy_partials_for_rails_3.rb
53
+ homepage: https://github.com/masukomi/noisy_partials
54
+ licenses: []
55
+
56
+ post_install_message:
57
+ rdoc_options: []
58
+
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ hash: 3
67
+ segments:
68
+ - 0
69
+ version: "0"
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 3
76
+ segments:
77
+ - 0
78
+ version: "0"
79
+ requirements: []
80
+
81
+ rubyforge_project:
82
+ rubygems_version: 1.8.24
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: Inserts name of partial in HTML comment in view.
86
+ test_files: []
87
+
88
+ has_rdoc: