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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b46fc691359d55c28bae04bec5dc2712f995bfeda3b7f9a59d854e9594c61b5d
4
- data.tar.gz: b5479047c0ccac7ec071a9aaf3428f9d615935548c8dd9d4d9b28f79769bf33a
3
+ metadata.gz: ac539efc37311d68fe991191d98d0f88c47318128e2bf529a177af6814066a14
4
+ data.tar.gz: 4fed4074d7a52b2fa807b35bf9e14d29649c09d0b6e8629dad7a7a56ce21423e
5
5
  SHA512:
6
- metadata.gz: 73dd830ca3fc53df0a3850bb2a1fb6b230f2ebe62202281f019ae4d48b3bb414c5f9531a0bafda378b6cd22a94de62ae0f711be0206768ad3f8c2306c4dd2f34
7
- data.tar.gz: b37f746153cf2c39ce6fe774194fc7e09ac5be31615c555c7f26e438bb32343b1783f517dfa07fdb94acebae756ea48690714411e9f44e61db6efbf117943c19
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.5
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: 120
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
@@ -1,5 +1,9 @@
1
1
  # main
2
2
 
3
+ # 2.0.1 / 04-04-2023
4
+
5
+ * Cache `git log` value for last modified date.
6
+
3
7
  # 2.0.0 / 25-01-2023
4
8
 
5
9
  * Restrict support to Bridgetown v1.2 and newer.
@@ -12,13 +12,20 @@ module Bridgetown
12
12
  def latest_git_commit_date
13
13
  return nil unless git_repo?
14
14
 
15
- date = `git log -1 --pretty="format:%cI" "#{path}"`
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgetownSitemap
4
- VERSION = "2.0.0"
4
+ VERSION = "2.0.1"
5
5
  end
data/test/helper.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "minitest/autorun"
4
4
  require "minitest/reporters"
5
- require 'minitest/hooks/default'
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({}, {}, { :site => site }.merge(registers))
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" => true,
10
- "root_dir" => root_dir,
11
- "source" => source_dir,
12
- "destination" => dest_dir,
13
- "url" => "https://example.com",
14
- "quiet" => true
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.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-01-25 00:00:00.000000000 Z
11
+ date: 2023-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown