indexmap 0.7.0 → 0.7.1

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
  SHA256:
3
- metadata.gz: 90b723b27367659107827ca3ff1f7473c6a4a917b62ae1cdb4ae2cfcf440f3f2
4
- data.tar.gz: cd5be4391a83b1378efcad593408648822dabff4dc8e5479e6ae3e3c12d93ac3
3
+ metadata.gz: 64a9d1c671519fea6ba6a46b7f67daed2784ad5aaccf2594dc3aa0a374f55854
4
+ data.tar.gz: 50f6bc13a8097194dec9736b96c8cc6baf0f76429edf0175372aee97991c63f0
5
5
  SHA512:
6
- metadata.gz: '099bf5472fae8a8be3d17ad40003ea5802dd410799431af367e604dca3cd0fce04e98555526dfb36b98f270774b41eec160a47c5abdc9fd81ac148080901d96f'
7
- data.tar.gz: e53e45fe051e02b0000e05c5000f8f23c2e1cc7ab78a952cad6a4a33891b108c8811cd67d9fcadea6cf39bea4abf74eae9736d9e85402e6a1988ef49ace9c0dc
6
+ metadata.gz: 2ce92a1da076303265c03ff833585b069215c8417b134407850770c64ae04b3ab93fcf894484874e710e304c6b3c94f19247d70073aaa6ba5e170f70212e4992
7
+ data.tar.gz: 991f39cd9db707dd79e7a404e636aaea8c8a1db07ce5b59d2daf9d73c33a55d39c252d6edef2adf8fc98ea22e153f8619aee4f67f9fd11c3fccf56b473bb1ffa
data/CHANGELOG.md CHANGED
@@ -5,12 +5,124 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.7.1] - 2026-05-31
9
+
10
+
11
+ ### Documentation
12
+
13
+ - document google search console credentials
14
+
15
+
16
+
17
+
18
+ ### Fixed
19
+
20
+ - preserve release changelog history ([#13](https://github.com/ethos-link/indexmap/pull/13))
21
+
22
+ - improve sitemap create output ([#14](https://github.com/ethos-link/indexmap/pull/14))
23
+
24
+
25
+
8
26
  ## [0.7.0] - 2026-05-08
9
27
 
10
28
 
11
29
  ### Fixed
12
30
 
13
- - avoid rewriting existing IndexNow key files (#11)
31
+ - avoid rewriting existing IndexNow key files ([#11](https://github.com/ethos-link/indexmap/pull/11))
32
+
33
+
34
+
35
+ ## [0.6.0] - 2026-05-01
36
+
37
+
38
+ ### Added
39
+
40
+ - add the url count to google ping output ([#9](https://github.com/ethos-link/indexmap/pull/9))
41
+
42
+ - support named sitemap outputs ([#10](https://github.com/ethos-link/indexmap/pull/10))
43
+
44
+
45
+
46
+ ## [0.5.0] - 2026-04-24
47
+
48
+
49
+ ### Fixed
50
+
51
+ - namespace rake tasks and harden sitemap validation ([#8](https://github.com/ethos-link/indexmap/pull/8))
52
+
53
+
54
+
55
+ ## [0.4.2] - 2026-04-23
56
+
57
+
58
+ ### Fixed
59
+
60
+ - harden sitemap pinging and indexnow key handling ([#7](https://github.com/ethos-link/indexmap/pull/7))
61
+
62
+
63
+
64
+ ## [0.4.1] - 2026-04-22
65
+
66
+
67
+ ### Added
68
+
69
+ - add output to ping tasks ([#6](https://github.com/ethos-link/indexmap/pull/6))
70
+
71
+
72
+
73
+ ## [0.4.0] - 2026-04-22
74
+
75
+
76
+ ### Documentation
77
+
78
+ - improve the task messages ([#4](https://github.com/ethos-link/indexmap/pull/4))
79
+
80
+
81
+
82
+ ## [0.3.1] - 2026-04-22
83
+
84
+
85
+ ### Fixed
86
+
87
+ - fix changelog generation ([#2](https://github.com/ethos-link/indexmap/pull/2))
88
+
89
+ - harden indexmap runtime defaults and test coverage ([#3](https://github.com/ethos-link/indexmap/pull/3))
90
+
91
+
92
+
93
+ ## [0.3.0] - 2026-04-22
94
+
95
+
96
+ ### Added
97
+
98
+ - expand indexmap with sitemap parsing, validation, and search engine pinging
99
+
100
+
101
+
102
+ ## [0.2.1] - 2026-04-21
103
+
104
+
105
+ ### Fixed
106
+
107
+ - publish built gem in release workflow
108
+
109
+
110
+
111
+ ## [0.2.0] - 2026-04-21
112
+
113
+
114
+ ### Added
115
+
116
+ - add single-file sitemap mode
117
+
118
+
119
+
120
+ ## [0.1.0] - 2026-04-21
121
+
122
+
123
+ ### Added
124
+
125
+ - bootstrap indexmap gem
14
126
 
15
127
 
16
128
 
data/README.md CHANGED
@@ -38,6 +38,13 @@ Upgrading an existing app? Read [UPGRADE.md](UPGRADE.md) before deploying,
38
38
  especially if the app uses custom storage or stores sitemap files under a
39
39
  directory prefix such as `sitemaps/`.
40
40
 
41
+ ## Documentation
42
+
43
+ - [Search engine ping](docs/search-engine-ping.md): Google Search Console
44
+ credentials, Google property configuration, and IndexNow key setup.
45
+ - [UPGRADE.md](UPGRADE.md): host-app migration steps for public contract
46
+ changes.
47
+
41
48
  ## Ruby Usage
42
49
 
43
50
  ```ruby
@@ -276,6 +283,8 @@ The built-in validator checks for:
276
283
  ## Search Engine Ping
277
284
 
278
285
  `indexmap` can ping Google Search Console and IndexNow after sitemap generation.
286
+ See [Search engine ping](docs/search-engine-ping.md) for Google credential
287
+ setup, Search Console property configuration, and IndexNow key provisioning.
279
288
 
280
289
  Available rake tasks:
281
290
 
@@ -287,77 +296,9 @@ bin/rails indexmap:index_now:write_key
287
296
  bin/rails indexmap:ping
288
297
  ```
289
298
 
290
- ### Google Search Console
291
-
292
- Google pinging requires service account credentials:
293
-
294
- ```ruby
295
- Indexmap.configure do |config|
296
- config.google.credentials = -> { ENV["GOOGLE_SITEMAP"] }
297
- end
298
- ```
299
-
300
- If `config.google.credentials` is blank, `indexmap:google:ping` skips Google submission.
301
-
302
- You can optionally override the Search Console property identifier:
303
-
304
- ```ruby
305
- Indexmap.configure do |config|
306
- config.google.credentials = -> { ENV["GOOGLE_SITEMAP"] }
307
- config.google.property = -> { "sc-domain:example.com" }
308
- end
309
- ```
310
-
311
- If `config.google.property` is not set, `indexmap` defaults to `sc-domain:<host>`.
312
-
313
- ### IndexNow
314
-
315
- IndexNow submission requires a key. `indexmap` supports two ways to provide it:
316
-
317
- - set `config.index_now.key`
318
- - or keep a valid verification file in the configured storage as `<key>.txt`
319
-
320
- Configured-key example:
321
-
322
- ```ruby
323
- Indexmap.configure do |config|
324
- config.index_now.key = -> { ENV["INDEXNOW_KEY"] }
325
- end
326
- ```
327
-
328
- If `config.index_now.key` is set, `indexmap:sitemap:create` also ensures the matching `<key>.txt` verification file exists in storage. It leaves an existing valid key file unchanged.
329
-
330
- If you need a non-standard verification filename, configure it explicitly:
331
-
332
- ```ruby
333
- Indexmap.configure do |config|
334
- config.index_now.key = -> { ENV["INDEXNOW_KEY"] }
335
- config.index_now.key_filename = -> { "#{ENV.fetch("INDEXNOW_KEY")}.txt" }
336
- end
337
- ```
338
-
339
- You can also disable automatic key-file writes entirely:
340
-
341
- ```ruby
342
- Indexmap.configure do |config|
343
- config.index_now.key = -> { ENV["INDEXNOW_KEY"] }
344
- config.index_now.write_key_file = false
345
- end
346
- ```
347
-
348
- If you prefer the file-based flow, run:
349
-
350
- ```bash
351
- bin/rails indexmap:index_now:write_key
352
- ```
353
-
354
- That task:
355
-
356
- - reuses an existing valid key file when present
357
- - otherwise generates a new key in `<key>.txt`
358
- - makes that key available to `indexmap:index_now:ping` without adding `config.index_now.key`
359
-
360
- If neither a configured key nor a valid key file is present, `indexmap:index_now:ping` skips IndexNow submission.
299
+ If Google credentials are blank, `indexmap:google:ping` skips Google
300
+ submission. If neither a configured IndexNow key nor a valid key file is
301
+ present, `indexmap:index_now:ping` skips IndexNow submission.
361
302
 
362
303
  ## Development
363
304
 
@@ -385,7 +326,12 @@ Note: `Gemfile.lock` is intentionally not tracked for this gem, following normal
385
326
 
386
327
  ### Git hooks
387
328
 
388
- We use [lefthook](https://lefthook.dev/) with the Ruby [commitlint](https://github.com/arandilopez/commitlint) gem to enforce Conventional Commits on every commit. We also use [Standard Ruby](https://standardrb.com/) to keep code style consistent. CI validates commit messages, Standard Ruby, tests, and git-cliff changelog generation on pull requests and pushes to main/master.
329
+ We use [lefthook](https://lefthook.dev/) with the Ruby
330
+ [commitlint](https://github.com/arandilopez/commitlint) gem to enforce
331
+ Conventional Commits on every commit. We also use
332
+ [Standard Ruby](https://standardrb.com/) to keep code style consistent. CI
333
+ validates commit messages, Standard Ruby, tests, and git-cliff changelog
334
+ generation on pull requests and pushes to main/master.
389
335
 
390
336
  Run the hook installer once per clone:
391
337
 
@@ -395,11 +341,16 @@ bundle exec lefthook install
395
341
 
396
342
  ## Release
397
343
 
398
- Releases are tag-driven and published by GitHub Actions to RubyGems. Local release commands never publish directly.
344
+ Releases are tag-driven and published by GitHub Actions to RubyGems.
345
+ Local release commands never publish directly.
399
346
 
400
- Install [git-cliff](https://git-cliff.org/) locally before preparing a release. The release task regenerates `CHANGELOG.md` from Conventional Commits.
347
+ Install [git-cliff](https://git-cliff.org/) locally before preparing a
348
+ release. The release task prepends the next `CHANGELOG.md` section from
349
+ Conventional Commits.
401
350
 
402
- Before preparing a release, make sure you are on `main` or `master` with a clean worktree.
351
+ Before preparing a release, make sure you are on `main` or `master` with a
352
+ clean worktree. If the release contains a breaking public-contract change,
353
+ update `UPGRADE.md` with the host-app migration steps first.
403
354
 
404
355
  Then run one of:
405
356
 
@@ -412,12 +363,13 @@ bundle exec rake 'release:prepare[0.1.0]'
412
363
 
413
364
  The task will:
414
365
 
415
- 1. Regenerate `CHANGELOG.md` with `git-cliff`.
366
+ 1. Prepend the next `CHANGELOG.md` section with `git-cliff`.
416
367
  1. Update `lib/indexmap/version.rb`.
417
368
  1. Commit the release changes.
418
369
  1. Create and push the `vX.Y.Z` tag.
419
370
 
420
- The `Release` workflow then runs tests, publishes the gem to RubyGems, and creates the GitHub release from the changelog entry.
371
+ The `Release` workflow then runs tests, publishes the gem to RubyGems,
372
+ and creates the GitHub release from the changelog entry.
421
373
 
422
374
  ## License
423
375
 
@@ -13,7 +13,12 @@ module Indexmap
13
13
  index_now_key_filename = write_index_now_key if configuration.index_now.write_key_file?
14
14
  configuration.run_after_create_callbacks
15
15
 
16
- {files: written_files.map(&:to_s), written_files: written_files, index_now_key_filename: index_now_key_filename}
16
+ {
17
+ files: written_files.map(&:to_s),
18
+ written_files: written_files,
19
+ sitemaps: sitemap_details(written_files),
20
+ index_now_key_filename: index_now_key_filename
21
+ }
17
22
  end
18
23
 
19
24
  def format
@@ -60,5 +65,27 @@ module Indexmap
60
65
  def sitemap_files
61
66
  storage.list(prefix: "sitemap", suffix: ".xml")
62
67
  end
68
+
69
+ def sitemap_details(files)
70
+ files.map do |filename|
71
+ {
72
+ filename: filename.to_s,
73
+ location: sitemap_location(filename),
74
+ link_count: sitemap_link_count(filename)
75
+ }
76
+ end
77
+ end
78
+
79
+ def sitemap_location(filename)
80
+ return storage.public_url(filename) if storage.respond_to?(:public_url)
81
+
82
+ filename.to_s
83
+ end
84
+
85
+ def sitemap_link_count(filename)
86
+ document = Nokogiri::XML(storage.read(filename.to_s))
87
+ document.remove_namespaces!
88
+ document.xpath("//loc").count
89
+ end
63
90
  end
64
91
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Indexmap
4
- VERSION = "0.7.0"
4
+ VERSION = "0.7.1"
5
5
  end
@@ -5,7 +5,11 @@ namespace :indexmap do
5
5
  runner = Indexmap::TaskRunner.new
6
6
  create_result = runner.create
7
7
 
8
- puts "Created, formatted, and validated #{file_count(create_result[:files])} in #{storage_description(runner)}."
8
+ puts "Created, formatted, and validated #{file_count(create_result[:files])}."
9
+ puts "Files created:"
10
+ create_result[:sitemaps].each do |sitemap|
11
+ puts " - #{sitemap[:location]} (#{link_count(sitemap[:link_count])})"
12
+ end
9
13
  puts "IndexNow key file: #{create_result[:index_now_key_filename]}" if create_result[:index_now_key_filename]
10
14
  end
11
15
 
@@ -91,6 +95,10 @@ namespace :indexmap do
91
95
  runner.storage
92
96
  end
93
97
 
98
+ def link_count(count)
99
+ "#{count} #{(count == 1) ? "link" : "links"}"
100
+ end
101
+
94
102
  def format_google_ping_failure(failure)
95
103
  case failure[:reason]
96
104
  when :unauthorized
@@ -16,7 +16,7 @@ class IndexmapTaskRunnerTest < Minitest::Test
16
16
  end
17
17
 
18
18
  def test_create_writes_new_sitemap_and_key_file_without_deleting_unrelated_files
19
- storage = Indexmap::Storage::Memory.new
19
+ storage = Indexmap::Storage::Memory.new(public_url: "https://cdn.example.com/sitemaps")
20
20
  storage.write("sitemap-pages.xml.gz", "old")
21
21
  storage.write("sitemap-extra.xml", "existing")
22
22
 
@@ -31,6 +31,18 @@ class IndexmapTaskRunnerTest < Minitest::Test
31
31
  assert_equal VALID_KEY, storage.read("#{VALID_KEY}.txt")
32
32
  assert_equal ["sitemap-pages.xml", "sitemap.xml"], result[:files]
33
33
  assert_equal ["sitemap-pages.xml", "sitemap.xml"], result[:written_files]
34
+ assert_equal [
35
+ {
36
+ filename: "sitemap-pages.xml",
37
+ location: "https://cdn.example.com/sitemaps/sitemap-pages.xml",
38
+ link_count: 1
39
+ },
40
+ {
41
+ filename: "sitemap.xml",
42
+ location: "https://cdn.example.com/sitemaps/sitemap.xml",
43
+ link_count: 1
44
+ }
45
+ ], result[:sitemaps]
34
46
  assert_equal "#{VALID_KEY}.txt", result[:index_now_key_filename]
35
47
  end
36
48
 
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "test_helper"
4
+ require "rake"
5
+
6
+ unless respond_to?(:release_version, true)
7
+ load File.expand_path("../Rakefile", __dir__)
8
+ end
9
+
10
+ class ReleaseTaskTest < Minitest::Test
11
+ def test_release_version_increments_patch_from_current_version
12
+ major, minor, patch = Indexmap::VERSION.split(".").map(&:to_i)
13
+
14
+ assert_equal "#{major}.#{minor}.#{patch + 1}", release_version("patch")
15
+ end
16
+
17
+ def test_release_version_accepts_explicit_semantic_version
18
+ assert_equal "0.3.0", release_version("0.3.0")
19
+ end
20
+
21
+ def test_validate_release_version_rejects_current_version
22
+ error = assert_raises(ArgumentError) do
23
+ validate_release_version!("0.2.7", "0.2.7")
24
+ end
25
+
26
+ assert_equal(
27
+ "Release version 0.2.7 must be newer than current version 0.2.7.",
28
+ error.message
29
+ )
30
+ end
31
+
32
+ def test_validate_release_version_rejects_existing_local_tag
33
+ @local_release_tag_exists = true
34
+ @remote_release_tag_exists = false
35
+
36
+ error = assert_raises(ArgumentError) do
37
+ validate_release_version!("0.2.8", "0.2.7")
38
+ end
39
+
40
+ assert_equal "Release tag v0.2.8 already exists locally.", error.message
41
+ end
42
+
43
+ def test_validate_release_version_rejects_existing_remote_tag
44
+ @local_release_tag_exists = false
45
+ @remote_release_tag_exists = true
46
+
47
+ error = assert_raises(ArgumentError) do
48
+ validate_release_version!("0.2.8", "0.2.7")
49
+ end
50
+
51
+ assert_equal "Release tag v0.2.8 already exists on origin.", error.message
52
+ end
53
+
54
+ def test_remote_release_tag_command_asks_git_to_fail_when_no_tag_matches
55
+ assert_equal(
56
+ "git ls-remote --exit-code --tags origin refs/tags/v0.2.8",
57
+ remote_release_tag_command("v0.2.8")
58
+ )
59
+ end
60
+
61
+ def test_changelog_command_prepends_the_next_release
62
+ assert_equal(
63
+ [
64
+ "git-cliff",
65
+ "-c",
66
+ "cliff.toml",
67
+ "--unreleased",
68
+ "--tag",
69
+ "v0.2.8",
70
+ "--prepend",
71
+ "CHANGELOG.md"
72
+ ],
73
+ changelog_command("0.2.8")
74
+ )
75
+ end
76
+
77
+ private
78
+
79
+ def local_release_tag_exists?(_tag)
80
+ @local_release_tag_exists || false
81
+ end
82
+
83
+ def remote_release_tag_exists?(_tag)
84
+ @remote_release_tag_exists || false
85
+ end
86
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: indexmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Fidalgo
@@ -205,6 +205,7 @@ files:
205
205
  - test/indexmap/task_runner_test.rb
206
206
  - test/indexmap/validator_test.rb
207
207
  - test/indexmap/writer_test.rb
208
+ - test/release_task_test.rb
208
209
  - test/test_helper.rb
209
210
  homepage: https://www.ethos-link.com/opensource/indexmap
210
211
  licenses:
@@ -233,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
234
  - !ruby/object:Gem::Version
234
235
  version: '0'
235
236
  requirements: []
236
- rubygems_version: 4.0.6
237
+ rubygems_version: 4.0.10
237
238
  specification_version: 4
238
239
  summary: Generate sitemap indexes and child sitemaps with plain Ruby
239
240
  test_files: []