roda-sprocket_assets 0.0.5 → 0.0.6

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: 2212fae3b730fa2748d1bcf25d0c9c2045ecb606
4
- data.tar.gz: c13a8a792507fec243ebcfc9481e21467b36834f
3
+ metadata.gz: 8abc472dea0409ff8f3459e98b2376f9a15d61f8
4
+ data.tar.gz: 5fcca4a74a9ec19ba50248d1fee6d44cf57cc9e3
5
5
  SHA512:
6
- metadata.gz: 7d8c710a91df010cf85d5945b45901fd3ffff44e2c5ad7cbd54c49a31d58cd6167eef8085cdcfcbe15d48706bd3cd31dbe0ff141164a0a38b35d5cfcf3dea91a
7
- data.tar.gz: b9d3f3b5683e50fe8b022283341af5e4566ea9b06f8f1448cb3c1c314fbfc9b778bb0fc015fbe2f0af0bab2e894446304806eed5bce100c2b7fe6e69cb47bfa5
6
+ metadata.gz: ac03bfaf4f07fbe8d0c96dc9caee45e3c2594a6a883d6c5d157c51f1012c0156f2704f96ac630eb36fc48d6787aa2bcabe17eba400a35346f1b4f2a32b2ec4ec
7
+ data.tar.gz: 9e651d8240b1d0e727b7ee7a4100ac561edb42d94fd329fd0ea74893ccdc2314d024d1fea8249f1287830988cd39ea42089dfd5fc7ee46e2adf8f5f4a5e5e54b
@@ -46,6 +46,7 @@ class Roda
46
46
  if opts[:opal]
47
47
  require 'opal/sprockets/server'
48
48
  require 'opal/sprockets/processor'
49
+ require 'roda/plugins/sprockets_cache_key_fix'
49
50
 
50
51
  Opal.paths.each do |path|
51
52
  opts[:sprockets].append_path path
@@ -0,0 +1,22 @@
1
+ # elia: Sprockets wasn't busting the assets cache between opal versions, resulting in weird errors
2
+ # https://github.com/opal/opal-rails/blob/master/lib/opal/rails/sprockets_cache_key_fix.rb
3
+
4
+ require 'sprockets/base'
5
+ require 'opal/version'
6
+ require 'opal/sprockets/processor'
7
+
8
+ def (Opal::Processor).version
9
+ Opal::VERSION
10
+ end unless Opal::Processor.respond_to? :version
11
+
12
+ class Sprockets::Base
13
+ def cache_key_for(path, options)
14
+ processors = attributes_for(path).processors
15
+ processors_key = processors.map do |p|
16
+ version = p.respond_to?(:version) ? p.version : '0'
17
+ "#{p.name}-#{version}"
18
+ end.join(':')
19
+
20
+ "#{path}:#{options[:bundle] ? '1' : '0'}:#{processors_key}"
21
+ end
22
+ end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "roda-sprocket_assets"
7
- spec.version = '0.0.5'
7
+ spec.version = '0.0.6'
8
8
  spec.authors = ["cj"]
9
9
  spec.email = ["cjlazell@gmail.com"]
10
10
  spec.summary = %q{Use sprockets to serve assets in roda.}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-sprocket_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-24 00:00:00.000000000 Z
11
+ date: 2015-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roda
@@ -94,6 +94,7 @@ files:
94
94
  - Rakefile
95
95
  - lib/roda/plugins/sprocket_assets.rb
96
96
  - lib/roda/plugins/sprocket_assets_task.rb
97
+ - lib/roda/plugins/sprockets_cache_key_fix.rb
97
98
  - lib/roda/sprocket_assets.rb
98
99
  - roda-sprocket_assets.gemspec
99
100
  homepage: ''