crawlscope 0.6.0 → 0.7.0
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 +11 -0
- data/README.md +18 -1
- data/lib/crawlscope/railtie.rb +1 -1
- data/lib/crawlscope/tasks.rb +8 -0
- data/lib/crawlscope/version.rb +1 -1
- data/lib/crawlscope.rb +1 -0
- data/test/crawlscope/loader_test.rb +37 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c7c5616af9b17e185b54274dfa07997d712f93ae37285d1cc9dbe190d289882
|
|
4
|
+
data.tar.gz: a443e0cfdce5c3a1a08bdcc0b53916a6e60631aad5c3ef5c9cc5377e70558383
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f00dbb412e2372bbe757b7fdf84dadc5e7cb05f82f2e254a08a5b8a199020b3cbdceff460ecf37f53a93d9617c769be1673120599edade1f8e9881c5a2a56de7
|
|
7
|
+
data.tar.gz: 462cce5554b2872955c76855bf60a77e93948c1162219ec129b7d3a5e511a3726b73157d33db8a4b9c3a64564e2c69306138b9c0ff62600b67570e1d6fee0403
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ 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.0] - 2026-07-21
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- add commitlint and lefthook
|
|
14
|
+
|
|
15
|
+
- add lazy Rails task entrypoint
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
8
19
|
## [0.6.0] - 2026-06-01
|
|
9
20
|
|
|
10
21
|
|
data/README.md
CHANGED
|
@@ -37,9 +37,13 @@ Crawlscope requires Ruby 3.3 or newer.
|
|
|
37
37
|
Add this line to your application's Gemfile:
|
|
38
38
|
|
|
39
39
|
```ruby
|
|
40
|
-
gem "crawlscope"
|
|
40
|
+
gem "crawlscope", require: false
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
`require: false` keeps Crawlscope and its crawl stack out of normal Rails web
|
|
44
|
+
and job process boot. Require `crawlscope` at the application boundary that
|
|
45
|
+
runs an audit, or use the task setup below.
|
|
46
|
+
|
|
43
47
|
And then execute:
|
|
44
48
|
|
|
45
49
|
```bash
|
|
@@ -142,6 +146,19 @@ puts result.issues.to_a.map(&:message)
|
|
|
142
146
|
|
|
143
147
|
## Rails Usage
|
|
144
148
|
|
|
149
|
+
For an app that uses Crawlscope through rake tasks, load the task entrypoint
|
|
150
|
+
only when a Crawlscope task is requested. In the application's `Rakefile`,
|
|
151
|
+
before `require_relative "config/application"`:
|
|
152
|
+
|
|
153
|
+
```ruby
|
|
154
|
+
list_tasks = Rake.application.options.show_tasks || ARGV.any? { |argument| ["-T", "--tasks"].include?(argument) }
|
|
155
|
+
require "crawlscope/tasks" if list_tasks || ARGV.any? { |argument| argument.start_with?("crawlscope:") }
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
This preserves `bin/rails --tasks` and the `crawlscope:*` tasks without loading
|
|
159
|
+
Crawlscope during normal Rails boot. Runtime callers should explicitly
|
|
160
|
+
`require "crawlscope"` immediately before configuring or using the gem.
|
|
161
|
+
|
|
145
162
|
In an initializer:
|
|
146
163
|
|
|
147
164
|
```ruby
|
data/lib/crawlscope/railtie.rb
CHANGED
data/lib/crawlscope/version.rb
CHANGED
data/lib/crawlscope.rb
CHANGED
|
@@ -29,6 +29,7 @@ end
|
|
|
29
29
|
Crawlscope.instance_variable_set(:@loader, Zeitwerk::Loader.for_gem)
|
|
30
30
|
Crawlscope.loader.ignore("#{__dir__}/tasks")
|
|
31
31
|
Crawlscope.loader.ignore("#{__dir__}/crawlscope/railtie.rb")
|
|
32
|
+
Crawlscope.loader.ignore("#{__dir__}/crawlscope/tasks.rb")
|
|
32
33
|
Crawlscope.loader.setup
|
|
33
34
|
|
|
34
35
|
require "crawlscope/railtie" if defined?(Rails::Railtie)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "test_helper"
|
|
4
|
+
require "open3"
|
|
5
|
+
require "rbconfig"
|
|
4
6
|
|
|
5
7
|
class CrawlscopeLoaderTest < Minitest::Test
|
|
6
8
|
def test_eager_loads_cleanly
|
|
@@ -8,4 +10,39 @@ class CrawlscopeLoaderTest < Minitest::Test
|
|
|
8
10
|
Crawlscope.loader.eager_load
|
|
9
11
|
end
|
|
10
12
|
end
|
|
13
|
+
|
|
14
|
+
def test_entrypoint_does_not_load_crawl_dependencies
|
|
15
|
+
script = <<~RUBY
|
|
16
|
+
require "crawlscope"
|
|
17
|
+
|
|
18
|
+
loaded = $LOADED_FEATURES.grep(%r{/(?:async|faraday|json-schema|nokogiri)(?:/|\\.rb)})
|
|
19
|
+
abort loaded.join("\\n") unless loaded.empty?
|
|
20
|
+
RUBY
|
|
21
|
+
|
|
22
|
+
_stdout, stderr, status = Open3.capture3(
|
|
23
|
+
RbConfig.ruby,
|
|
24
|
+
"-I#{File.expand_path("../../lib", __dir__)}",
|
|
25
|
+
"-e",
|
|
26
|
+
script
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
assert status.success?, stderr
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def test_task_entrypoint_registers_tasks
|
|
33
|
+
script = <<~RUBY
|
|
34
|
+
require "crawlscope/tasks"
|
|
35
|
+
|
|
36
|
+
abort "task missing" unless Rake::Task.task_defined?("crawlscope:validate")
|
|
37
|
+
RUBY
|
|
38
|
+
|
|
39
|
+
_stdout, stderr, status = Open3.capture3(
|
|
40
|
+
RbConfig.ruby,
|
|
41
|
+
"-I#{File.expand_path("../../lib", __dir__)}",
|
|
42
|
+
"-e",
|
|
43
|
+
script
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
assert status.success?, stderr
|
|
47
|
+
end
|
|
11
48
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: crawlscope
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Paulo Fidalgo
|
|
@@ -256,6 +256,7 @@ files:
|
|
|
256
256
|
- lib/crawlscope/structured_data/report.rb
|
|
257
257
|
- lib/crawlscope/structured_data/reporter.rb
|
|
258
258
|
- lib/crawlscope/structured_data/writer.rb
|
|
259
|
+
- lib/crawlscope/tasks.rb
|
|
259
260
|
- lib/crawlscope/url.rb
|
|
260
261
|
- lib/crawlscope/version.rb
|
|
261
262
|
- lib/tasks/crawlscope_tasks.rake
|
|
@@ -318,7 +319,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
318
319
|
- !ruby/object:Gem::Version
|
|
319
320
|
version: '0'
|
|
320
321
|
requirements: []
|
|
321
|
-
rubygems_version: 4.0.
|
|
322
|
+
rubygems_version: 4.0.16
|
|
322
323
|
specification_version: 4
|
|
323
324
|
summary: Audit sitemap URLs for metadata, structured data, uniqueness, and links
|
|
324
325
|
test_files: []
|