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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a80a1ab0bc8b2d888c5d699a012c907bac05b921
4
- data.tar.gz: 675a9c02678f4e2fa3df4e8261980ceb57d08e51
3
+ metadata.gz: 7e05b36743868f772126d298be39b9182feac135
4
+ data.tar.gz: 7b031046262f6003ee97483fe1ddaaae11abf45a
5
5
  SHA512:
6
- metadata.gz: d41d5df2a9e99c0e526dcf595e754a735b9fcbfcfed0cf86a2f24e9d8962744aa2c430f2c5d6d81d9f3ed3b1c9d54ccfbb3d195e7b4c85035310a38f9ae434f9
7
- data.tar.gz: e435f9ca87e6a6060387269ae37dc89ecb2989ba278217dd4e1cc13a1769eb0ae328182dacd3c5d1097e3992cf6eb699f1e11f009f5356a595a84a4c801d9bfb
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
- # Default to off outside of production
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
@@ -1,3 +1,3 @@
1
1
  module RailsAppcache
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_appcache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Eagar