rails_view_annotator 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 040f719f31036efb1dcca71b7da322bf85cbd58f
4
- data.tar.gz: f1f41ea167d57df373b5396383f42958bb95b6e0
3
+ metadata.gz: 7f291edf8f589c42e16efbea3b22d295b02b1b11
4
+ data.tar.gz: 18de8386718f85f8a8af1c632a0f9c9253374bfc
5
5
  SHA512:
6
- metadata.gz: 02f6f1f9b3508182f08918338c10e0f05485254dafe6e0848efa278c84bffbfb5690f80dec334bae79cc34280d42e434d35fd8a44ecd3aebd7659eb35d944d49
7
- data.tar.gz: c3f7d2b9068ffabe395040f932a45467d305d9476f7b4c70c8416df1b9d27e1f139e2efcb09d847e3f36e067a467579a7202a3db0f80e84ffc3114ee56bd76a7
6
+ metadata.gz: fa83d5e4b545a7f6edfcf80aeb0030605cc223eab67df4ff4396bbb3b36389bbb52f42153fce412d5ca766999523e13c11e564d859e93078281e780bbd15e7a2
7
+ data.tar.gz: bfe2799a7b1e2aa466cf83c5c2df352d5e685f7847db434d61f799fedd7d98108010ea68838ddb3d3f2d525eb5161241e04aa47f35ef18933107325073b83fe1
@@ -13,11 +13,16 @@ module RailsViewAnnotator
13
13
  descriptor = "#{short_identifier} (from #{called_from})"
14
14
 
15
15
  if not inner.blank?
16
- if args[1].has_key?(:formats) && args[1][:formats].include?(:js)
17
- "/* begin: #{descriptor} */\n#{inner}/* end: #{descriptor} */".html_safe
18
- elsif !args[1].has_key?(:formats) || args[1][:formats].include?(:html)
19
- "<!-- begin: #{descriptor} -->\n#{inner}<!-- end: #{descriptor} -->".html_safe
16
+ comment_pattern = "%{partial}"
17
+
18
+ template_formats = Array(args[1][:formats])
19
+ if template_formats.include?(:js)
20
+ comment_pattern = "/* begin: %{comment} */\n#{comment_pattern}/* end: %{comment} */"
21
+ elsif template_formats.empty? || template_formats.include?(:html)
22
+ comment_pattern = "<!-- begin: %{comment} -->\n#{comment_pattern}<!-- end: %{comment} -->"
20
23
  end
24
+
25
+ (comment_pattern % {:partial => inner, :comment => descriptor}).html_safe
21
26
  end
22
27
  end
23
28
  klass.send(:include, InstanceMethods)
@@ -1,3 +1,3 @@
1
1
  module RailsViewAnnotator
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_view_annotator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duncan Beevers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-09 00:00:00.000000000 Z
11
+ date: 2014-01-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: The Rails View Annotator makes it easy to find out which partial generated
14
14
  which output