classy_assets 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26174ebc523413bc8b6a44a4bf0cbc678d268875
4
- data.tar.gz: c51ecdc69a290e271c5302c0bf2d36b0a9c3c667
3
+ metadata.gz: a7b490bf26a7551e8d77d667fb007505bfb17422
4
+ data.tar.gz: d2b4b3dec4a2ee72b919799c5f96247bb0c3089f
5
5
  SHA512:
6
- metadata.gz: 44d6352fd0cd68dd6fce74e9485005c77a84a2c74a2fd3819a80abd888de4d95d01ae182f76ab0f54961d797f736fedb563f2f46623b6331e783044ae448abea
7
- data.tar.gz: 639ee59717f6e78c4ecae87dcf03f1a8d1bd03111aed6097ad0fb5b8c233ea15447d999afc08021e20c00989263bbd55a21ab07882b4df4aeb20fc106ad428f6
6
+ metadata.gz: 4b1310675cb0784d599f2735ee40ef09861d103faee20bb731e1ed8f6dcf0c1da506eb92e14bcf1e5ddc9ab70c19edf00e4cc68f8d8c53bc7550ca35a3741ced
7
+ data.tar.gz: ca1db9df2995163d5abb05f83a753058ba536ab9f55aef62d615d2c419da86e775e8e192fa4d01b5e74b7da8cb20bf98d90d308c1e44b41b974a2d9908359c02
@@ -1,3 +1,3 @@
1
1
  module ClassyAssets
2
- VERSION = "0.11.0"
2
+ VERSION = "0.11.1"
3
3
  end
@@ -14,18 +14,15 @@ module Rack
14
14
 
15
15
  def call(env)
16
16
  if %w(GET HEAD).include?(env['REQUEST_METHOD']) and env['PATH_INFO'].start_with?("/#{::ClassyAssets.config.asset_prefix}")
17
- puts "ClassyAssets: GET or HEAD request"
18
17
  request = Rack::Request.new(env)
19
18
  encoding = Rack::Utils.select_best_encoding(%w(gzip identity), request.accept_encoding)
20
19
  if encoding == 'gzip'
21
- puts "ClassyAssets: encoding == gzip"
22
20
  return serve_gzipped_asset(env)
23
21
  else
24
- puts "ClassyAssets: encoding != gzip"
25
22
  return serve_asset(env)
26
23
  end
27
24
  end
28
-
25
+
29
26
  status, headers, body = @app.call(env)
30
27
  body.close if body.respond_to?(:close)
31
28
  [status, headers, body]
@@ -41,7 +38,6 @@ module Rack
41
38
  def serve_gzipped_asset(env)
42
39
  compressed_path = env['PATH_INFO'] + '.gz'
43
40
  if asset_path_exists?(compressed_path)
44
- puts "ClassyAssets: gzip asset path exists"
45
41
  env["PATH_INFO"] = compressed_path
46
42
  status, headers, body = @file_server.call(env)
47
43
  path = env["PATH_INFO"] = env["PATH_INFO"].chomp('.gz')
@@ -61,9 +57,7 @@ module Rack
61
57
  headers['Cache-Control'] = 'no-transform'
62
58
  end
63
59
  else
64
- puts "ClassyAssets: gzip asset path not found"
65
- env["PATH_INFO"].gsub!("/#{::ClassyAssets.config.asset_prefix}", '')
66
- status, headers, body = ::ClassyAssets.sprockets.call(env)
60
+ status, headers, body = serve_sprockets_asset(env)
67
61
  end
68
62
 
69
63
  [status, headers, body]
@@ -71,14 +65,17 @@ module Rack
71
65
 
72
66
  def serve_asset(env)
73
67
  if asset_path_exists?(env['PATH_INFO'])
74
- puts "ClassyAssets: asset path exists"
75
68
  status, headers, body = @file_server.call(env)
76
69
  else
77
- puts "ClassyAssets: asset path not found"
78
- status, headers, body = ::ClassyAssets.sprockets.call(env)
70
+ status, headers, body = serve_sprockets_asset(env)
79
71
  end
80
72
 
81
73
  [status, headers, body]
82
74
  end
75
+
76
+ def serve_sprockets_asset(env)
77
+ env["PATH_INFO"].gsub!("/#{::ClassyAssets.config.asset_prefix}", '')
78
+ ::ClassyAssets.sprockets.call(env)
79
+ end
83
80
  end
84
81
  end
@@ -18,7 +18,6 @@ describe Rack::ClassyAssets do
18
18
  config.asset_debug = false
19
19
  config.asset_digest = false
20
20
  config.asset_host = nil
21
- config.asset_paths = Dir.glob(File.join(config.asset_root, config.asset_prefix, '*'))
22
21
  end
23
22
  end
24
23
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classy_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - StyleSeek Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-02 00:00:00.000000000 Z
11
+ date: 2013-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets