sprockets 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sprockets might be problematic. Click here for more details.

@@ -69,7 +69,7 @@ module Sprockets
69
69
  # # => ".js"
70
70
  #
71
71
  def format_extension
72
- extensions.detect { |ext|
72
+ extensions.reverse.detect { |ext|
73
73
  @environment.mime_types(ext) && !@environment.engines(ext)
74
74
  }
75
75
  end
@@ -51,7 +51,7 @@ module Sprockets
51
51
  hash = {}
52
52
  asset.encode_with(hash)
53
53
 
54
- # Save the asset to at its path
54
+ # Save the asset to its path
55
55
  cache_set_hash(path.to_s, digest.hexdigest, hash)
56
56
 
57
57
  # Since path maybe a logical or full pathname, save the
@@ -6,14 +6,21 @@ module Sprockets
6
6
  'application/javascript'
7
7
  end
8
8
 
9
+ def self.default_namespace
10
+ 'this.JST'
11
+ end
12
+
9
13
  def prepare
14
+ @namespace = self.class.default_namespace
10
15
  end
11
16
 
17
+ attr_reader :namespace
18
+
12
19
  def evaluate(scope, locals, &block)
13
20
  <<-JST
14
21
  (function() {
15
- this.JST || (this.JST = {});
16
- this.JST[#{scope.logical_path.inspect}] = #{indent(data)};
22
+ #{namespace} || (#{namespace} = {});
23
+ #{namespace}[#{scope.logical_path.inspect}] = #{indent(data)};
17
24
  }).call(this);
18
25
  JST
19
26
  end
@@ -1,3 +1,3 @@
1
1
  module Sprockets
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 2
10
- version: 2.0.2
9
+ - 3
10
+ version: 2.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sam Stephenson
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-10-04 00:00:00 -05:00
19
+ date: 2011-10-17 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  requirements: []
245
245
 
246
246
  rubyforge_project: sprockets
247
- rubygems_version: 1.6.2
247
+ rubygems_version: 1.5.2
248
248
  signing_key:
249
249
  specification_version: 3
250
250
  summary: Rack-based asset packaging system