rack-pipeline 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack-pipeline/base.rb +1 -0
- data/lib/rack-pipeline/sinatra.rb +6 -4
- data/lib/rack-pipeline/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7655da8b8d058c860f8952d72eb270802ea248f
|
4
|
+
data.tar.gz: b65170c885f0feff182cbbd60797a84a265511c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bfae2e463038c6953805f4fd5b4ae86e9bda65b7c4bef3dba33fbe4ec66aac19051b85945bd60ce3c13dfec2ca1fb3e21678433cb47a538c37c821417ed1f5d
|
7
|
+
data.tar.gz: 9f4b2f11106557b550fa51c6d39acf2bfcb039a5f04a14569d888b4062352f610762d8275b26dbffe5e85a7c831c7fed247021dbcfb931209e6fe88417e25ec6
|
data/lib/rack-pipeline/base.rb
CHANGED
@@ -7,16 +7,18 @@ module RackPipeline
|
|
7
7
|
|
8
8
|
module Helpers
|
9
9
|
def pipeline(pipes = [ :app ], types = [ :css, :js ], opts = {})
|
10
|
+
bust_cache = respond_to?(:settings) && settings.respond_to?(:pipeline) && settings.pipeline[:bust_cache]
|
11
|
+
pipeline_object = env['rack-pipeline']
|
10
12
|
Array(types).map do |type|
|
11
|
-
assets =
|
13
|
+
assets = pipeline_object.assets_for(pipes, type, opts)
|
12
14
|
assets.map do |asset|
|
13
|
-
pipe_tag(type, asset)
|
15
|
+
pipe_tag(type, asset, bust_cache)
|
14
16
|
end.join("\n")
|
15
17
|
end.join("\n")
|
16
18
|
end
|
17
19
|
|
18
|
-
def pipe_tag(type, asset)
|
19
|
-
asset += cache_buster(asset)
|
20
|
+
def pipe_tag(type, asset, bust_cache=nil)
|
21
|
+
asset += cache_buster(asset) if bust_cache
|
20
22
|
case type.to_sym
|
21
23
|
when :css
|
22
24
|
%(<link href="#{request.script_name}/#{asset}" rel="stylesheet">)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Bochkariov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|