bridgetown-sitemap 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +15 -5
- data/CHANGELOG.md +4 -0
- data/lib/bridgetown/resource/base.rb +8 -1
- data/lib/bridgetown-sitemap/version.rb +1 -1
- data/test/helper.rb +3 -3
- data/test/test_sitemap.rb +6 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac539efc37311d68fe991191d98d0f88c47318128e2bf529a177af6814066a14
|
4
|
+
data.tar.gz: 4fed4074d7a52b2fa807b35bf9e14d29649c09d0b6e8629dad7a7a56ce21423e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 289155d9d0827a4c257c127227666f1d489b931521876d42b031000583a524b10d87e62e46991b6cc420d6958bbd94d1a1a9a49e125691cdd101c7e89056b52d
|
7
|
+
data.tar.gz: ab85ae03365fa0f65e4c1a12e32bff50c21e2254e5fa067594a58ee064021c15a03b495d8f21db009cd173670b420aad1d8cffe97e88130833dff766eccc4197
|
data/.rubocop.yml
CHANGED
@@ -4,22 +4,32 @@ inherit_gem:
|
|
4
4
|
rubocop-bridgetown: .rubocop.yml
|
5
5
|
|
6
6
|
AllCops:
|
7
|
-
TargetRubyVersion: 2.
|
8
|
-
Include:
|
9
|
-
- lib/**/*.rb
|
7
|
+
TargetRubyVersion: 2.7
|
10
8
|
|
11
9
|
Exclude:
|
12
10
|
- .gitignore
|
13
|
-
- .rspec
|
14
11
|
- .rubocop.yml
|
12
|
+
- "*.gemspec"
|
15
13
|
|
16
14
|
- Gemfile.lock
|
17
15
|
- CHANGELOG.md
|
18
16
|
- LICENSE.txt
|
19
17
|
- README.md
|
18
|
+
- Rakefile
|
19
|
+
- bridgetown.automation.rb
|
20
20
|
|
21
21
|
- script/**/*
|
22
|
+
- test/fixtures/**/*
|
22
23
|
- vendor/**/*
|
23
24
|
|
24
25
|
Layout/LineLength:
|
25
|
-
Max:
|
26
|
+
Max: 140
|
27
|
+
|
28
|
+
Metrics/BlockLength:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Bundler/OrderedGems:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Style/IfUnlessModifier:
|
35
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -12,13 +12,20 @@ module Bridgetown
|
|
12
12
|
def latest_git_commit_date
|
13
13
|
return nil unless git_repo?
|
14
14
|
|
15
|
-
date =
|
15
|
+
date = sitemap_cache.getset(id) do
|
16
|
+
`git log -1 --pretty="format:%cI" "#{path}"`
|
17
|
+
end
|
18
|
+
|
16
19
|
Time.parse(date) if date.present?
|
17
20
|
end
|
18
21
|
|
19
22
|
def git_repo?
|
20
23
|
system "git status", out: File::NULL, err: File::NULL
|
21
24
|
end
|
25
|
+
|
26
|
+
def sitemap_cache
|
27
|
+
@sitemap_cache = Bridgetown::Cache.new("sitemap")
|
28
|
+
end
|
22
29
|
end
|
23
30
|
end
|
24
31
|
end
|
data/test/helper.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require "minitest/autorun"
|
4
4
|
require "minitest/reporters"
|
5
|
-
require
|
5
|
+
require "minitest/hooks/default"
|
6
6
|
require "bridgetown"
|
7
7
|
|
8
8
|
Bridgetown.begin!
|
@@ -37,6 +37,6 @@ class BridgetownSitemap::Test < Minitest::Test
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def make_context(registers = {})
|
40
|
-
Liquid::Context.new({}, {}, { :
|
40
|
+
Liquid::Context.new({}, {}, { site: site }.merge(registers))
|
41
41
|
end
|
42
|
-
end
|
42
|
+
end
|
data/test/test_sitemap.rb
CHANGED
@@ -6,12 +6,12 @@ class TestSitemap < BridgetownSitemap::Test
|
|
6
6
|
def prepare_site
|
7
7
|
Bridgetown.reset_configuration!
|
8
8
|
@config = Bridgetown.configuration(
|
9
|
-
"full_rebuild"
|
10
|
-
"root_dir"
|
11
|
-
"source"
|
12
|
-
"destination"
|
13
|
-
"url"
|
14
|
-
"quiet"
|
9
|
+
"full_rebuild" => true,
|
10
|
+
"root_dir" => root_dir,
|
11
|
+
"source" => source_dir,
|
12
|
+
"destination" => dest_dir,
|
13
|
+
"url" => "https://example.com",
|
14
|
+
"quiet" => true
|
15
15
|
)
|
16
16
|
|
17
17
|
@config.run_initializers! context: :static
|
@@ -215,4 +215,3 @@ class TestSitemap < BridgetownSitemap::Test
|
|
215
215
|
end
|
216
216
|
end
|
217
217
|
end
|
218
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bridgetown-sitemap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ayush Newatia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bridgetown
|