turbo-sprockets-rails3 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -48,6 +48,15 @@ Enjoy your lightning fast deploys!
48
48
  Fully compatible. Just don't use the experimental `AssetSync.config.manifest = true` configuration option until
49
49
  [my asset_sync patch](https://github.com/rumblelabs/asset_sync/pull/110) has been merged.
50
50
 
51
+
52
+ ### [wicked_pdf](https://github.com/mileszs/wicked_pdf)
53
+
54
+ Some users have reported that their production server was attempting to compile assets. To solve this, you will need to use the latest code on the `wicked_pdf` master branch by adding the following line to your `Gemfile`:
55
+
56
+ ```ruby
57
+ gem 'wicked_pdf', :github => "mileszs/wicked_pdf"
58
+ ```
59
+
51
60
  <hr/>
52
61
 
53
62
  Please let me know if you have any problems with other gems, and I will either fix it, or make a note of the problem here.
@@ -1,10 +1,23 @@
1
- require 'sprockets/asset_with_dependencies'
2
-
3
1
  module Sprockets
4
2
  class UnprocessedAsset < AssetWithDependencies
3
+ def replace_scss_imports
4
+ @source.gsub!(/^@import ["']([^"']+)["']/) do |match|
5
+ begin
6
+ template = "_#{$1}"
7
+ pathname = @environment.resolve(template)
8
+ asset = UnprocessedAsset.new @environment, '_changeme2', pathname
9
+ # Replace imported template with the unprocessed asset contents.
10
+ asset.to_s
11
+ rescue Sprockets::FileNotFound
12
+ match
13
+ end
14
+ end
15
+ end
16
+
5
17
  def initialize(environment, logical_path, pathname)
6
18
  super
7
19
 
20
+ @environment = environment
8
21
  context = environment.context_class.new(environment, logical_path, pathname)
9
22
  attributes = environment.attributes_for(pathname)
10
23
  processors = attributes.processors
@@ -14,6 +27,11 @@ module Sprockets
14
27
 
15
28
  @source = context.evaluate(pathname, :processors => processors)
16
29
 
30
+ # Manually include files that are @imported from SCSS
31
+ if defined?(Sass::Rails::ScssTemplate) && attributes.processors.include?(Sass::Rails::ScssTemplate)
32
+ replace_scss_imports
33
+ end
34
+
17
35
  build_required_assets(environment, context, :process => false)
18
36
  build_dependency_paths(environment, context, :process => false)
19
37
 
@@ -21,7 +21,8 @@ module TurboSprockets
21
21
 
22
22
  if File.exist?(manifest_path)
23
23
  manifest = YAML.load_file(manifest_path)
24
- config.assets.digest_files = manifest[:digest_files] || {}
24
+ # Set both digest keys for backwards compatibility
25
+ config.assets.digests = config.assets.digest_files = manifest[:digest_files] || {}
25
26
  config.assets.source_digests = manifest[:source_digests] || {}
26
27
  end
27
28
  end
@@ -1,5 +1,4 @@
1
1
  require 'sprockets/base'
2
- require 'sprockets/unprocessed_asset'
3
2
 
4
3
  module Sprockets
5
4
  Base.class_eval do
@@ -1,5 +1,4 @@
1
1
  require 'sprockets/processed_asset'
2
- require 'sprockets/asset_with_dependencies'
3
2
 
4
3
  module Sprockets
5
4
 
@@ -82,16 +82,14 @@ namespace :assets do
82
82
  end
83
83
 
84
84
  task :all => ["assets:cache:clean"] do
85
+ # Other gems may want to add hooks to run after the 'assets:precompile:***' tasks.
86
+ # Since we aren't running separate rake tasks anymore, we manually invoke the extra actions.
85
87
  internal_precompile
88
+ Rake::Task["assets:precompile:primary"].actions[1..-1].each &:call
89
+
86
90
  if ::Rails.application.config.assets.digest
87
91
  internal_precompile(false)
88
-
89
- # Other gems may want to add hooks to run after the 'assets:precompile:***' tasks.
90
- # Since we aren't running separate rake tasks anymore,
91
- # we need to manually invoke the extra actions.
92
- %w(primary nondigest).each do |asset_type|
93
- Rake::Task["assets:precompile:#{asset_type}"].actions[1..-1].each &:call
94
- end
92
+ Rake::Task["assets:precompile:nondigest"].actions[1..-1].each &:call
95
93
  end
96
94
  end
97
95
 
@@ -1,3 +1,3 @@
1
1
  module TurboSprockets
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
@@ -1,7 +1,14 @@
1
+ require 'sprockets/railtie'
2
+ require 'sprockets/helpers'
3
+
4
+ module Sprockets
5
+ # Assets
6
+ autoload :UnprocessedAsset, "sprockets/unprocessed_asset"
7
+ autoload :AssetWithDependencies, "sprockets/asset_with_dependencies"
8
+ end
9
+
1
10
  Dir[File.expand_path('../turbo-sprockets/sprockets_overrides/**/*.rb', __FILE__)].each do |f|
2
11
  require f
3
12
  end
4
13
 
5
- require 'sprockets/railtie'
6
- require 'sprockets/helpers'
7
14
  require 'turbo-sprockets/railtie'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo-sprockets-rails3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-06 00:00:00.000000000 Z
12
+ date: 2012-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sprockets