turbo-sprockets-rails3 0.2.13 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,6 @@ module Sprockets
18
18
  if @source.include?("@import")
19
19
  # Process Sass and Less files, since @import is too tricky to handle properly.
20
20
  allowed_engines << Sass::Rails::ScssTemplate if defined?(Sass::Rails::ScssTemplate)
21
- allowed_engines << Sass::Rails::SassTemplate if defined?(Sass::Rails::SassTemplate)
22
21
  allowed_engines << Less::Rails::LessTemplate if defined?(Less::Rails::LessTemplate)
23
22
  processors = attributes.processors - (attributes.engines - allowed_engines)
24
23
  @source = context.evaluate(pathname, :processors => processors)
@@ -1,4 +1,3 @@
1
- require 'sprockets'
2
1
  require 'sprockets/base'
3
2
 
4
3
  module Sprockets
@@ -31,9 +30,7 @@ module Sprockets
31
30
 
32
31
  def cache_key_for(path, options)
33
32
  options[:process] = true unless options.key?(:process)
34
- key = "#{path}:#{options[:bundle] ? '1' : '0'}"
35
- key << ":0" unless options[:process]
36
- key
33
+ "#{path}:#{options[:bundle] ? '1' : '0'}:#{options[:process] ? '1' : '0'}"
37
34
  end
38
35
  end
39
36
  end
@@ -26,37 +26,33 @@ if defined?(Sprockets::StaticCompiler)
26
26
  def compile
27
27
  start_time = Time.now.to_f
28
28
 
29
- env.each_logical_path do |logical_path|
30
- if File.basename(logical_path)[/[^\.]+/, 0] == 'index'
31
- logical_path.sub!(/\/index\./, '.')
32
- end
33
- next unless compile_path?(logical_path)
34
-
29
+ env.each_logical_path(paths) do |logical_path|
35
30
  # Fetch asset without any processing or compression,
36
31
  # to calculate a digest of the concatenated source files
37
- if asset = env.find_asset(logical_path, :process => false)
38
- @source_digests[logical_path] = asset.digest
39
-
40
- # Recompile if digest has changed or compiled digest file is missing
41
- current_digest_file = @current_digests[logical_path]
42
-
43
- if @source_digests[logical_path] != @current_source_digests[logical_path] ||
44
- !(current_digest_file && File.exists?("#{@target}/#{current_digest_file}"))
32
+ next unless asset = env.find_asset(logical_path, :process => false)
33
+ @source_digests[logical_path] = asset.digest
45
34
 
46
- if asset = env.find_asset(logical_path)
47
- @digests[logical_path] = write_asset(asset)
48
- # Update current_digests with new hash, for future assets to reference
49
- @current_digests[logical_path] = asset.digest_path
50
- end
35
+ # Recompile if digest has changed or compiled digest file is missing
36
+ current_digest_file = @current_digests[logical_path]
51
37
 
52
- else
53
- # Set asset file from manifest.yml
54
- digest_file = @current_digests[logical_path]
55
- @digests[logical_path] = digest_file
38
+ if @source_digests[logical_path] != @current_source_digests[logical_path] ||
39
+ !(current_digest_file && File.exists?("#{@target}/#{current_digest_file}"))
56
40
 
57
- env.logger.debug "Not compiling #{logical_path}, sources digest has not changed " <<
58
- "(#{@source_digests[logical_path][0...7]})"
41
+ if asset = env.find_asset(logical_path)
42
+ digest_path = write_asset(asset)
43
+ @digests[asset.logical_path] = digest_path
44
+ @digests[aliased_path_for(asset.logical_path)] = digest_path
45
+ # Update current_digests with new hash, for future assets to reference
46
+ @current_digests[asset.logical_path] = asset.digest_path
59
47
  end
48
+ else
49
+ # Set asset file from manifest.yml
50
+ digest_path = @current_digests[logical_path]
51
+ @digests[logical_path] = digest_path
52
+ @digests[aliased_path_for(logical_path)] = digest_path
53
+
54
+ env.logger.debug "Not compiling #{logical_path}, sources digest has not changed " <<
55
+ "(#{@source_digests[logical_path][0...7]})"
60
56
  end
61
57
  end
62
58
 
@@ -77,9 +77,7 @@ namespace :assets do
77
77
  known_assets.each do |asset|
78
78
  full_path = File.join(target, asset)
79
79
  if File.exist?(full_path)
80
- # File.utime raises 'Operation not permitted' unless user is owner of file.
81
- # Non-owners have permission to update mtime to the current time using 'touch'.
82
- `touch "#{full_path}"`
80
+ File.utime(Time.now, Time.now, full_path)
83
81
  end
84
82
  end
85
83
  end
@@ -1,3 +1,3 @@
1
1
  module TurboSprockets
2
- VERSION = "0.2.13"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.13
4
+ version: 0.3.0
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-12-08 00:00:00.000000000 Z
12
+ date: 2012-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sprockets
@@ -32,23 +32,23 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ! '>='
35
+ - - ! '>'
36
36
  - !ruby/object:Gem::Version
37
- version: 3.1.0
37
+ version: 3.2.8
38
38
  - - <
39
39
  - !ruby/object:Gem::Version
40
- version: 3.2.9
40
+ version: 4.0.0
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  none: false
45
45
  requirements:
46
- - - ! '>='
46
+ - - ! '>'
47
47
  - !ruby/object:Gem::Version
48
- version: 3.1.0
48
+ version: 3.2.8
49
49
  - - <
50
50
  - !ruby/object:Gem::Version
51
- version: 3.2.9
51
+ version: 4.0.0
52
52
  description: Speeds up the Rails 3 asset pipeline by only recompiling changed assets
53
53
  email:
54
54
  - nathan.f77@gmail.com
@@ -108,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  segments:
110
110
  - 0
111
- hash: -456945734169101305
111
+ hash: -1656609350867516243
112
112
  required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements:
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  version: '0'
118
118
  segments:
119
119
  - 0
120
- hash: -456945734169101305
120
+ hash: -1656609350867516243
121
121
  requirements: []
122
122
  rubyforge_project:
123
123
  rubygems_version: 1.8.24