rails_view_annotator 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 040f719f31036efb1dcca71b7da322bf85cbd58f
4
+ data.tar.gz: f1f41ea167d57df373b5396383f42958bb95b6e0
5
+ SHA512:
6
+ metadata.gz: 02f6f1f9b3508182f08918338c10e0f05485254dafe6e0848efa278c84bffbfb5690f80dec334bae79cc34280d42e434d35fd8a44ecd3aebd7659eb35d944d49
7
+ data.tar.gz: c3f7d2b9068ffabe395040f932a45467d305d9476f7b4c70c8416df1b9d27e1f139e2efcb09d847e3f36e067a467579a7202a3db0f80e84ffc3114ee56bd76a7
data/Readme.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- The Rails View Annotator simply wraps the rendering of Rails partials with html comments indicating the disk location of the rendered partial.
5
+ The Rails View Annotator wraps the rendering of Rails partials with html comments indicating the disk location of the rendered partial.
6
6
 
7
7
  ## Usage
8
8
 
9
9
  Simply add the gem to your Gemfile's development block.
10
10
 
11
11
  ````ruby
12
- group :development
12
+ group :development do
13
13
  gem 'rails_view_annotator'
14
14
  end
15
15
  ````
@@ -1,7 +1,4 @@
1
1
  module RailsViewAnnotator
2
- class ContextError < StandardError
3
- end
4
-
5
2
  def self.augment_partial_renderer klass
6
3
  render = klass.instance_method :render
7
4
  klass.send(:define_method, :render) do |*args|
@@ -16,7 +13,11 @@ module RailsViewAnnotator
16
13
  descriptor = "#{short_identifier} (from #{called_from})"
17
14
 
18
15
  if not inner.blank?
19
- "<!-- begin: #{descriptor} -->\n#{inner}<!-- end: #{descriptor} -->".html_safe
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
20
+ end
20
21
  end
21
22
  end
22
23
  klass.send(:include, InstanceMethods)
@@ -1,3 +1,3 @@
1
1
  module RailsViewAnnotator
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,15 +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.7
5
- prerelease:
4
+ version: 0.0.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Duncan Beevers
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-05-30 00:00:00.000000000 Z
11
+ date: 2014-01-09 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: The Rails View Annotator makes it easy to find out which partial generated
15
14
  which output
@@ -27,26 +26,25 @@ files:
27
26
  - rails_view_annotator.gemspec
28
27
  homepage: https://github.com/duncanbeevers/rails_view_annotator
29
28
  licenses: []
29
+ metadata: {}
30
30
  post_install_message:
31
31
  rdoc_options: []
32
32
  require_paths:
33
33
  - lib
34
34
  required_ruby_version: !ruby/object:Gem::Requirement
35
- none: false
36
35
  requirements:
37
- - - ! '>='
36
+ - - '>='
38
37
  - !ruby/object:Gem::Version
39
38
  version: '0'
40
39
  required_rubygems_version: !ruby/object:Gem::Requirement
41
- none: false
42
40
  requirements:
43
- - - ! '>='
41
+ - - '>='
44
42
  - !ruby/object:Gem::Version
45
43
  version: '0'
46
44
  requirements: []
47
45
  rubyforge_project: rails_view_annotator
48
- rubygems_version: 1.8.17
46
+ rubygems_version: 2.1.8
49
47
  signing_key:
50
- specification_version: 3
48
+ specification_version: 4
51
49
  summary: Annotate Rails partial output with source path information
52
50
  test_files: []