xray-rails 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +9 -5
- data/lib/xray/config.rb +1 -3
- data/lib/xray/engine.rb +1 -1
- data/lib/xray/middleware.rb +1 -1
- data/lib/xray/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cfefe1d2877a0ed54779c7240889cec50071a7caca2ade5fd8d10ad3b80f84df
|
4
|
+
data.tar.gz: 92a10923f98a53acd26be902aff8f70c018e1901f566bef5132593b0354b0e87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dcf68a32be941a2ca0a60ca46341fa07e83114159a22a1dd11b9253b6cff7cd6138bb6cdb55b177b964994f3380812ff4588aabbbdaf158b557fa9752dc5842
|
7
|
+
data.tar.gz: 18487272734c55073727b04753219a5720888b6dd3e1ba660b550f38443d249aa1b94f2faba0ac43bfeeef8040d90c7e6ee8118a89f314dbccf501df5323b7c0
|
data/README.md
CHANGED
@@ -8,9 +8,9 @@ Xray-rails
|
|
8
8
|
|
9
9
|
The dev tools available to web developers in modern browsers are great. Many of us can't remember what life was like before "Inspect Element". But what we see in the compiled output sent to our browser is often the wrong level of detail - what about visualizing the higher level components of your UI? Controllers, view templates, partials, JS templates, etc.
|
10
10
|
|
11
|
-
Xray is the missing link between the browser and your app code. Press **cmd+shift+x** (Mac) or **ctrl+shift+x** to reveal an overlay of the files that rendered your UI, and click anything to open the file in your editor.
|
11
|
+
Xray is the missing link between the browser and your app code. Press **cmd+shift+x** (Mac) or **ctrl+shift+x** to reveal an overlay of the files that rendered your UI, and click anything to open the file in your editor.
|
12
12
|
|
13
|
-
![Screenshot](
|
13
|
+
![Screenshot](example/screenshot.png)
|
14
14
|
|
15
15
|
## Current Support
|
16
16
|
|
@@ -77,14 +77,18 @@ For something more complex, use the `$file` placeholder.
|
|
77
77
|
* A middleware inserts `xray.js`, `xray.css`, and the Xray bar into all successful HTML response bodies.
|
78
78
|
* When the overlay is shown, `xray.js` examines the inserted filepath info to build the overlay.
|
79
79
|
|
80
|
-
## Disabling Xray
|
80
|
+
## Disabling Xray
|
81
81
|
|
82
|
-
Xray augments HTML templates by wrapping their contents with HTML comments. For some environments such as [Angular.js](http://angularjs.org/), this can cause Angular templates to stop working because Angular expects only one root node in the template HTML. You can pass in the option `xray: false` to any render statements to ensure Xray does not augment that
|
82
|
+
Xray augments HTML templates by wrapping their contents with HTML comments. For some environments such as [Angular.js](http://angularjs.org/), this can cause Angular templates to stop working because Angular expects only one root node in the template HTML. You can pass in the option `xray: false` to any partial render statements to ensure Xray does not augment that partial. Example:
|
83
83
|
|
84
84
|
```ruby
|
85
|
-
render '
|
85
|
+
render partial: 'my_partial', locals: { xray: false }
|
86
86
|
```
|
87
87
|
|
88
|
+
Note that this disables Xray's HTML comment wrappers for `my_partial`, but not any sub-partials rendered within that template, if any. You must pass `xray: false` to each `render` call where you want Xray disabled.
|
89
|
+
|
90
|
+
Currently there is no way to disable Xray entirely for a given request. If this feature is important to you, please leave a comment on [issue #75](https://github.com/brentd/xray-rails/issues/75). PRs are appreciated!
|
91
|
+
|
88
92
|
## Contributing
|
89
93
|
|
90
94
|
If you have an idea, open an issue and let's talk about it, or fork away and send a pull request.
|
data/lib/xray/config.rb
CHANGED
@@ -5,8 +5,6 @@ module Xray
|
|
5
5
|
end
|
6
6
|
|
7
7
|
class Config
|
8
|
-
attr_accessor :editor
|
9
|
-
|
10
8
|
CONFIG_FILE = ".xrayconfig"
|
11
9
|
|
12
10
|
def default_editor
|
@@ -34,7 +32,7 @@ module Xray
|
|
34
32
|
end
|
35
33
|
|
36
34
|
def config_file
|
37
|
-
if File.
|
35
|
+
if File.exist?("#{Dir.pwd}/#{CONFIG_FILE}")
|
38
36
|
"#{Dir.pwd}/#{CONFIG_FILE}"
|
39
37
|
else
|
40
38
|
"#{Dir.home}/#{CONFIG_FILE}"
|
data/lib/xray/engine.rb
CHANGED
@@ -33,7 +33,7 @@ module Xray
|
|
33
33
|
|
34
34
|
options = args.last.kind_of?(Hash) ? args.last : {}
|
35
35
|
|
36
|
-
if suitable_template && !(options.has_key?(:xray) && (options[:xray] == false))
|
36
|
+
if source && suitable_template && !(options.has_key?(:xray) && (options[:xray] == false))
|
37
37
|
Xray.augment_template(source, path)
|
38
38
|
else
|
39
39
|
source
|
data/lib/xray/middleware.rb
CHANGED
@@ -16,7 +16,7 @@ module Xray
|
|
16
16
|
# Request for opening a file path.
|
17
17
|
if env['PATH_INFO'] == OPEN_PATH
|
18
18
|
req, res = Rack::Request.new(env), Rack::Response.new
|
19
|
-
out,
|
19
|
+
out, _err, status = Xray.open_file(req.GET['path'])
|
20
20
|
if status.success?
|
21
21
|
res.status = 200
|
22
22
|
else
|
data/lib/xray/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xray-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brent Dillingham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -133,8 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
|
-
|
137
|
-
rubygems_version: 2.6.12
|
136
|
+
rubygems_version: 3.0.3
|
138
137
|
signing_key:
|
139
138
|
specification_version: 4
|
140
139
|
summary: Reveal the structure of your UI
|