xray-rails 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -80,6 +80,14 @@ Or for something more complex, use the `$file` placeholder.
80
80
  * When the overlay is shown, `xray.js` examines the file path information inserted during asset compilation.
81
81
  * Another middleware piggybacks the Rails server to respond to requests to open file paths with the user's desired editor.
82
82
 
83
+ ## Disabling Xray in particular templates
84
+
85
+ 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 template. Example:
86
+
87
+ ```ruby
88
+ render 'show', xray: false
89
+ ```
90
+
83
91
  ## Contributing
84
92
 
85
93
  If you have an idea, open an issue and let's talk about it, or fork away and send a pull request.
@@ -7,7 +7,7 @@
7
7
  <%= Xray.request_info[:controller][:name] %><span class="xray-bar-controller-action">#<%= Xray.request_info[:controller][:action] %></span>
8
8
  </span>
9
9
  <% end %>
10
- <% if Xray.request_info[:view] && Xray.request_info[:controller][:name] != "Rails::InfoController" %>
10
+ <% if Xray.request_info[:view] && Xray.request_info.fetch(:controller, {})[:name] != "Rails::InfoController" %>
11
11
  <% layout_path = lookup_context.find(Xray.request_info[:view][:layout]).identifier %>
12
12
  <span class="xray-bar-btn xray-bar-layout xray-icon-columns" data-path="<%= layout_path %>">
13
13
  <b></b>
data/lib/xray/engine.rb CHANGED
@@ -28,7 +28,9 @@ module Xray
28
28
  def render_with_xray(*args, &block)
29
29
  path = identifier
30
30
  source = render_without_xray(*args, &block)
31
- if path =~ /\.(html|slim|haml)(\.|$)/ && !path.match(/\.(js|json)\./) && !path.include?('_xray_bar')
31
+ suitable_template = path =~ /\.(html|slim|haml)(\.|$)/ && !path.match(/\.(js|json)\./) && !path.include?('_xray_bar')
32
+ options = args.last.kind_of?(Hash) ? args.last : {}
33
+ if suitable_template && !(options.has_key?(:xray) && (options[:xray] == false))
32
34
  Xray.augment_template(source, path)
33
35
  else
34
36
  source
data/lib/xray/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Xray
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xray-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-18 00:00:00.000000000 Z
12
+ date: 2014-03-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -205,7 +205,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
205
205
  version: '0'
206
206
  segments:
207
207
  - 0
208
- hash: 3612644589838496871
208
+ hash: -1659673758590935188
209
209
  required_rubygems_version: !ruby/object:Gem::Requirement
210
210
  none: false
211
211
  requirements:
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  segments:
216
216
  - 0
217
- hash: 3612644589838496871
217
+ hash: -1659673758590935188
218
218
  requirements: []
219
219
  rubyforge_project:
220
220
  rubygems_version: 1.8.23