sprockets_rails3_backport 0.0.3 → 0.0.4

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.
@@ -1,5 +1,8 @@
1
1
  # Backport of Rails 3.1.x Sprockets integration to Rails 3.0.x
2
2
 
3
+ Most code has been extracted from the [Rails 3-1-stable branch](https://github.com/rails/rails/tree/3-1-stable). Modified to suit [our needs](http://www.shopify.com).
4
+
5
+
3
6
  ## Usage
4
7
 
5
8
  In your `Gemfile`:
@@ -63,12 +63,12 @@ module Sprockets
63
63
  # alias_method :path_to_image, :image_path # aliased to avoid conflicts with an image_path named route
64
64
 
65
65
  def javascript_path(source)
66
- asset_path(source)
66
+ asset_path(source, :ext => 'js')
67
67
  end
68
68
  alias_method :path_to_javascript, :javascript_path # aliased to avoid conflicts with an javascript_path named route
69
69
 
70
70
  def stylesheet_path(source)
71
- asset_path(source)
71
+ asset_path(source, :ext => 'css')
72
72
  end
73
73
  alias_method :path_to_stylesheet, :stylesheet_path # aliased to avoid conflicts with an stylesheet_path named route
74
74
 
@@ -142,8 +142,8 @@ module Sprockets
142
142
  return asset.digest_path
143
143
  end
144
144
  return logical_path
145
- else
146
- raise AssetNotPrecompiledError.new("#{logical_path} isn't precompiled")
145
+ # else
146
+ # raise AssetNotPrecompiledError.new("#{logical_path} isn't precompiled")
147
147
  end
148
148
  end
149
149
 
@@ -151,7 +151,10 @@ module Sprockets
151
151
  if source[0] == ?/
152
152
  source
153
153
  else
154
- source = digest_for(source) unless options[:digest] == false
154
+ unless options[:digest] == false
155
+ digest = digest_for(source)
156
+ source = digest if digest
157
+ end
155
158
  source = File.join(dir, source)
156
159
  source = "/#{source}" unless source =~ /^\//
157
160
  source
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets_rails3_backport
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-13 00:00:00.000000000 -05:00
12
+ date: 2011-12-16 00:00:00.000000000 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &2153275040 !ruby/object:Gem::Requirement
17
+ requirement: &2168988260 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2153275040
25
+ version_requirements: *2168988260
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: sprockets
28
- requirement: &2153274580 !ruby/object:Gem::Requirement
28
+ requirement: &2168987500 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - =
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 2.1.2
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2153274580
36
+ version_requirements: *2168987500
37
37
  description:
38
38
  email:
39
39
  - james@shopify.com