view_source_map 0.1.2 → 0.1.3

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: bccd483f9450b5b1c9efbe152790a8c4bb5cd469
4
- data.tar.gz: 46d8fbd4a7d9c5d29ae713641e7fb5e1f0a06ddd
3
+ metadata.gz: 87a4a1157c2361e649f3ad04bcf0cf8f7637dc66
4
+ data.tar.gz: 11dcc94fe8443910f63af372890ddbe4c4859b18
5
5
  SHA512:
6
- metadata.gz: e265a9cb71b6b5e3d0570aed11700eddb302ab2f4af507de28d5089657456ce95226b790bb66719dc29aaf8c4f8a92ac02c06cc32b53660a2f33bc44ab8becda
7
- data.tar.gz: 41de9cbc55c474d9beeb2752b4e9f15d76f3f1db5238fc85f1cbc4b3c9c79e1990b90263dd4a97aaf41c40c0dc0b5b85ddae0809e72b03df13f78f7f90313e0c
6
+ metadata.gz: ebc9d2eee67f0ff07f6817bb7020813ea984268fa9b33714bd2f9ebd7a01b10fde0c4a88fbb42b91172d0ad261540227e076e5bd021539d889b5bb3402205446
7
+ data.tar.gz: 7674f9c5911706fe52dcd99b0737d812d61d1be6facd4ef068ab0e8e6e99ae8dc1268c6e42efa5ae6feb59bd11827a15ebd15c9b2be0a066865a6cd944d0d410
data/README.md CHANGED
@@ -1,7 +1,12 @@
1
1
  # ViewSourceMap
2
+
3
+ [![Gem](https://img.shields.io/gem/v/view_source_map.svg)](https://rubygems.org/gems/view_source_map)
4
+ [![Build Status](https://travis-ci.org/r7kamura/view_source_map.svg?branch=master)](https://travis-ci.org/r7kamura/view_source_map)
5
+
2
6
  This is a Rails plugin to insert the path name of a rendered partial view as HTML comment in development environment.
3
7
 
4
8
  ## Usage
9
+
5
10
  In your Gemfile
6
11
 
7
12
  ```ruby
@@ -16,11 +21,8 @@ and launch your rails server in development environment:
16
21
  $ rails s
17
22
  ```
18
23
 
19
- then see the source of your page:
20
-
21
- ![](http://dl.dropbox.com/u/5978869/image/20121204_171625.png)
22
-
23
24
  ## Tips
25
+
24
26
  Sometimes this adds too much noise to the html when you're developing.
25
27
  There is a simple way to turn it off.
26
28
 
@@ -40,7 +40,7 @@ module ViewSourceMap
40
40
  content = template.render(view, locals) { |*name| view._layout_for(*name) }
41
41
  return content if ViewSourceMap.force_disabled?(locals)
42
42
 
43
- if @lookup_context.rendered_format == :html and template.class != ActionView::Template::Text
43
+ if @lookup_context.rendered_format == :html && template.class != ActionView::Template::Text && !template.identifier.to_s.empty?
44
44
  path = Pathname.new(template.identifier)
45
45
  name = path.relative_path_from(Rails.root)
46
46
  "<!-- BEGIN #{name} -->\n#{content}<!-- END #{name} -->".html_safe
@@ -1,3 +1,3 @@
1
1
  module ViewSourceMap
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
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.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-05 00:00:00.000000000 Z
11
+ date: 2017-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails