xray-rails 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@
10
10
  <%= Xray.request_info[:controller][:name] %><span class="xray-bar-controller-action">#<%= Xray.request_info[:controller][:action] %></span>
11
11
  </span>
12
12
  <% end %>
13
- <% if Xray.request_info[:view] %>
13
+ <% if Xray.request_info[:view] && Xray.request_info[:controller][:name] != "Rails::InfoController" %>
14
14
  <% layout_path = lookup_context.find(Xray.request_info[:view][:layout]).identifier %>
15
15
  <span class="xray-bar-btn xray-bar-layout xray-icon-columns" data-path="<%= layout_path %>">
16
16
  <b></b>
@@ -7,6 +7,7 @@ module Xray
7
7
  # xray.js and the xray bar into the app's response bodies.
8
8
  class Engine < ::Rails::Engine
9
9
  initializer "xray.initialize" do |app|
10
+ ensure_asset_pipeline_enabled! app
10
11
  app.middleware.use Xray::Middleware
11
12
 
12
13
  # Register as a Sprockets processor to augment JS files, including
@@ -27,7 +28,7 @@ module Xray
27
28
  def render_with_xray(*args, &block)
28
29
  path = identifier
29
30
  source = render_without_xray(*args, &block)
30
- if path =~ /\.(html|slim|haml)(\.|$)/ && !path.include?('_xray_bar')
31
+ if path =~ /\.(html|slim|haml)(\.|$)/ && !path.match(/\.(js|json)\./) && !path.include?('_xray_bar')
31
32
  Xray.augment_template(source, path)
32
33
  else
33
34
  source
@@ -84,5 +85,13 @@ module Xray
84
85
  end
85
86
  end
86
87
  end
88
+
89
+ def ensure_asset_pipeline_enabled!(app)
90
+ unless app.assets
91
+ raise "xray-rails requires the Rails asset pipeline.
92
+ The asset pipeline is currently disabled in this application.
93
+ Either convert your application to use the asset pipeline, or remove xrail-rails from your Gemfile."
94
+ end
95
+ end
87
96
  end
88
97
  end
@@ -60,7 +60,7 @@ module Xray
60
60
  # <script src="/assets/jquery.js"></script>
61
61
  # <script src="/assets/jquery-min.js"></script>
62
62
  # <script src="/assets/jquery.min.1.9.1.js"></script>
63
- html.sub!(/<script[^>]+#{after_script_name}([-.]{1}[\d\.]+)?([-.]{1}min)?\.js[^>]+><\/script>/) do
63
+ html.sub!(/<script[^>]+\/#{after_script_name}([-.]{1}[\d\.]+)?([-.]{1}min)?\.js[^>]+><\/script>/) do
64
64
  h = ActionController::Base.helpers
65
65
  "#{$~}\n" + h.javascript_include_tag(script_name)
66
66
  end
@@ -1,3 +1,3 @@
1
1
  module Xray
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
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.5
4
+ version: 0.1.6
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-05-08 00:00:00.000000000 Z
12
+ date: 2013-06-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -123,6 +123,22 @@ dependencies:
123
123
  - - ! '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: haml
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
126
142
  - !ruby/object:Gem::Dependency
127
143
  name: eco
128
144
  requirement: !ruby/object:Gem::Requirement