rails_appcache 0.0.4 → 0.0.5
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.
- checksums.yaml +4 -4
- data/lib/rails_appcache/application_helper.rb +1 -11
- data/lib/rails_appcache/config.rb +13 -1
- data/lib/rails_appcache/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e05b36743868f772126d298be39b9182feac135
|
4
|
+
data.tar.gz: 7b031046262f6003ee97483fe1ddaaae11abf45a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 835d00b89a6457cf8ad4ddee44edeedcc8459029f9a7471751f0881423df68bb86115680ea649eb6462246f057ed12e2d36264ba08a6a7f335bcae82cbcc0635
|
7
|
+
data.tar.gz: 94f4567392cbfb90dd9aec9403a4ee1a9843fe9eae248ebb65cd31142675ebf0dc10ac4a3667186225a1390e89835a34484ab757dd762ed6fe3fab9d5b613a4d
|
@@ -9,17 +9,7 @@ module RailsAppcache
|
|
9
9
|
# In development, serve up a new manifest every time
|
10
10
|
# In production, serve the current Git revision
|
11
11
|
def appcache_version_string
|
12
|
-
|
13
|
-
if Rails.env.development?
|
14
|
-
Rails.application.config.assets.version
|
15
|
-
else
|
16
|
-
# Use the REVISION file left in root from capistrano
|
17
|
-
if File.exists?(Rails.root.join('REVISION'))
|
18
|
-
File.read(Rails.root.join('REVISION'))
|
19
|
-
else
|
20
|
-
`git rev-parse HEAD`
|
21
|
-
end
|
22
|
-
end
|
12
|
+
RailsAppcache.config.version
|
23
13
|
end
|
24
14
|
|
25
15
|
def stylesheet_cache_path(*paths)
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# Simple configuration storage for RailsAppcache
|
1
2
|
|
2
3
|
module RailsAppcache
|
3
4
|
|
@@ -6,14 +7,25 @@ module RailsAppcache
|
|
6
7
|
end
|
7
8
|
|
8
9
|
class Config
|
9
|
-
#
|
10
|
+
# Check whether appcache caching is enabled; default off in development, on elsewhere
|
10
11
|
def perform_caching?
|
11
12
|
@perform_caching || !Rails.env.development?
|
12
13
|
end
|
13
14
|
|
15
|
+
# Turn caching on or off
|
14
16
|
def perform_caching=(val)
|
15
17
|
@perform_caching = !!val
|
16
18
|
end
|
19
|
+
|
20
|
+
# Return the current manifests version string, falling back to the Rails asset version string
|
21
|
+
def version
|
22
|
+
@appcache_version || Rails.application.config.assets.version
|
23
|
+
end
|
24
|
+
|
25
|
+
# Assign an explicit version to our manifests
|
26
|
+
def version=(value)
|
27
|
+
@appcache_version = value
|
28
|
+
end
|
17
29
|
end
|
18
30
|
|
19
31
|
end
|