view_inspect 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/view_inspect/handlers/slim.rb +27 -0
- data/lib/view_inspect/server_side_template.rb +2 -0
- data/lib/view_inspect/version.rb +1 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NzFhMjNlYjZlOTIzODk4Y2JlYWE1NmVmYWE2NDBkYmIzMTJjNTEwMg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZGQ2MzZlNGQ2ZTA0YWM4NzNkZDAwMDVhYjM1ZjFmZTBlMWNhMjYxOA==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NWI3M2JkMTA2YTdiYzIwMjUzYzBhM2VmMmNhYmQ3MzUzMjE3ZjIwNjkyN2Ey
|
10
|
+
M2U1OTdjMzMwMjIwNmVhZTY5NTJiMGExZTFkY2E1NGRkMzQzNmQwMDk2MTFh
|
11
|
+
Mzc4OWIzN2ZmNDcxZjY2NjkzNjliOWQwZDc4ZmFjMDhiODY3Nzg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
YTQ1NmUxOWM1YmQxODY4ZDcyNDkzOGY4NTZhMGIxOWEyY2Q5OWIxMmM5M2Ux
|
14
|
+
ZGM5YmQyMTExNzg3ZWE1NDcxMzViYWVmMmIwZGU1ZGEzZmMyNTBiN2E3OTU3
|
15
|
+
YWM5NzEzZTM5Y2EzNmEwNTdlMTEyYjAzNmEzYWNjMWMwODc0M2Q=
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module ViewInspect
|
2
|
+
module Handlers
|
3
|
+
module Slim
|
4
|
+
|
5
|
+
def self.augment_source
|
6
|
+
return unless slim_installed?
|
7
|
+
|
8
|
+
::Slim::Parser.class_eval do
|
9
|
+
alias_method :orig_parse_attributes, :parse_attributes
|
10
|
+
|
11
|
+
def parse_attributes(attributes)
|
12
|
+
orig_parse_attributes(attributes)
|
13
|
+
file_line = [@options[:file], @lineno].join(":")
|
14
|
+
attribute = [:html, :attr, "data-orig-file-line", [:escape, true, [:slim, :interpolate, file_line]]]
|
15
|
+
attributes << attribute
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.slim_installed?
|
21
|
+
defined? ::Slim::Parser
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
@@ -1,11 +1,13 @@
|
|
1
1
|
require 'view_inspect/handlers/erb'
|
2
2
|
require 'view_inspect/handlers/haml'
|
3
|
+
require 'view_inspect/handlers/slim'
|
3
4
|
|
4
5
|
module ViewInspect
|
5
6
|
module ServerSideTemplate
|
6
7
|
|
7
8
|
def self.handle
|
8
9
|
Handlers::Haml.augment_source
|
10
|
+
Handlers::Slim.augment_source
|
9
11
|
|
10
12
|
::ActionView::Template.class_eval do
|
11
13
|
alias_method :orig_initialize, :initialize
|
data/lib/view_inspect/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_inspect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reginald Tan
|
@@ -14,14 +14,14 @@ dependencies:
|
|
14
14
|
name: nokogiri
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - '>='
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - '>='
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
description: Shows you the source location of a server-side or client-side rendered
|
@@ -46,6 +46,7 @@ files:
|
|
46
46
|
- lib/view_inspect/handlers/handlebars.rb
|
47
47
|
- lib/view_inspect/handlers/html_template.rb
|
48
48
|
- lib/view_inspect/handlers/javascript_handler.js
|
49
|
+
- lib/view_inspect/handlers/slim.rb
|
49
50
|
- lib/view_inspect/rails/middleware.rb
|
50
51
|
- lib/view_inspect/rails/railtie.rb
|
51
52
|
- lib/view_inspect/server_side_template.rb
|
@@ -63,19 +64,20 @@ require_paths:
|
|
63
64
|
- lib
|
64
65
|
required_ruby_version: !ruby/object:Gem::Requirement
|
65
66
|
requirements:
|
66
|
-
- - '>='
|
67
|
+
- - ! '>='
|
67
68
|
- !ruby/object:Gem::Version
|
68
69
|
version: '0'
|
69
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
71
|
requirements:
|
71
|
-
- - '>='
|
72
|
+
- - ! '>='
|
72
73
|
- !ruby/object:Gem::Version
|
73
74
|
version: 1.9.3
|
74
75
|
requirements: []
|
75
76
|
rubyforge_project:
|
76
|
-
rubygems_version: 2.
|
77
|
+
rubygems_version: 2.1.10
|
77
78
|
signing_key:
|
78
79
|
specification_version: 4
|
79
80
|
summary: Shows you the source location of a server-side or client-side rendered DOM
|
80
81
|
element
|
81
82
|
test_files: []
|
83
|
+
has_rdoc:
|