cyborg 0.4.7 → 0.4.8

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: fcb6cfc1ed5a818503a94a5b7fef6fb0ad4486a7
4
- data.tar.gz: c8d676709ec57add85191063867c6032b1594f92
3
+ metadata.gz: 54dace5b539a755b856878c78baecbd584bb64ac
4
+ data.tar.gz: d60327a8b66ddcebf668d8d9d3186768b1101147
5
5
  SHA512:
6
- metadata.gz: 02844216991140690fb61a15488de0486ea50e48991fd0c1b4f118e6c494ff57c692e5663a2dcafeea730daf56385c748a7afa0c32f2e88c5bc3a9c6fceeb5c1
7
- data.tar.gz: ec49d9b1570cc577410e80068987476aef18907c1397aca573a7e768cafeb8eded653b35ee4333b4583625e56e19f3a481d8213fda1a56e3044dd1ae398f9eeb
6
+ metadata.gz: f8139bbaf9868ad6b341f137e5f62f591aa70710ec8984dfdcc68644029eff3db3677efb3a408e84e7f792d560e1233c2e3367cf3b2439f9921e357102eb0465
7
+ data.tar.gz: de6b34d5ea240c428da5c8b73ff9eeb50aa25f42b5c89e413dd51d463858654bf14a2eef0c33740d941b39ba85f9dbda2d8bcd060ff3456f376e735581c10ba3
@@ -10,16 +10,11 @@ require "cyborg/assets"
10
10
  module Cyborg
11
11
  extend self
12
12
  attr_accessor :plugin
13
- autoload :Application, "cyborg/middleware"
14
13
 
15
14
  def production?
16
15
  ENV['CI'] || ENV['RAILS_ENV'] == 'production' || Command.production?
17
16
  end
18
17
 
19
- def gzip_assets?
20
- production? && plugin.gzip_in_production?
21
- end
22
-
23
18
  def plugin
24
19
  @plugin
25
20
  end
@@ -11,9 +11,7 @@ module Cyborg
11
11
  tags = ''
12
12
 
13
13
  stylesheet_url(args).each do |url|
14
- tag = stylesheet_link_tag url, options
15
- tag = tag.gsub(/\.css/i, ".css.gz") if request.accept_encoding =~ /gzip/i && Cyborg.gzip_assets?
16
- tags += tag
14
+ tags += stylesheet_link_tag url, options
17
15
  end
18
16
 
19
17
  tags.html_safe
@@ -25,9 +23,7 @@ module Cyborg
25
23
 
26
24
  puts "searching for: #{javascript_url(args)}"
27
25
  javascript_url(args).each do |url|
28
- tag = javascript_include_tag url, options
29
- tag = tag.gsub(/\.js/i, ".js.gz") if request.accept_encoding =~ /gzip/i && Cyborg.gzip_assets?
30
- tags += tag
26
+ tags += javascript_include_tag url, options
31
27
  end
32
28
 
33
29
  tags.html_safe
@@ -36,6 +36,7 @@ module Cyborg
36
36
 
37
37
  initializer "#{name}.static_assets" do |app|
38
38
  app.middleware.insert_before(::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public")
39
+ app.middleware.insert_before ::ActionDispatch::Static, Rack::Deflater
39
40
  end
40
41
  end)
41
42
  end
@@ -89,7 +90,6 @@ module Cyborg
89
90
  root: @gem.full_gem_path,
90
91
  version: @gem.version.to_s,
91
92
  gem_name: @gem.name,
92
- gzip_in_production: true,
93
93
  paths: {
94
94
  stylesheets: "app/assets/stylesheets/#{name}",
95
95
  javascripts: "app/assets/javascripts/#{name}",
@@ -102,10 +102,6 @@ module Cyborg
102
102
  end
103
103
  end
104
104
 
105
- def gzip_in_production?
106
- @gzip_in_production
107
- end
108
-
109
105
  def expand_asset_paths
110
106
  @paths.each do |type, path|
111
107
  @paths[type] = File.join(root, path)
@@ -1,3 +1,3 @@
1
1
  module Cyborg
2
- VERSION = "0.4.7"
2
+ VERSION = "0.4.8"
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.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-19 00:00:00.000000000 Z
11
+ date: 2016-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -195,7 +195,6 @@ files:
195
195
  - lib/cyborg/command/scaffold.rb
196
196
  - lib/cyborg/helpers/asset_helpers.rb
197
197
  - lib/cyborg/helpers/layout_helpers.rb
198
- - lib/cyborg/middleware.rb
199
198
  - lib/cyborg/plugin.rb
200
199
  - lib/cyborg/plugin/assets/asset.rb
201
200
  - lib/cyborg/plugin/assets/javascripts.rb
@@ -1,18 +0,0 @@
1
- require 'rack/cors'
2
-
3
- module Cyborg
4
- class Application < Rails::Application
5
- config.middleware.insert_before ActionDispatch::Static, Rack::Deflater
6
-
7
- config.middleware.insert_before 0, "Rack::Cors", :debug => true, :logger => (-> { Rails.logger }) do
8
- allow do
9
- origins "*"
10
- resource "*", {
11
- :headers => :any,
12
- :expose => ["Location"],
13
- :methods => [:get, :post, :put, :patch, :delete, :options]
14
- }
15
- end
16
- end
17
- end
18
- end