front_end_builds 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6de071745fdf081fe837eb7ae23fffb86ee5425a
4
- data.tar.gz: deaa61179607993853a5a6ae3685c2ba2327e428
3
+ metadata.gz: 2789045f4bc8f29052d63f84186504fc7800dc8c
4
+ data.tar.gz: 8ae5cfc6bac178ec2742dca76b8cbf36e6562143
5
5
  SHA512:
6
- metadata.gz: 847bc4d09ebcf5d2352c5478fb21130834ca6ec4b77d68fa678da377d685a90ba7020622ce28b7d526c3a27368168688e77560bb397c333e755d07521e515a05
7
- data.tar.gz: 0aa86e72cfd9db9f0b92ce5602552315c66b53e784e3fbcf3dc58ef5a37566c0b40d88ab149f62bf605c179826405e19c4b81e663e2d00787f25c6338d97ef9a
6
+ metadata.gz: cc63cf0fd1dbeb4824defe85ce1e202341bdb11ceada8f5b6a9bedad420c63ed1bc1eab4ba90209c3d45f5f71ac5c57945ee36509249fccbfaed26aef8185b0b
7
+ data.tar.gz: 6eec4e3ece21c3db125432d8c1f0c533e45d5966783afd5678a57a54bb25a7ad922c488fd4c01d1c0e5cc367b6999cd0faccdaca9ef67e28cbf118d303d36a66
@@ -1,3 +1,5 @@
1
+ require 'front_end_builds/middleware/admin_assets'
2
+
1
3
  module FrontEndBuilds
2
4
  class Engine < ::Rails::Engine
3
5
  isolate_namespace FrontEndBuilds
@@ -10,7 +12,7 @@ module FrontEndBuilds
10
12
  end
11
13
 
12
14
  initializer "static assets" do |app|
13
- app.middleware.insert_before(::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public")
15
+ app.middleware.use(FrontEndBuilds::Middleware::AdminAssets, "#{root}/public")
14
16
  end
15
17
  end
16
18
  end
@@ -0,0 +1,31 @@
1
+ require 'rack/utils'
2
+ require 'active_support/core_ext/uri'
3
+ require 'action_dispatch/middleware/static'
4
+
5
+ module FrontEndBuilds
6
+ module Middleware
7
+
8
+ class AdminAssets < ::ActionDispatch::Static
9
+ def front_end_build_asset_regex
10
+ @_regex ||= /^\/front_end_builds\/assets\//
11
+ end
12
+
13
+ def requesting_feb_assets?(path)
14
+ path.match(front_end_build_asset_regex)
15
+ end
16
+
17
+ def call(env)
18
+ path = env['PATH_INFO']
19
+
20
+ # Only call Static middleware if we know this is a request for
21
+ # a front end build asset.
22
+ if requesting_feb_assets?(path)
23
+ super
24
+ else
25
+ @app.call(env)
26
+ end
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module FrontEndBuilds
2
- VERSION = "0.0.24"
2
+ VERSION = "0.0.25"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: front_end_builds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Toronto
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-30 00:00:00.000000000 Z
12
+ date: 2015-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3
@@ -138,6 +138,7 @@ files:
138
138
  - lib/front_end_builds.rb
139
139
  - lib/front_end_builds/engine.rb
140
140
  - lib/front_end_builds/ext/routes.rb
141
+ - lib/front_end_builds/middleware/admin_assets.rb
141
142
  - lib/front_end_builds/routing_constraints/html_routing_constraint.rb
142
143
  - lib/front_end_builds/version.rb
143
144
  - lib/tasks/front_end_builds_tasks.rake