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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 296420a355353f27d4acf162dc4b1190c8929d76
4
- data.tar.gz: ab491a3ecd555cb76e354c32bde07ec0928a51f9
3
+ metadata.gz: a7655da8b8d058c860f8952d72eb270802ea248f
4
+ data.tar.gz: b65170c885f0feff182cbbd60797a84a265511c5
5
5
  SHA512:
6
- metadata.gz: f4ac3afb4cd65c98415dce496c53dcacee63881f0e43ce684551555327d4790122cde98bbc4a4ec2b669947b1161d6969333c96de024c4f05205e42c80ddafe9
7
- data.tar.gz: c260d5d346cfbb565a7a88c6031bdfde3b0ee6eb9ae8fcf0853548d054f6d151dc468831bcfdee8a4921e299c2a9580e0795ea252700f3ddffc2ce4851e853de
6
+ metadata.gz: 9bfae2e463038c6953805f4fd5b4ae86e9bda65b7c4bef3dba33fbe4ec66aac19051b85945bd60ce3c13dfec2ca1fb3e21678433cb47a538c37c821417ed1f5d
7
+ data.tar.gz: 9f4b2f11106557b550fa51c6d39acf2bfcb039a5f04a14569d888b4062352f610762d8275b26dbffe5e85a7c831c7fed247021dbcfb931209e6fe88417e25ec6
@@ -28,6 +28,7 @@ module RackPipeline
28
28
  :temp => nil,
29
29
  :compress => false,
30
30
  :combine => false,
31
+ :bust_cache => false,
31
32
  :css => {
32
33
  :app => 'assets/**/*.css',
33
34
  },
@@ -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 = env['rack-pipeline'].assets_for(pipes, type, opts)
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">)
@@ -1,3 +1,3 @@
1
1
  module RackPipeline
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
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.8
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-02-25 00:00:00.000000000 Z
11
+ date: 2014-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler