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 +4 -4
- data/README.md +6 -4
- data/lib/view_source_map.rb +1 -1
- data/lib/view_source_map/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 87a4a1157c2361e649f3ad04bcf0cf8f7637dc66
|
|
4
|
+
data.tar.gz: 11dcc94fe8443910f63af372890ddbe4c4859b18
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ebc9d2eee67f0ff07f6817bb7020813ea984268fa9b33714bd2f9ebd7a01b10fde0c4a88fbb42b91172d0ad261540227e076e5bd021539d889b5bb3402205446
|
|
7
|
+
data.tar.gz: 7674f9c5911706fe52dcd99b0737d812d61d1be6facd4ef068ab0e8e6e99ae8dc1268c6e42efa5ae6feb59bd11827a15ebd15c9b2be0a066865a6cd944d0d410
|
data/README.md
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
# ViewSourceMap
|
|
2
|
+
|
|
3
|
+
[](https://rubygems.org/gems/view_source_map)
|
|
4
|
+
[](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
|
-

|
|
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
|
|
data/lib/view_source_map.rb
CHANGED
|
@@ -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
|
|
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
|
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.
|
|
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:
|
|
11
|
+
date: 2017-03-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|