crawlscope 0.7.1 → 0.7.2
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/CHANGELOG.md +9 -0
- data/README.md +12 -3
- data/lib/crawlscope/rake_tasks.rb +2 -2
- data/lib/crawlscope/version.rb +1 -1
- data/test/crawlscope/rake_tasks_test.rb +34 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 18717d5f025a5e0dc10b3f5a231b52d788a7ad09fe017b803815dc1cf22b7f11
|
|
4
|
+
data.tar.gz: 25f80cac563922d3c34d069c34b6c5521064fb4a74dd98cc54f6bb04e6de283a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 322dacf831bfa19dd16a6ebf3917e8d8bcaab462b440468945e4e9e07768a42955afe7f418b217594f9654c22490d32124f6fdb95004a20f23508f76bca6d7db
|
|
7
|
+
data.tar.gz: b301ad0f2c7c92dd3dc436f7019c62d7958bdd402eb8a887626d938a9bfd085d8d21bdab76a5243f3e2d9684d94ffce554e5108db26995d67b63140fcadbb9e2
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,15 @@ 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.2] - 2026-07-23
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- preserve host configuration
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
8
17
|
## [0.7.1] - 2026-07-21
|
|
9
18
|
|
|
10
19
|
|
data/README.md
CHANGED
|
@@ -142,7 +142,8 @@ puts result.issues.to_a.map(&:message)
|
|
|
142
142
|
- `pages`: fetched page snapshots
|
|
143
143
|
- `issues`: structured issues with `code`, `severity`, `category`, `url`, and `message`
|
|
144
144
|
|
|
145
|
-
`result.ok?` returns `false`
|
|
145
|
+
`result.ok?` returns `false` when an error is present. Warnings and notices
|
|
146
|
+
remain available through `result.issues` without making the result fail.
|
|
146
147
|
|
|
147
148
|
## Rails Usage
|
|
148
149
|
|
|
@@ -177,7 +178,10 @@ Crawlscope.configuration.audit
|
|
|
177
178
|
```
|
|
178
179
|
|
|
179
180
|
Rake tasks apply it automatically because `crawlscope/tasks` loads the gem
|
|
180
|
-
before Rails evaluates the initializer.
|
|
181
|
+
before Rails evaluates the initializer. Each Rake entry point passes the shared
|
|
182
|
+
`Crawlscope.configuration` object to the CLI, so configured base URLs, sitemap
|
|
183
|
+
paths, registries, and runtime settings are preserved unless a task argument or
|
|
184
|
+
environment override replaces them.
|
|
181
185
|
|
|
182
186
|
Then run:
|
|
183
187
|
|
|
@@ -220,7 +224,12 @@ bundle exec rake crawlscope:validate:ldjson URL=https://example.com/article
|
|
|
220
224
|
bundle exec rake 'crawlscope:validate:ldjson[https://example.com/article]'
|
|
221
225
|
```
|
|
222
226
|
|
|
223
|
-
`crawlscope:validate` runs all default sitemap rules: indexability, metadata,
|
|
227
|
+
`crawlscope:validate` runs all default sitemap rules: indexability, metadata,
|
|
228
|
+
structured data, uniqueness, content quality, and links. `URL` is the site
|
|
229
|
+
base. Without `SITEMAP`, Crawlscope uses the configured sitemap path, then
|
|
230
|
+
falls back to `/sitemap.xml`. With `SITEMAP`, Crawlscope uses `URL` as the site
|
|
231
|
+
base and validates URLs from that sitemap. `SITEMAP` may be a full URL or a
|
|
232
|
+
local file path.
|
|
224
233
|
|
|
225
234
|
Plain `rake` does not pass `--url` style flags to tasks. Use `URL=...` or the
|
|
226
235
|
task-argument form above instead.
|
|
@@ -16,8 +16,8 @@ module Crawlscope
|
|
|
16
16
|
validate(url: url, sitemap_path: sitemap_path, rule_names: rule)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def run(command, argv: [])
|
|
20
|
-
status = Cli.start([command, *argv], out: $stdout, err: $stderr)
|
|
19
|
+
def run(command, argv: [], configuration: Crawlscope.configuration)
|
|
20
|
+
status = Cli.start([command, *argv], out: $stdout, err: $stderr, configuration: configuration)
|
|
21
21
|
exit(status) unless status.zero?
|
|
22
22
|
end
|
|
23
23
|
|
data/lib/crawlscope/version.rb
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
require "test_helper"
|
|
4
4
|
|
|
5
5
|
class CrawlscopeRakeTasksTest < Minitest::Test
|
|
6
|
+
Rule = Data.define(:code)
|
|
7
|
+
|
|
6
8
|
def setup
|
|
7
9
|
@original_start = Crawlscope::Cli.method(:start)
|
|
8
10
|
end
|
|
@@ -13,6 +15,7 @@ class CrawlscopeRakeTasksTest < Minitest::Test
|
|
|
13
15
|
singleton_class.define_method(:start) do |*args, **kwargs|
|
|
14
16
|
original_start.call(*args, **kwargs)
|
|
15
17
|
end
|
|
18
|
+
Crawlscope.reset!
|
|
16
19
|
end
|
|
17
20
|
|
|
18
21
|
def test_validate_passes_rake_arguments_to_cli
|
|
@@ -56,14 +59,43 @@ class CrawlscopeRakeTasksTest < Minitest::Test
|
|
|
56
59
|
)
|
|
57
60
|
end
|
|
58
61
|
|
|
62
|
+
def test_run_passes_the_shared_configuration_to_cli
|
|
63
|
+
calls = capture_cli_calls
|
|
64
|
+
configuration = Crawlscope.configuration
|
|
65
|
+
|
|
66
|
+
Crawlscope::RakeTasks.run("validate")
|
|
67
|
+
|
|
68
|
+
assert_same configuration, calls.fetch(0).fetch(:kwargs).fetch(:configuration)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def test_validate_passes_the_host_rule_registry_to_cli
|
|
72
|
+
registry = Crawlscope::RuleRegistry.new(rules: [Rule.new(:host)], default_codes: [:host])
|
|
73
|
+
Crawlscope.configure { |configuration| configuration.rule_registry = registry }
|
|
74
|
+
calls = capture_cli_calls
|
|
75
|
+
|
|
76
|
+
Crawlscope::RakeTasks.validate
|
|
77
|
+
|
|
78
|
+
call = calls.fetch(0)
|
|
79
|
+
assert_equal "validate", call.fetch(:argv).first
|
|
80
|
+
assert_same registry, call.fetch(:kwargs).fetch(:configuration).rule_registry
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def test_run_exits_with_a_nonzero_cli_status
|
|
84
|
+
capture_cli_calls(status: 2)
|
|
85
|
+
|
|
86
|
+
error = assert_raises(SystemExit) { Crawlscope::RakeTasks.run("validate") }
|
|
87
|
+
|
|
88
|
+
assert_equal 2, error.status
|
|
89
|
+
end
|
|
90
|
+
|
|
59
91
|
private
|
|
60
92
|
|
|
61
|
-
def capture_cli_calls
|
|
93
|
+
def capture_cli_calls(status: 0)
|
|
62
94
|
calls = []
|
|
63
95
|
singleton_class = class << Crawlscope::Cli; self; end
|
|
64
96
|
singleton_class.define_method(:start) do |argv, **kwargs|
|
|
65
97
|
calls << {argv: argv, kwargs: kwargs}
|
|
66
|
-
|
|
98
|
+
status
|
|
67
99
|
end
|
|
68
100
|
calls
|
|
69
101
|
end
|