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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb1ed58c5dc558d7d7efcb357870fc4764a1d6d5caeb5ddc30e466334c986421
4
- data.tar.gz: 9e90845271e781a0586c30c5c3f2c770b4a0c837474d78e8a19afa89c5b2fb6d
3
+ metadata.gz: 2c7c5616af9b17e185b54274dfa07997d712f93ae37285d1cc9dbe190d289882
4
+ data.tar.gz: a443e0cfdce5c3a1a08bdcc0b53916a6e60631aad5c3ef5c9cc5377e70558383
5
5
  SHA512:
6
- metadata.gz: cd645a628045089499e213491a08157e5268b2238007c86e20eeff996dcb0246037915dce0019554995ade10c57eae31ffc79d1b256a123160f728a7f6e74722
7
- data.tar.gz: d12723425911cc2c6184f6f2f31f8d0dbe6fde8bc021c3c45c0b5490e500906be6f49da74c3457e04778bb6ed0c50438489fd1875191090de702cf6d0ed494f0
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
@@ -3,7 +3,7 @@
3
3
  module Crawlscope
4
4
  class Railtie < Rails::Railtie
5
5
  rake_tasks do
6
- load File.expand_path("../tasks/crawlscope_tasks.rake", __dir__)
6
+ require "crawlscope/tasks"
7
7
  end
8
8
  end
9
9
  end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "crawlscope"
4
+ require "rake"
5
+
6
+ unless Rake::Task.task_defined?("crawlscope:validate")
7
+ load File.expand_path("../tasks/crawlscope_tasks.rake", __dir__)
8
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Crawlscope
4
- VERSION = "0.6.0"
4
+ VERSION = "0.7.0"
5
5
  end
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.6.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.10
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: []