cyborg 0.5.16 → 0.5.17

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: 9cf18cb2dd99fd138db54e28a447704d391b196f
4
- data.tar.gz: 14f0aeea0ad8d01517b5f0689943f068a95c23a7
3
+ metadata.gz: d776f9abceda0bd53460b5d13f99ce467a96d0a9
4
+ data.tar.gz: 9bdce401f1c32154bca9180ede6ff74942d7434f
5
5
  SHA512:
6
- metadata.gz: 5204cb4ad3b6a0f5a93c74e8331e5599834fa6b15eb2697af63cf77231ba0c6221567867d2efc2ee9dfea2415c02999043e7d27e1d8d92bcbcabb53601b1a033
7
- data.tar.gz: 93a24cdc1a039496b4f608037e97f1d7a4a89e8749fbee98630442f5854cc3cd2e03d6a98c6d6c4523d3664b19ac6821bd6a08d8bce2c1f5583f5e01a9bbd7cd
6
+ metadata.gz: eb850b40be39bc1e9bfce8a0bcf17672b0706e73fec5c4303cb9f4fc0b0c08c3d8c18c1760995d960e5246fbe0f43fb4abe7d1a34c218e48ed2362677f4288f1
7
+ data.tar.gz: 209b0b53027061bb74ff37bcfe2f96e850fbb44582710d8ef8c6bd5f9a0a4cb1bcadc044ed6e8050761c751081276f610e8d5eb510f59a287a14ea069c5a8082
@@ -16,6 +16,10 @@ module Cyborg
16
16
  ENV['CI'] || ENV['RAILS_ENV'] == 'production' || Command.production?
17
17
  end
18
18
 
19
+ def rails5?
20
+ Gem::Version.new(Rails.version) >= Gem::Version.new('5')
21
+ end
22
+
19
23
  def plugin
20
24
  @plugin
21
25
  end
@@ -1,4 +1,5 @@
1
1
  require 'rack/cors'
2
+ require 'action_dispatch/middleware/static'
2
3
 
3
4
  module Cyborg
4
5
  class Application < Rails::Application
@@ -19,7 +20,7 @@ module Cyborg
19
20
  class StaticAssets
20
21
 
21
22
  # Rails 5 middleware patch
22
- if Gem::Version.new(Rails.version) >= Gem::Version.new('5')
23
+ if Cyborg.rails5?
23
24
 
24
25
  def initialize(app, path, index: 'index', headers: {}, engine_name: nil)
25
26
  @app = app
@@ -37,8 +37,10 @@ module Cyborg
37
37
  require 'cyborg/middleware'
38
38
 
39
39
  initializer "#{name}.static_assets" do |app|
40
- app.middleware.insert_before ::ActionDispatch::Static, Cyborg::StaticAssets, "#{root}/public", engine_name: Cyborg.plugin.name
41
- app.middleware.insert_before ::ActionDispatch::Static, Rack::Deflater
40
+ if !Cyborg.rails5? || app.config.public_file_server.enabled
41
+ app.middleware.insert_after ::ActionDispatch::Static, Cyborg::StaticAssets, "#{root}/public", engine_name: Cyborg.plugin.name
42
+ app.middleware.insert_before ::ActionDispatch::Static, Rack::Deflater
43
+ end
42
44
  end
43
45
  end)
44
46
  end
@@ -1,3 +1,3 @@
1
1
  module Cyborg
2
- VERSION = "0.5.16"
2
+ VERSION = "0.5.17"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyborg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.16
4
+ version: 0.5.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-07 00:00:00.000000000 Z
11
+ date: 2017-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass