middleman-sitemap 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/gzip.feature +17 -6
- data/lib/middleman-sitemap.rb +3 -1
- data/middleman-sitemap.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 763758cd3346ca11ea4022254b31a5741c17fa27
|
4
|
+
data.tar.gz: a0b3869a78c044b13597cb7e2a58633bb96cc848
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47a0df96dc84e4e6e7e8c56ca820b51f43c8b68da0ad3904cf4c557821e5870efebd8f82900ecac0ce988e7b20fcf0661c0dbd03e03c49cd29211a4b32c5d577
|
7
|
+
data.tar.gz: 8c96178a348b4dab24943b3b16bf6aeab97f27a3531fff092e09e45c344fd37331934cc9f201755d37ebfdd0aa0a61273c50efd9a98ea333e2b6ebda10de5979
|
data/features/gzip.feature
CHANGED
@@ -17,12 +17,23 @@ Feature: GZIP sitemap build
|
|
17
17
|
Then the following files should not exist:
|
18
18
|
| build/sitemap.xml.gz |
|
19
19
|
|
20
|
-
Scenario: Sitemap should not be gzipped when option set to false
|
21
|
-
|
22
|
-
|
20
|
+
Scenario: Sitemap should not be gzipped when option set to false
|
21
|
+
Given a fixture app "gzip-app"
|
22
|
+
And a file named "config.rb" with:
|
23
|
+
"""
|
24
|
+
activate :sitemap, :hostname => "http://www.apple.com"
|
25
|
+
"""
|
26
|
+
And a successfully built app at "gzip-app"
|
27
|
+
When I cd to "build"
|
28
|
+
Then the file "sitemap.xml" should contain "http://www.apple.com"
|
29
|
+
|
30
|
+
Scenario: Site that has been gzipped
|
31
|
+
Given a fixture app "gzip-app"
|
32
|
+
And a file named "config.rb" with:
|
23
33
|
"""
|
34
|
+
activate :gzip
|
24
35
|
activate :sitemap, :hostname => "http://www.apple.com"
|
25
36
|
"""
|
26
|
-
|
27
|
-
|
28
|
-
|
37
|
+
And a successfully built app at "gzip-app"
|
38
|
+
When I cd to "build"
|
39
|
+
Then the file "sitemap.xml" should contain "http://www.apple.com"
|
data/lib/middleman-sitemap.rb
CHANGED
@@ -17,7 +17,7 @@ class Sitemap < ::Middleman::Extension
|
|
17
17
|
# puts options.my_option
|
18
18
|
end
|
19
19
|
|
20
|
-
def after_build
|
20
|
+
def after_build(builder)
|
21
21
|
require 'erb'
|
22
22
|
@pages = app.sitemap.resources.find_all{ |p| p.source_file.match(/\.html/) }
|
23
23
|
@hostname = options.hostname
|
@@ -25,8 +25,10 @@ class Sitemap < ::Middleman::Extension
|
|
25
25
|
sitemap = template.render(self)
|
26
26
|
outfile = File.join(app.build_dir, "sitemap.xml")
|
27
27
|
File.open(outfile, 'w') {|f| f.write(sitemap) }
|
28
|
+
builder.say_status :create, "build/sitemap.xml"
|
28
29
|
if options.gzip
|
29
30
|
gzip_file(File.read(outfile))
|
31
|
+
builder.say_status :create, "build/sitemap.xml.gz"
|
30
32
|
end
|
31
33
|
end
|
32
34
|
|
data/middleman-sitemap.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-sitemap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Larry Staton Jr.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman-core
|