view_inspect 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzFhMjNlYjZlOTIzODk4Y2JlYWE1NmVmYWE2NDBkYmIzMTJjNTEwMg==
4
+ M2Q3MjU0ZjEzNWIzYzkwYmJjZTk1NWMzYTA1NGExYzJhMzcxOGU0Ng==
5
5
  data.tar.gz: !binary |-
6
- ZGQ2MzZlNGQ2ZTA0YWM4NzNkZDAwMDVhYjM1ZjFmZTBlMWNhMjYxOA==
6
+ MWQxODEyZDc3ZjNiNWJiNWFkNWJiYmVkMzVhM2E2MGY1NDQyOTE5Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWI3M2JkMTA2YTdiYzIwMjUzYzBhM2VmMmNhYmQ3MzUzMjE3ZjIwNjkyN2Ey
10
- M2U1OTdjMzMwMjIwNmVhZTY5NTJiMGExZTFkY2E1NGRkMzQzNmQwMDk2MTFh
11
- Mzc4OWIzN2ZmNDcxZjY2NjkzNjliOWQwZDc4ZmFjMDhiODY3Nzg=
9
+ OTc4ZTE5OTcwNmU4ZTliMjdiOTA5ZTQ0ZjcwMzM5NzllMDc1ZGI2YjllMDk0
10
+ YzhlMGFjMjI3MjkwMWY0ODgzNmI4N2EyY2YyZDk4YTM2NmUwNzc2YWIxMmYy
11
+ MjllODE3NzNmODdkNmI3ZDIwN2Y1ZTBiNTNjOTVlYjEzN2I2OTg=
12
12
  data.tar.gz: !binary |-
13
- YTQ1NmUxOWM1YmQxODY4ZDcyNDkzOGY4NTZhMGIxOWEyY2Q5OWIxMmM5M2Ux
14
- ZGM5YmQyMTExNzg3ZWE1NDcxMzViYWVmMmIwZGU1ZGEzZmMyNTBiN2E3OTU3
15
- YWM5NzEzZTM5Y2EzNmEwNTdlMTEyYjAzNmEzYWNjMWMwODc0M2Q=
13
+ MTBkNjNjOTg4OGQ3ZTdlMDMwZTY4ZjlmY2QxY2IwZDE4YjgyYjExODYwYWMx
14
+ YzkxOWY3YjJkMDdlMjU2MWVhMTk2NWFhMWJkMzUyZWU1NDY0NTZlNDYzZWQw
15
+ OTZmY2ZjZjIwMWM4NmFlYzViYjNiMWE5NmUzODFmNDMxZWIwOTA=
data/README.markdown CHANGED
@@ -5,16 +5,17 @@ View Inspect tells you which server-side or client-side template is responsible
5
5
 
6
6
  Source location is added by first stubbing out all template specific expressions (i.e. `<% %>` for erb). Nokogiri parses the resulting valid HTML fragment and adds file:line information to each DOM node. After which stubs are replaced back with original template expressions.
7
7
 
8
- Screenshot
8
+ Demo
9
9
  ----
10
-
11
- [See screenshot](http://i.imgur.com/mD7sQ2m.png)
10
+ - [Diaspora: Haml + Backbone.js](https://i.imgur.com/bhK6lap.png)
11
+ - [Discourse: ERB + Ember.js + Handlebars](http://i.imgur.com/mD7sQ2m.png)
12
12
 
13
13
  Support
14
14
  ----
15
15
  | Template | Required Library |
16
16
  | ----------------------- | ---------------------- |
17
17
  | Haml | haml |
18
+ | Slim | slim |
18
19
  | ERB | any erb implementation |
19
20
  | Handlebars | ember-rails |
20
21
  | EJS | sprockets |
@@ -28,7 +29,10 @@ Installation
28
29
  gem "view_inspect"
29
30
  end
30
31
 
31
- ViewInspect is enabled by default. To disable it, add this line on config/environments/development.rb
32
+ Warning
33
+ ----
34
+
35
+ By default, this is only enabled for development to avoid exposing source code filepath information publicly. If you want to disable it in development (i.e you want to benchmark/profile your app), add this line on config/environments/development.rb
32
36
 
33
37
  ViewInspect.disable = true
34
38
 
@@ -63,12 +67,6 @@ Also, depending which library you're using, you may need to specify external lib
63
67
  The reason why you may need to do this is because of the way we track the javascript file:line. We intercept the native DOM insertion methods such as appendChild, insertBefore, or replaceChild, look at the stacktrace, and then go through it to find the most recent caller which corresponds to our javascript code.
64
68
 
65
69
 
66
- Warning
67
- ----
68
-
69
- By default, this is only enabled for development to avoid exposing source code filepath information publicly.
70
-
71
-
72
70
 
73
71
  Copyright
74
72
  ----
@@ -24,6 +24,7 @@ module ViewInspect
24
24
  def self.class_handler_map
25
25
  hash = {}
26
26
  hash[::Ember::Handlebars::Template] = Handlers::Handlebars if defined? ::Ember::Handlebars::Template
27
+ hash[::HandlebarsAssets::TiltHandlebars] = Handlers::Handlebars if defined? ::HandlebarsAssets::TiltHandlebars
27
28
  hash[::Sprockets::EjsTemplate] = Handlers::EJS if defined? ::Sprockets::EjsTemplate
28
29
  hash[::Sprockets::EcoTemplate] = Handlers::Eco if defined? ::Sprockets::EcoTemplate
29
30
  hash
@@ -10,7 +10,7 @@ module ViewInspect
10
10
  def call(env)
11
11
  status, headers, response = @app.call(env)
12
12
 
13
- if headers["Content-Type"] =~ HTML_CONTENT_TYPE_REGEXP && response.body.to_s =~ HEAD_REGEXP
13
+ if headers["Content-Type"] =~ HTML_CONTENT_TYPE_REGEXP && response.each.to_a.join("") =~ HEAD_REGEXP
14
14
  body = insert_view_inspect_script(response.body)
15
15
  headers["Content-Length"] = body.length.to_s
16
16
  response = [body]
@@ -1,3 +1,3 @@
1
1
  module ViewInspect
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
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.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reginald Tan