digestion 1.2 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,9 @@ def digest_path?(logical_path)
8
8
  if path.is_a?(Regexp)
9
9
  # Match path against `Regexp`
10
10
  path.match(logical_path)
11
+ elsif path.is_a?(Proc)
12
+ # Match path against `Proc`
13
+ path.call(logical_path)
11
14
  else
12
15
  # Otherwise use fnmatch glob syntax
13
16
  File.fnmatch(path.to_s, logical_path)
@@ -25,6 +28,7 @@ namespace :assets do
25
28
  Kernel.exec $0, *ARGV
26
29
  else
27
30
  Rake::Task["environment"].invoke
31
+ Rake::Task["tmp:cache:clear"].invoke
28
32
 
29
33
  # Ensure that action view is loaded and the appropriate sprockets hooks get executed
30
34
  ActionView::Base
@@ -32,6 +36,9 @@ namespace :assets do
32
36
  # Always compile files
33
37
  Rails.application.config.assets.compile = true
34
38
 
39
+ # Always ignore asset host
40
+ Rails.application.config.action_controller.asset_host = nil
41
+
35
42
  config = Rails.application.config
36
43
  env = Rails.application.assets
37
44
  target = Pathname.new(File.join(Rails.public_path, config.assets.prefix))
@@ -42,6 +49,8 @@ namespace :assets do
42
49
  env.each_logical_path do |logical_path|
43
50
  if path.is_a?(Regexp)
44
51
  next unless path.match(logical_path)
52
+ elsif path.is_a?(Proc)
53
+ next unless path.call(logical_path)
45
54
  else
46
55
  next unless File.fnmatch(path.to_s, logical_path)
47
56
  end
@@ -11,6 +11,7 @@ Sprockets::Helpers::RailsHelper.module_eval do
11
11
  end
12
12
 
13
13
  private
14
+ remove_method(:digest_assets?) if private_method_defined?(:digest_assets?)
14
15
  def digest_assets?
15
16
  Rails.application.config.assets.digest
16
17
  end
@@ -21,7 +22,8 @@ private
21
22
  end
22
23
 
23
24
  Sprockets::Helpers::RailsHelper::AssetPaths.class_eval do
24
- attr_accessor :digest_assets, :digest_exclusions
25
+ attr_accessor :digest_assets unless method_defined?(:digest_assets)
26
+ attr_accessor :digest_exclusions
25
27
 
26
28
  alias_method :original_digest_for, :digest_for
27
29
 
@@ -42,6 +44,9 @@ private
42
44
  if path.is_a?(Regexp)
43
45
  # Match path against `Regexp`
44
46
  path.match(logical_path)
47
+ elsif path.is_a?(Proc)
48
+ # Match path against `Proc`
49
+ path.call(logical_path)
45
50
  else
46
51
  # Otherwise use fnmatch glob syntax
47
52
  File.fnmatch(path.to_s, logical_path)
metadata CHANGED
@@ -1,46 +1,34 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: digestion
3
- version: !ruby/object:Gem::Version
4
- hash: 11
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.1
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 2
9
- version: "1.2"
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Sam Pohlenz
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-09-14 00:00:00 Z
18
- dependencies:
19
- - !ruby/object:Gem::Dependency
12
+ date: 2011-09-28 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
20
15
  name: actionpack
21
- prerelease: false
22
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70179729643020 !ruby/object:Gem::Requirement
23
17
  none: false
24
- requirements:
18
+ requirements:
25
19
  - - ~>
26
- - !ruby/object:Gem::Version
27
- hash: 3
28
- segments:
29
- - 3
30
- - 1
31
- - 0
20
+ - !ruby/object:Gem::Version
32
21
  version: 3.1.0
33
22
  type: :runtime
34
- version_requirements: *id001
35
- description: Adds asset digest configuration options to Rails so that specific paths can be excluded from fingerprinting.
23
+ prerelease: false
24
+ version_requirements: *70179729643020
25
+ description: Adds asset digest configuration options to Rails so that specific paths
26
+ can be excluded from fingerprinting.
36
27
  email: sam@sampohlenz.com
37
28
  executables: []
38
-
39
29
  extensions: []
40
-
41
30
  extra_rdoc_files: []
42
-
43
- files:
31
+ files:
44
32
  - README.md
45
33
  - LICENSE
46
34
  - lib/digestion/assets.rake
@@ -49,36 +37,26 @@ files:
49
37
  - lib/digestion.rb
50
38
  homepage:
51
39
  licenses: []
52
-
53
40
  post_install_message:
54
41
  rdoc_options: []
55
-
56
- require_paths:
42
+ require_paths:
57
43
  - lib
58
- required_ruby_version: !ruby/object:Gem::Requirement
44
+ required_ruby_version: !ruby/object:Gem::Requirement
59
45
  none: false
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- hash: 3
64
- segments:
65
- - 0
66
- version: "0"
67
- required_rubygems_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
51
  none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
- version: "0"
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
76
56
  requirements: []
77
-
78
57
  rubyforge_project:
79
- rubygems_version: 1.8.10
58
+ rubygems_version: 1.8.6
80
59
  signing_key:
81
60
  specification_version: 3
82
61
  summary: Fine-grained digest controls for the Rails 3.1 asset pipeline.
83
62
  test_files: []
84
-