middleman-appcache 1.1.0 → 1.2.0
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/.gitignore +3 -1
- data/README.md +1 -1
- data/lib/middleman-appcache.rb +1 -1
- data/lib/middleman-appcache/extension.rb +11 -11
- data/lib/middleman-appcache/version.rb +1 -1
- data/middleman-appcache.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7f991bd708fa5c500589fa710ab294c4286140a
|
4
|
+
data.tar.gz: 8edeb0959fe25314d3d0e33c1c1a1b2bc6275310
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 614f051c0f6a0b6a1d85dbbc459f35f17a1f665fba15598a495819da4f1306b164eb96584bdedd8dd3fc121706a53d34acaba573fbc645139e95d2d53f7e1940
|
7
|
+
data.tar.gz: 7bb31207f8bdec201023f6ce5a3a8c9f2ccbdc3657d39bed88c886c6ce256f24a0983782d033df461bbcd853a710acaa8da1ed1944be3873080b2715a766fef2
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -119,4 +119,4 @@ If a version hash should be generated from the contents of the referenced files.
|
|
119
119
|
|
120
120
|
## License
|
121
121
|
|
122
|
-
Middleman Application Cache
|
122
|
+
Middleman Application Cache created by [Ryan Scott](http://github.com/archytaus) is distributed under the [MIT](http://ryanscott.mit-license.org) license.
|
data/lib/middleman-appcache.rb
CHANGED
@@ -13,7 +13,7 @@ module Middleman
|
|
13
13
|
|
14
14
|
def initialize app, options_hash = {}, &block
|
15
15
|
super
|
16
|
-
|
16
|
+
|
17
17
|
cache_manifest_filename = options.cache_manifest
|
18
18
|
cache_options = options.cache
|
19
19
|
network_options = options.network
|
@@ -22,13 +22,13 @@ module Middleman
|
|
22
22
|
version_hash = options.version_hash
|
23
23
|
|
24
24
|
if version_hash
|
25
|
-
|
26
|
-
|
25
|
+
require 'digest'
|
26
|
+
hash = Digest::MD5.new
|
27
27
|
end
|
28
28
|
|
29
29
|
app.after_build do |builder|
|
30
30
|
cache = []
|
31
|
-
|
31
|
+
|
32
32
|
cache_options.each do |cache_file_pattern|
|
33
33
|
directory = File.join(config[:build_dir], cache_file_pattern)
|
34
34
|
files_to_cache = Dir.glob(directory)
|
@@ -36,9 +36,9 @@ module Middleman
|
|
36
36
|
build_dir = config[:build_dir]
|
37
37
|
build_dir = "#{build_dir}/" if use_relative
|
38
38
|
cache << file_to_cache.gsub(build_dir, '')
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
if version_hash
|
40
|
+
hash.file file_to_cache if File.file? file_to_cache
|
41
|
+
end
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -46,9 +46,9 @@ module Middleman
|
|
46
46
|
File.open(manifest_file, "w") do |f|
|
47
47
|
f.write "CACHE MANIFEST\n\n"
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
if version_hash
|
50
|
+
f.write "\# version #{hash.hexdigest}\n\n"
|
51
|
+
end
|
52
52
|
|
53
53
|
f.write "CACHE:\n"
|
54
54
|
cache.each do |cache_file|
|
@@ -73,7 +73,7 @@ module Middleman
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
builder.
|
76
|
+
builder.trigger :created, manifest_file
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
data/middleman-appcache.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.files = `git ls-files`.split("\n")
|
17
17
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
18
|
s.require_paths = ["lib"]
|
19
|
-
|
19
|
+
|
20
20
|
# The version of middleman-core your extension depends on
|
21
|
-
s.add_runtime_dependency("middleman-core", [">=
|
21
|
+
s.add_runtime_dependency("middleman-core", [">= 4.0.0"])
|
22
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-appcache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Scott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.0
|
27
27
|
description: Generate appcache manifest for your Middleman Project
|
28
28
|
email:
|
29
29
|
- atthealma@gmail.com
|