sprockets 2.0.5 → 2.1.0.beta
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.
- data/lib/sprockets.rb +44 -12
- data/lib/sprockets/asset.rb +114 -68
- data/lib/sprockets/asset_attributes.rb +1 -34
- data/lib/sprockets/base.rb +97 -16
- data/lib/sprockets/bundled_asset.rb +32 -211
- data/lib/sprockets/cache/file_store.rb +2 -11
- data/lib/sprockets/caching.rb +11 -42
- data/lib/sprockets/context.rb +7 -5
- data/lib/sprockets/engines.rb +0 -24
- data/lib/sprockets/environment.rb +5 -11
- data/lib/sprockets/errors.rb +1 -0
- data/lib/sprockets/index.rb +31 -15
- data/lib/sprockets/processed_asset.rb +148 -0
- data/lib/sprockets/server.rb +22 -13
- data/lib/sprockets/static_asset.rb +2 -33
- data/lib/sprockets/trail.rb +0 -24
- data/lib/sprockets/version.rb +1 -1
- metadata +181 -147
- checksums.yaml +0 -7
- data/lib/sprockets/digest.rb +0 -67
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 6fc5c67764c2717abc919aca1fa01410c0ae4dad
|
4
|
-
data.tar.gz: 55d936b3fbee34cf2f74d5ab32f7ede9d859cb24
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: a26ef9c3fdbffdb137dd030b2f5f27e001cfbc2c5f54ab2a436340799f94b321f44a836e2557e38ab88b6e71e342fb6f8b013bdda77f3e7b6ccdd36d0d84a5bf
|
7
|
-
data.tar.gz: 49ed8e89d75d62c40a4008e1d07975fdc1db426e902828a21a1f857ddf7055bb8ac5bb300442aa10d56a0c3ff83514b94c97763856c423b6956d1e90fdb71060
|
data/lib/sprockets/digest.rb
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
module Sprockets
|
2
|
-
# `Digest` is an internal mixin whose public methods are exposed on
|
3
|
-
# the `Environment` and `Index` classes.
|
4
|
-
module Digest
|
5
|
-
# Returns a `Digest` implementation class.
|
6
|
-
#
|
7
|
-
# Defaults to `Digest::MD5`.
|
8
|
-
def digest_class
|
9
|
-
@digest_class
|
10
|
-
end
|
11
|
-
|
12
|
-
# Assign a `Digest` implementation class. This maybe any Ruby
|
13
|
-
# `Digest::` implementation such as `Digest::MD5` or
|
14
|
-
# `Digest::SHA1`.
|
15
|
-
#
|
16
|
-
# environment.digest_class = Digest::SHA1
|
17
|
-
#
|
18
|
-
def digest_class=(klass)
|
19
|
-
expire_index!
|
20
|
-
@digest_class = klass
|
21
|
-
end
|
22
|
-
|
23
|
-
# The `Environment#version` is a custom value used for manually
|
24
|
-
# expiring all asset caches.
|
25
|
-
#
|
26
|
-
# Sprockets is able to track most file and directory changes and
|
27
|
-
# will take care of expiring the cache for you. However, its
|
28
|
-
# impossible to know when any custom helpers change that you mix
|
29
|
-
# into the `Context`.
|
30
|
-
#
|
31
|
-
# It would be wise to increment this value anytime you make a
|
32
|
-
# configuration change to the `Environment` object.
|
33
|
-
def version
|
34
|
-
@version
|
35
|
-
end
|
36
|
-
|
37
|
-
# Assign an environment version.
|
38
|
-
#
|
39
|
-
# environment.version = '2.0'
|
40
|
-
#
|
41
|
-
def version=(version)
|
42
|
-
expire_index!
|
43
|
-
@version = version
|
44
|
-
end
|
45
|
-
|
46
|
-
# Returns a `Digest` instance for the `Environment`.
|
47
|
-
#
|
48
|
-
# This value serves two purposes. If two `Environment`s have the
|
49
|
-
# same digest value they can be treated as equal. This is more
|
50
|
-
# useful for comparing environment states between processes rather
|
51
|
-
# than in the same. Two equal `Environment`s can share the same
|
52
|
-
# cached assets.
|
53
|
-
#
|
54
|
-
# The value also provides a seed digest for all `Asset`
|
55
|
-
# digests. Any change in the environment digest will affect all of
|
56
|
-
# its assets.
|
57
|
-
def digest
|
58
|
-
# Compute the initial digest using the implementation class. The
|
59
|
-
# Sprockets release version and custom environment version are
|
60
|
-
# mixed in. So any new releases will affect all your assets.
|
61
|
-
@digest ||= digest_class.new.update(VERSION).update(version.to_s)
|
62
|
-
|
63
|
-
# Returned a dupped copy so the caller can safely mutate it with `.update`
|
64
|
-
@digest.dup
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|