-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump html-pipeline from 3.0.3 to 3.2.1 #656
Open
dependabot
wants to merge
1
commit into
main
Choose a base branch
from
dependabot/bundler/html-pipeline-3.2.1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem compare html-pipeline 3.0.3 3.2.1 Compared versions: ["3.0.3", "3.2.1"]
DIFFERENT date:
3.0.3: 2024-02-02 00:00:00 UTC
3.2.1: 2024-07-31 00:00:00 UTC
DIFFERENT rubygems_version:
3.0.3: 3.5.5
3.2.1: 3.4.6
DIFFERENT version:
3.0.3: 3.0.3
3.2.1: 3.2.1
DIFFERENT files:
3.0.3->3.2.1:
* Changed:
.github/workflows/publish.yml +7/-2
CHANGELOG.md +104/-52
Gemfile +1/-3
README.md +26/-13
UPGRADING.md +0/-2
html-pipeline.gemspec +1/-1
lib/html_pipeline.rb +17/-11
lib/html_pipeline/convert_filter.rb +1/-1
lib/html_pipeline/convert_filter/markdown_filter.rb +4/-4
lib/html_pipeline/filter.rb +1/-1
lib/html_pipeline/node_filter.rb +2/-0
lib/html_pipeline/node_filter/syntax_highlight_filter.rb +1/-1
lib/html_pipeline/text_filter.rb +8/-8
lib/html_pipeline/text_filter/image_filter.rb +2/-2
lib/html_pipeline/text_filter/plain_text_input_filter.rb +2/-2
lib/html_pipeline/version.rb +1/-1
DIFFERENT runtime dependencies:
3.0.3->3.2.1:
* Updated:
selma from: ["~> 0.1"] to: ["~> 0.4"]
DIFFERENT Gemfile dependencies
3.0.3->3.2.1:
* Deleted
github_changelog_generator ["~> 1.16"] (runtime)
* Updated
commonmarker from: ["~> 1.0.0.pre7"] to: ["~> 1.1.2"] |
gem compare --diff html-pipeline 3.0.3 3.2.1 Compared versions: ["3.0.3", "3.2.1"]
DIFFERENT files:
3.0.3->3.2.1:
* Changed:
.github/workflows/publish.yml
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/.github/workflows/publish.yml 2024-08-01 02:40:31.088558873 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/.github/workflows/publish.yml 2024-08-01 02:40:31.092558935 +0000
@@ -1 +1 @@
-name: Release
+name: Tag and Release
@@ -9,0 +10,3 @@
+ pull_request_target:
+ types:
+ - closed
@@ -16 +19 @@
- gh_token: ${{ secrets.PUBLIC_PUSH_TO_PROTECTED_BRANCH }}
+ gh_token: ${{ secrets.GITHUB_TOKEN }}
@@ -19,0 +23,2 @@
+ prepare: ${{ github.event_name == 'push' }}
+ release: ${{ github.event_name == 'workflow_dispatch' || ((github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'release'))) }}
CHANGELOG.md
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/CHANGELOG.md 2024-08-01 02:40:31.088558873 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/CHANGELOG.md 2024-08-01 02:40:31.096558997 +0000
@@ -0,0 +1,42 @@
+# [v3.2.1] - 16-07-2024
+## What's Changed
+* Update commonmarker requirement from ~> 1.0.0.pre7 to ~> 1.1.2 in the bundler-dependencies group by @dependabot in https://github.com/gjtorikian/html-pipeline/pull/404
+* Remove superfluous sanitization by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/408
+
+
+**Full Changelog**: https://github.com/gjtorikian/html-pipeline/compare/v3.2.0...v3.2.1
+## [v3.2.0] - 30-04-2024
+## What's Changed
+* Pass context along to every part of the pipeline by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/403
+
+
+**Full Changelog**: https://github.com/gjtorikian/html-pipeline/compare/v3.1.1...v3.2.0
+## [v3.1.1] - 09-04-2024
+## What's Changed
+* Correct missing method implementation by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/401
+
+
+**Full Changelog**: https://github.com/gjtorikian/html-pipeline/compare/v3.1.0...v3.1.1
+## [v3.1.0] - 28-02-2024
+## What's Changed
+* UPGRADING: not removed by @dentarg in https://github.com/gjtorikian/html-pipeline/pull/397
+* [BREAKING] now requires instantiation by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/398
+
+## New Contributors
+* @dentarg made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/397
+
+**Full Changelog**: https://github.com/gjtorikian/html-pipeline/compare/v3.0.3...v3.1.0
+## [v3.0.3] - 02-02-2024
+
+## What's Changed
+
+- Fix typo in README by @ppworks in https://github.com/gjtorikian/html-pipeline/pull/394
+- Prevent exception by @ppworks in https://github.com/gjtorikian/html-pipeline/pull/395
+- Cut 3.0.3 by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/396
+
+## New Contributors
+
+- @ppworks made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/394
+
+**Full Changelog**: https://github.com/gjtorikian/html-pipeline/compare/v3.0.2...v3.0.3
+
@@ -1,0 +44 @@
+
@@ -3,2 +46,3 @@
-* README.md: Fix example code by @grekko in https://github.com/gjtorikian/html-pipeline/pull/390
-* Allow pipeline to run without node filters by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/392
+
+- README.md: Fix example code by @grekko in https://github.com/gjtorikian/html-pipeline/pull/390
+- Allow pipeline to run without node filters by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/392
@@ -7 +51,2 @@
-* @grekko made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/390
+
+- @grekko made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/390
@@ -9,0 +55 @@
+
@@ -10,0 +57 @@
+
@@ -12 +59,2 @@
-* Handle odd numbers of NodeFilters to be configured by @stevehill1981 in https://github.com/gjtorikian/html-pipeline/pull/389
+
+- Handle odd numbers of NodeFilters to be configured by @stevehill1981 in https://github.com/gjtorikian/html-pipeline/pull/389
@@ -15 +63,2 @@
-* @stevehill1981 made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/389
+
+- @stevehill1981 made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/389
@@ -17,0 +67 @@
+
@@ -18,0 +69 @@
+
@@ -20,20 +71,21 @@
-* Switch to GitHub Actions by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/346
-* add truffleruby-head by @gogainda in https://github.com/gjtorikian/html-pipeline/pull/348
-* Add Rubocop by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/349
-* Support multiple dependencies per filter by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/351
-* Split filters up by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/360
-* Migrate from Nokogiri to Selma by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/368
-* You shall pass by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/369
-* Update Selma signatures by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/370
-* Close sanitization-related issues by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/371
-* Drop SyntaxHighlightFilter by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/372
-* V3 Release by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/347
-* Use emoji from commonmarker by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/373
-* req convert_filter if filter present by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/375
-* Update selma requirement from ~> 0.0.1 to >= 0.0.1, < 0.2.0 by @dependabot in https://github.com/gjtorikian/html-pipeline/pull/377
-* Add the AssetProxyFilter by @digitalmoksha in https://github.com/gjtorikian/html-pipeline/pull/379
-* Update rouge requirement from ~> 3.1 to ~> 4.1 by @dependabot in https://github.com/gjtorikian/html-pipeline/pull/381
-* Update gemoji requirement from ~> 3.0 to ~> 4.1 by @dependabot in https://github.com/gjtorikian/html-pipeline/pull/382
-* Have Zeitwerk not automatically load filters by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/383
-* Bump the github-actions group with 1 update by @dependabot in https://github.com/gjtorikian/html-pipeline/pull/384
-* :gem: 3.0.0 by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/386
+
+- Switch to GitHub Actions by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/346
+- add truffleruby-head by @gogainda in https://github.com/gjtorikian/html-pipeline/pull/348
+- Add Rubocop by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/349
+- Support multiple dependencies per filter by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/351
+- Split filters up by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/360
+- Migrate from Nokogiri to Selma by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/368
+- You shall pass by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/369
+- Update Selma signatures by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/370
+- Close sanitization-related issues by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/371
+- Drop SyntaxHighlightFilter by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/372
+- V3 Release by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/347
+- Use emoji from commonmarker by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/373
+- req convert_filter if filter present by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/375
+- Update selma requirement from ~> 0.0.1 to >= 0.0.1, < 0.2.0 by @dependabot in https://github.com/gjtorikian/html-pipeline/pull/377
+- Add the AssetProxyFilter by @digitalmoksha in https://github.com/gjtorikian/html-pipeline/pull/379
+- Update rouge requirement from ~> 3.1 to ~> 4.1 by @dependabot in https://github.com/gjtorikian/html-pipeline/pull/381
+- Update gemoji requirement from ~> 3.0 to ~> 4.1 by @dependabot in https://github.com/gjtorikian/html-pipeline/pull/382
+- Have Zeitwerk not automatically load filters by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/383
+- Bump the github-actions group with 1 update by @dependabot in https://github.com/gjtorikian/html-pipeline/pull/384
+- :gem: 3.0.0 by @gjtorikian in https://github.com/gjtorikian/html-pipeline/pull/386
@@ -42,3 +94,4 @@
-* @gogainda made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/348
-* @dependabot made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/377
-* @digitalmoksha made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/379
+
+- @gogainda made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/348
+- @dependabot made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/377
+- @digitalmoksha made their first contribution in https://github.com/gjtorikian/html-pipeline/pull/379
@@ -46,0 +100 @@
+
@@ -47,0 +102 @@
+
@@ -48,0 +104 @@
+
@@ -79 +135 @@
-- req convert\_filter if `text/node`filter present [\#375](https://github.com/gjtorikian/html-pipeline/pull/375) ([gjtorikian](https://github.com/gjtorikian))
+- req convert_filter if `text/node`filter present [\#375](https://github.com/gjtorikian/html-pipeline/pull/375) ([gjtorikian](https://github.com/gjtorikian))
@@ -140 +196 @@
-- Replace EscapeUtils.escape\_html with CGI.escape\_html [\#365](https://github.com/gjtorikian/html-pipeline/pull/365) ([ramhoj](https://github.com/ramhoj))
+- Replace EscapeUtils.escape_html with CGI.escape_html [\#365](https://github.com/gjtorikian/html-pipeline/pull/365) ([ramhoj](https://github.com/ramhoj))
@@ -312 +368 @@
-- New feature request for hashtags \# filter [\#301](https://github.com/gjtorikian/html-pipeline/issues/301)
+- New feature request for hashtags \# filter [\#301](https://github.com/gjtorikian/html-pipeline/issues/301)
@@ -415 +471 @@
-- add korgi to 3rd party extensions \[ci skip\] [\#271](https://github.com/gjtorikian/html-pipeline/pull/271) ([jodeci](https://github.com/jodeci))
+- add korgi to 3rd party extensions \[ci skip\] [\#271](https://github.com/gjtorikian/html-pipeline/pull/271) ([jodeci](https://github.com/jodeci))
@@ -424 +480 @@
-- Missing context keys for HTML::Pipeline::EmojiFilter: :asset\_root [\#262](https://github.com/gjtorikian/html-pipeline/issues/262)
+- Missing context keys for HTML::Pipeline::EmojiFilter: :asset_root [\#262](https://github.com/gjtorikian/html-pipeline/issues/262)
@@ -507,2 +563,2 @@
-- Fix for calling mention\_link\_filter with only one argument [\#230](https://github.com/gjtorikian/html-pipeline/pull/230) ([benbalter](https://github.com/benbalter))
-- Add html-pipeline-linkify\_github to 3rd Party Extensions \[ci skip\] [\#228](https://github.com/gjtorikian/html-pipeline/pull/228) ([JuanitoFatas](https://github.com/JuanitoFatas))
+- Fix for calling mention_link_filter with only one argument [\#230](https://github.com/gjtorikian/html-pipeline/pull/230) ([benbalter](https://github.com/benbalter))
+- Add html-pipeline-linkify_github to 3rd Party Extensions \[ci skip\] [\#228](https://github.com/gjtorikian/html-pipeline/pull/228) ([JuanitoFatas](https://github.com/JuanitoFatas))
@@ -564 +620 @@
-- MentionFilter base\_url config question [\#161](https://github.com/gjtorikian/html-pipeline/issues/161)
+- MentionFilter base_url config question [\#161](https://github.com/gjtorikian/html-pipeline/issues/161)
@@ -576,2 +632,2 @@
-- Add 3rd party gem: html-pipeline-rouge\_filter. [\#174](https://github.com/gjtorikian/html-pipeline/pull/174) ([JuanitoFatas](https://github.com/JuanitoFatas))
-- MentionFilter\#link\_to\_mentioned\_user: Replace String introspection with Regexp match [\#172](https://github.com/gjtorikian/html-pipeline/pull/172) ([simeonwillbanks](https://github.com/simeonwillbanks))
+- Add 3rd party gem: html-pipeline-rouge_filter. [\#174](https://github.com/gjtorikian/html-pipeline/pull/174) ([JuanitoFatas](https://github.com/JuanitoFatas))
+- MentionFilter\#link_to_mentioned_user: Replace String introspection with Regexp match [\#172](https://github.com/gjtorikian/html-pipeline/pull/172) ([simeonwillbanks](https://github.com/simeonwillbanks))
@@ -579 +635 @@
-- Implement new context option: ignored\_ancestor\_tags to accept more ignored tags. [\#170](https://github.com/gjtorikian/html-pipeline/pull/170) ([JuanitoFatas](https://github.com/JuanitoFatas))
+- Implement new context option: ignored_ancestor_tags to accept more ignored tags. [\#170](https://github.com/gjtorikian/html-pipeline/pull/170) ([JuanitoFatas](https://github.com/JuanitoFatas))
@@ -596 +652 @@
-- @mention\_filter should not replace mentions in style blocks. [\#143](https://github.com/gjtorikian/html-pipeline/issues/143)
+- @mention_filter should not replace mentions in style blocks. [\#143](https://github.com/gjtorikian/html-pipeline/issues/143)
@@ -603 +659 @@
-- Prefer http\_url in HttpsFilter [\#142](https://github.com/gjtorikian/html-pipeline/pull/142) ([bkeepers](https://github.com/bkeepers))
+- Prefer http_url in HttpsFilter [\#142](https://github.com/gjtorikian/html-pipeline/pull/142) ([bkeepers](https://github.com/bkeepers))
@@ -635 +691 @@
-- Remove RUBY\_VERSION conditionals from gemspec [\#130](https://github.com/gjtorikian/html-pipeline/pull/130) ([mislav](https://github.com/mislav))
+- Remove RUBY_VERSION conditionals from gemspec [\#130](https://github.com/gjtorikian/html-pipeline/pull/130) ([mislav](https://github.com/mislav))
@@ -662 +718 @@
-- AutolinkFilter link\_attr doesn't seem to work [\#114](https://github.com/gjtorikian/html-pipeline/issues/114)
+- AutolinkFilter link_attr doesn't seem to work [\#114](https://github.com/gjtorikian/html-pipeline/issues/114)
@@ -750 +806 @@
-- Add link\_attr option to Autolink filter [\#89](https://github.com/gjtorikian/html-pipeline/pull/89) ([excid3](https://github.com/excid3))
+- Add link_attr option to Autolink filter [\#89](https://github.com/gjtorikian/html-pipeline/pull/89) ([excid3](https://github.com/excid3))
@@ -752 +808 @@
-- use xml\_mini extracted from activesupport [\#85](https://github.com/gjtorikian/html-pipeline/pull/85) ([mojavelinux](https://github.com/mojavelinux))
+- use xml_mini extracted from activesupport [\#85](https://github.com/gjtorikian/html-pipeline/pull/85) ([mojavelinux](https://github.com/mojavelinux))
@@ -820 +876 @@
-- Allow passing skip\_tags in autolink filter context [\#65](https://github.com/gjtorikian/html-pipeline/pull/65) ([pengwynn](https://github.com/pengwynn))
+- Allow passing skip_tags in autolink filter context [\#65](https://github.com/gjtorikian/html-pipeline/pull/65) ([pengwynn](https://github.com/pengwynn))
@@ -873 +929 @@
-- add result\[:mentioned\_usernames\] for MentionFilter [\#42](https://github.com/gjtorikian/html-pipeline/pull/42) ([fahchen](https://github.com/fahchen))
+- add result\[:mentioned_usernames\] for MentionFilter [\#42](https://github.com/gjtorikian/html-pipeline/pull/42) ([fahchen](https://github.com/fahchen))
@@ -889 +945 @@
-- Bump escape\_utils [\#41](https://github.com/gjtorikian/html-pipeline/pull/41) ([brianmario](https://github.com/brianmario))
+- Bump escape_utils [\#41](https://github.com/gjtorikian/html-pipeline/pull/41) ([brianmario](https://github.com/brianmario))
@@ -981,4 +1036,0 @@
-
-
-
-\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
Gemfile
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/Gemfile 2024-08-01 02:40:31.088558873 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/Gemfile 2024-08-01 02:40:31.096558997 +0000
@@ -13,2 +12,0 @@
-gem "github_changelog_generator", "~> 1.16"
-
@@ -30 +28 @@
- gem "commonmarker", "~> 1.0.0.pre7", require: false
+ gem "commonmarker", "~> 1.1.2", require: false
README.md
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/README.md 2024-08-01 02:40:31.088558873 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/README.md 2024-08-01 02:40:31.096558997 +0000
@@ -3,3 +2,0 @@
-> **Note**
-> This README refers to the behavior in the new 3.0.0.pre gem.
-
@@ -63 +60 @@
-As an example, suppose we want to transform Commonmark source text into Markdown HTML. With the content, we also want to:
+As an example, suppose we want to transform Commonmark source text into Markdown HTML:
@@ -65 +62,7 @@
-- change every instance of `$NAME` to "`Johnny"
+```
+Hey there, @gjtorikian
+```
+
+With the content, we also want to:
+
+- change every instance of `Hey` to `Hello`
@@ -76 +79 @@
- text.gsub("$NAME", "Johnny")
+ text.gsub("Hey", "Hello")
@@ -107 +110 @@
-context = { markdown: { extensions: { footnotes: false } } }
+context = { markdown: { extensions: { footnotes: false } } }
@@ -111,0 +115,10 @@
+Alternatively, you can construct a pipeline, and pass in a context during the call:
+
+```ruby
+pipeline = HTMLPipeline.new(
+ convert_filter: HTMLPipeline::ConvertFilter::MarkdownFilter.new,
+ node_filters: [HTMLPipeline::NodeFilter::MentionFilter.new]
+)
+pipeline.call(user_supplied_text, context: { markdown: { extensions: { footnotes: false } } })
+```
+
@@ -161 +174 @@
-Because the web can be a scary place, HTML is automatically sanitized after the `ConvertFilter` runs and before the `NodeFilter`s are processed. This is to prevent malicious or unexpected input from entering the pipeline.
+Because the web can be a scary place, **HTML is automatically sanitized** after the `ConvertFilter` runs and before the `NodeFilter`s are processed. This is to prevent malicious or unexpected input from entering the pipeline.
@@ -163 +176 @@
-The sanitization process takes a hash configuration of settings. See the [Selma](https://www.github.com/gjtorikian/selma) documentation for more information on how to configure these settings.
+The sanitization process takes a hash configuration of settings. See the [Selma](https://www.github.com/gjtorikian/selma) documentation for more information on how to configure these settings. Note that users must correctly configure the sanitization configuration if they expect to use it correctly in conjunction with handlers which manipulate HTML.
@@ -174 +187 @@
- HTMLPipeline::MarkdownFilter,
+ HTMLPipeline::TextFilter::ImageFilter.new,
@@ -202 +215 @@
- HTMLPipeline::MarkdownFilter,
+ HTMLPipeline::TextFilter::ImageFilter.new,
@@ -214 +227 @@
-`NodeFilter` also has an optional method, `after_initialize`, which is run after the filter initializes. This can be useful in setting up a custom state for `result` to take advantage of.
+`NodeFilter` also has an optional method, `after_initialize`, which is run after the filter initializes. This can be useful in setting up a fresh custom state for `result` to start from each time the pipeline is called.
@@ -378 +391 @@
-config = HTMLPipeline::SanitizationFilter::DEFAULT_CONFIG.dup
+config = HTMLPipeline::SanitizationFilter::DEFAULT_CONFIG.deep_dup
UPGRADING.md
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/UPGRADING.md 2024-08-01 02:40:31.088558873 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/UPGRADING.md 2024-08-01 02:40:31.096558997 +0000
@@ -17 +16,0 @@
-
@@ -20 +18,0 @@
-- `TextFilter`
html-pipeline.gemspec
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/html-pipeline.gemspec 2024-08-01 02:40:31.088558873 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/html-pipeline.gemspec 2024-08-01 02:40:31.096558997 +0000
@@ -28 +28 @@
- gem.add_dependency("selma", "~> 0.1")
+ gem.add_dependency("selma", "~> 0.4")
lib/html_pipeline.rb
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/lib/html_pipeline.rb 2024-08-01 02:40:31.092558935 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/lib/html_pipeline.rb 2024-08-01 02:40:31.096558997 +0000
@@ -156 +156 @@
- text_filters: @text_filters.map(&:name),
+ text_filters: @text_filters.map { |f| f.class.name },
@@ -163 +163 @@
- perform_filter(filter, doc, context: context, result: result)
+ perform_filter(filter, doc, context: (filter.context || {}).merge(context), result: result)
@@ -174 +174 @@
- html = @convert_filter.call(text)
+ html = @convert_filter.call(text, context: (@convert_filter.context || {}).merge(context))
@@ -178 +178,11 @@
- unless @node_filters.empty?
+ rewriter_options = {
+ memory: {
+ max_allowed_memory_usage: 5242880, # arbitrary limit of 5MB
+ },
+ }
+
+ if @node_filters.empty?
+ instrument("sanitization.html_pipeline", payload) do
+ result[:output] = Selma::Rewriter.new(sanitizer: @sanitization_config, handlers: @node_filters, options: rewriter_options).rewrite(html)
+ end unless @convert_filter.nil? # no html, so no sanitization
+ else
@@ -180,2 +190,2 @@
- result[:output] = Selma::Rewriter.new(sanitizer: @sanitization_config, handlers: @node_filters).rewrite(html)
- html = result[:output]
+ @node_filters.each { |filter| filter.context = (filter.context || {}).merge(context) }
+ result[:output] = Selma::Rewriter.new(sanitizer: @sanitization_config, handlers: @node_filters, options: rewriter_options).rewrite(html)
@@ -190,4 +199,0 @@
- instrument("html_pipeline.sanitization", payload) do
- result[:output] = Selma::Rewriter.new(sanitizer: @sanitization_config, handlers: @node_filters).rewrite(html)
- end
-
@@ -207 +213 @@
- filter: filter.name,
+ filter: filter.class.name,
lib/html_pipeline/convert_filter.rb
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/lib/html_pipeline/convert_filter.rb 2024-08-01 02:40:31.092558935 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/lib/html_pipeline/convert_filter.rb 2024-08-01 02:40:31.096558997 +0000
@@ -8 +8 @@
- super(context: context, result: result)
+ super
lib/html_pipeline/convert_filter/markdown_filter.rb
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/lib/html_pipeline/convert_filter/markdown_filter.rb 2024-08-01 02:40:31.092558935 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/lib/html_pipeline/convert_filter/markdown_filter.rb 2024-08-01 02:40:31.096558997 +0000
@@ -6 +6 @@
- class ConvertFilter
+ class ConvertFilter < Filter
@@ -15 +15 @@
- super(context: context, result: result)
+ super
@@ -19,2 +19,2 @@
- def call(text)
- options = @context.fetch(:markdown, {})
+ def call(text, context: @context)
+ options = context.fetch(:markdown, {})
lib/html_pipeline/filter.rb
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/lib/html_pipeline/filter.rb 2024-08-01 02:40:31.092558935 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/lib/html_pipeline/filter.rb 2024-08-01 02:40:31.096558997 +0000
@@ -30 +30 @@
- attr_reader :context
+ attr_accessor :context
lib/html_pipeline/node_filter.rb
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/lib/html_pipeline/node_filter.rb 2024-08-01 02:40:31.092558935 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/lib/html_pipeline/node_filter.rb 2024-08-01 02:40:31.096558997 +0000
@@ -6,0 +7,2 @@
+ attr_accessor :context
+
lib/html_pipeline/node_filter/syntax_highlight_filter.rb
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/lib/html_pipeline/node_filter/syntax_highlight_filter.rb 2024-08-01 02:40:31.092558935 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/lib/html_pipeline/node_filter/syntax_highlight_filter.rb 2024-08-01 02:40:31.096558997 +0000
@@ -18 +18 @@
- super(context: context, result: result)
+ super
lib/html_pipeline/text_filter.rb
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/lib/html_pipeline/text_filter.rb 2024-08-01 02:40:31.092558935 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/lib/html_pipeline/text_filter.rb 2024-08-01 02:40:31.096558997 +0000
@@ -7,6 +7,2 @@
- def initialize(text, context: {}, result: {})
- raise TypeError, "text must be a String" unless text.is_a?(String)
-
- # Ensure that this is always a string
- @text = text.respond_to?(:to_str) ? text.to_str : text.to_s
- super(context: context, result: result)
+ def initialize(context: {}, result: {})
+ super
@@ -16,2 +12,6 @@
- def call(input, context: {}, result: {})
- new(input, context: context, result: result).call
+ def call(text, context: {}, result: {})
+ raise TypeError, "text must be a String" unless text.is_a?(String)
+
+ # Ensure that this is always a string
+ text = text.respond_to?(:to_str) ? text.to_str : text.to_s
+ new(context: context, result: result).call(text)
lib/html_pipeline/text_filter/image_filter.rb
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/lib/html_pipeline/text_filter/image_filter.rb 2024-08-01 02:40:31.092558935 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/lib/html_pipeline/text_filter/image_filter.rb 2024-08-01 02:40:31.100559059 +0000
@@ -12,2 +12,2 @@
- def call
- @text.gsub(%r{(https|http)?://.+\.(jpg|jpeg|bmp|gif|png)(\?\S+)?}i) do |match|
+ def call(text, context: {}, result: {})
+ text.gsub(%r{(https|http)?://.+\.(jpg|jpeg|bmp|gif|png)(\?\S+)?}i) do |match|
lib/html_pipeline/text_filter/plain_text_input_filter.rb
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/lib/html_pipeline/text_filter/plain_text_input_filter.rb 2024-08-01 02:40:31.092558935 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/lib/html_pipeline/text_filter/plain_text_input_filter.rb 2024-08-01 02:40:31.100559059 +0000
@@ -8,2 +8,2 @@
- def call
- "<div>#{CGI.escapeHTML(@text)}</div>"
+ def call(text, context: {}, result: {})
+ "<div>#{CGI.escapeHTML(text)}</div>"
lib/html_pipeline/version.rb
--- /tmp/d20240801-1840-q1vjcs/html-pipeline-3.0.3/lib/html_pipeline/version.rb 2024-08-01 02:40:31.092558935 +0000
+++ /tmp/d20240801-1840-q1vjcs/html-pipeline-3.2.1/lib/html_pipeline/version.rb 2024-08-01 02:40:31.100559059 +0000
@@ -4 +4 @@
- VERSION = "3.0.3"
+ VERSION = "3.2.1" |
gem compare rb_sys 0.9.88 0.9.99 Compared versions: ["0.9.88", "0.9.99"]
DIFFERENT cert_chain:
0.9.88: ["-----BEGIN CERTIFICATE-----\nMIIDfDCCAmSgAwIBAgIBATANBgkqhkiG9w0BAQsFADBCMRQwEgYDVQQDDAtpLmtl\ncnNleW1lcjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD\nY29tMB4XDTIzMDQxNDEzMzYxNVoXDTI0MDQxMzEzMzYxNVowQjEUMBIGA1UEAwwL\naS5rZXJzZXltZXIxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixk\nARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMJ2pG+er4cP\nPasxsMIKL9/tmLL4gh80EMuF3SCS0qZoh+Oo8dkvRYxW8NXdwEIcp3cCNgE+5G+J\nTCMOVF8S15n1Z1P7xxXiXxa/BIofKKbtatVRngm14uR/6pjdkvLXqlrWdS57bNwv\n7LtpzYVfDHfsl/qRWaEi4jq00PNCRSWjcva8teqswjBg8KlwGtyygpezPbVSWP8Y\nvzWZmVF7fqRBXU78Ah0+pNOhslBXDTvI3xJdN4hQ3H7rLjpD/qxKWq/8o+Qvx6cX\ndNZ3ugH/Pr3BAsqt4JFLXin9AK7PO9GDMH5JXJrUb+hAt2VNIZqpz9VlKA6BA0jN\neWGea+yCZkECAwEAAaN9MHswCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O\nBBYEFOkrF6hsocaIMOjR/K3JBzyXCLJPMCAGA1UdEQQZMBeBFWkua2Vyc2V5bWVy\nQGdtYWlsLmNvbTAgBgNVHRIEGTAXgRVpLmtlcnNleW1lckBnbWFpbC5jb20wDQYJ\nKoZIhvcNAQELBQADggEBAMAohCl0cdVlYrJl9viGtzbEyLV/Krn0ZD/LM9d2cIRj\nWBu7HRkP6AfYVzhZwdgUgDYw67d715kOMpLNGeWQw3QGEHFqbVzRML64jL8IxuTz\nJ8ttZVqM8f4GrHyISJnL92u6iP4WzdbVqx89EFjrrHd14OJXK+ZpdRh0YvnN/vMJ\nt2EcDweRHkN/MEdrwbH+PbYjELnKcTIEZqcCWTk8pgssGrNyjkMhxGSsSUo9qTz0\nDIZ6NVmpBvohJVCCCDxQQxFKLXZp1ivoxjN+m7eJSW7yzIz062pH4u8pPNQsiVSb\nI5rgRPbDr2rAFGXKoQ0+u6CLkRxqrVsITl/OPfZhBQI=\n-----END CERTIFICATE-----\n"]
0.9.99: ["-----BEGIN CERTIFICATE-----\nMIIDODCCAiCgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBCMRQwEgYDVQQDDAtpLmtl\ncnNleW1lcjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD\nY29tMB4XDTI0MDQxODA1MzY0N1oXDTI1MDQxODA1MzY0N1owQjEUMBIGA1UEAwwL\naS5rZXJzZXltZXIxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixk\nARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMJ2pG+er4cP\nPasxsMIKL9/tmLL4gh80EMuF3SCS0qZoh+Oo8dkvRYxW8NXdwEIcp3cCNgE+5G+J\nTCMOVF8S15n1Z1P7xxXiXxa/BIofKKbtatVRngm14uR/6pjdkvLXqlrWdS57bNwv\n7LtpzYVfDHfsl/qRWaEi4jq00PNCRSWjcva8teqswjBg8KlwGtyygpezPbVSWP8Y\nvzWZmVF7fqRBXU78Ah0+pNOhslBXDTvI3xJdN4hQ3H7rLjpD/qxKWq/8o+Qvx6cX\ndNZ3ugH/Pr3BAsqt4JFLXin9AK7PO9GDMH5JXJrUb+hAt2VNIZqpz9VlKA6BA0jN\neWGea+yCZkECAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O\nBBYEFOkrF6hsocaIMOjR/K3JBzyXCLJPMA0GCSqGSIb3DQEBCwUAA4IBAQARHgco\nyCxWUqN+HBGewmSB7T4oq6YS2FtU62K+GuWWCTqjl5byLKMXQW8HPDja9TC1My1m\n2r0uDshtUvUjuB/Vfe9jVMTjnPBspHZYo0MRuMPc7owJaahjkqD3l7w9aa8Ci5aC\nYU4Aj71Sc8s7YIxgHn/yIUdCe1yu6cC0+h+Ss9r/Yjr53NNXwjGQlDmH1eHcVQGZ\nmEoVcZO1uWNtRPPsn1gfvKLPjRe5pclXQnGviS5DiH0Du+8QMxQGBJnYz2zSMW7G\nLvd35BNvZkhFzs9xfykhurpkT2TiP2F3ZFn9dwLXMFe41pwrtEYLIWhYi8mUG4Ek\n6aR8M/tqIpChVV39\n-----END CERTIFICATE-----\n"]
DIFFERENT date:
0.9.88: 1980-01-01 00:00:00 UTC
0.9.99: 2024-07-25 00:00:00 UTC
DIFFERENT required_ruby_version:
0.9.88: >= 2.3.0
0.9.99: >= 2.5.0
DIFFERENT rubygems_version:
0.9.88: 3.5.5
0.9.99: 3.5.3
DIFFERENT version:
0.9.88: 0.9.88
0.9.99: 0.9.99
DIFFERENT files:
0.9.88->0.9.99:
* Changed:
certs/ianks.pem +10/-11
exe/rb-sys-dock +11/-5
lib/rb_sys/cargo/metadata.rb +30/-0
lib/rb_sys/cargo_builder.rb +20/-6
lib/rb_sys/extensiontask.rb +1/-1
lib/rb_sys/mkmf.rb +9/-6
lib/rb_sys/mkmf/config.rb +6/-1
lib/rb_sys/toolchain_info.rb +7/-0
lib/rb_sys/toolchain_info/data.rb +1/-1
lib/rb_sys/version.rb +1/-1 |
gem compare --diff rb_sys 0.9.88 0.9.99 Compared versions: ["0.9.88", "0.9.99"]
DIFFERENT files:
0.9.88->0.9.99:
* Changed:
certs/ianks.pem
--- /tmp/d20240801-1929-r07ewd/rb_sys-0.9.88/certs/ianks.pem 2024-08-01 02:40:36.804651419 +0000
+++ /tmp/d20240801-1929-r07ewd/rb_sys-0.9.99/certs/ianks.pem 2024-08-01 02:40:36.808651498 +0000
@@ -2 +2 @@
-MIIDfDCCAmSgAwIBAgIBATANBgkqhkiG9w0BAQsFADBCMRQwEgYDVQQDDAtpLmtl
+MIIDODCCAiCgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBCMRQwEgYDVQQDDAtpLmtl
@@ -4 +4 @@
-Y29tMB4XDTIzMDQxNDEzMzYxNVoXDTI0MDQxMzEzMzYxNVowQjEUMBIGA1UEAwwL
+Y29tMB4XDTI0MDQxODA1MzY0N1oXDTI1MDQxODA1MzY0N1owQjEUMBIGA1UEAwwL
@@ -12,9 +12,8 @@
-eWGea+yCZkECAwEAAaN9MHswCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
-BBYEFOkrF6hsocaIMOjR/K3JBzyXCLJPMCAGA1UdEQQZMBeBFWkua2Vyc2V5bWVy
-QGdtYWlsLmNvbTAgBgNVHRIEGTAXgRVpLmtlcnNleW1lckBnbWFpbC5jb20wDQYJ
-KoZIhvcNAQELBQADggEBAMAohCl0cdVlYrJl9viGtzbEyLV/Krn0ZD/LM9d2cIRj
-WBu7HRkP6AfYVzhZwdgUgDYw67d715kOMpLNGeWQw3QGEHFqbVzRML64jL8IxuTz
-J8ttZVqM8f4GrHyISJnL92u6iP4WzdbVqx89EFjrrHd14OJXK+ZpdRh0YvnN/vMJ
-t2EcDweRHkN/MEdrwbH+PbYjELnKcTIEZqcCWTk8pgssGrNyjkMhxGSsSUo9qTz0
-DIZ6NVmpBvohJVCCCDxQQxFKLXZp1ivoxjN+m7eJSW7yzIz062pH4u8pPNQsiVSb
-I5rgRPbDr2rAFGXKoQ0+u6CLkRxqrVsITl/OPfZhBQI=
+eWGea+yCZkECAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
+BBYEFOkrF6hsocaIMOjR/K3JBzyXCLJPMA0GCSqGSIb3DQEBCwUAA4IBAQARHgco
+yCxWUqN+HBGewmSB7T4oq6YS2FtU62K+GuWWCTqjl5byLKMXQW8HPDja9TC1My1m
+2r0uDshtUvUjuB/Vfe9jVMTjnPBspHZYo0MRuMPc7owJaahjkqD3l7w9aa8Ci5aC
+YU4Aj71Sc8s7YIxgHn/yIUdCe1yu6cC0+h+Ss9r/Yjr53NNXwjGQlDmH1eHcVQGZ
+mEoVcZO1uWNtRPPsn1gfvKLPjRe5pclXQnGviS5DiH0Du+8QMxQGBJnYz2zSMW7G
+Lvd35BNvZkhFzs9xfykhurpkT2TiP2F3ZFn9dwLXMFe41pwrtEYLIWhYi8mUG4Ek
+6aR8M/tqIpChVV39
exe/rb-sys-dock
--- /tmp/d20240801-1929-r07ewd/rb_sys-0.9.88/exe/rb-sys-dock 2024-08-01 02:40:36.804651419 +0000
+++ /tmp/d20240801-1929-r07ewd/rb_sys-0.9.99/exe/rb-sys-dock 2024-08-01 02:40:36.808651498 +0000
@@ -21 +21,7 @@
- @cargo_metadata ||= RbSys::Cargo::Metadata.new("rb-sys-dock", deps: true)
+ return @cargo_metadata if defined?(@cargo_metadata)
+
+ @cargo_metadata = begin
+ RbSys::Cargo::Metadata.inferred(deps: true)
+ rescue
+ nil
+ end
@@ -175 +181 @@
- return File.join(ENV["XDG_CACHE_HOME"], "rb-sys-dock") if ENV["XDG_CACHE_HOME"]
+ return File.join(ENV["XDG_CACHE_HOME"], "rb-sys") if ENV["XDG_CACHE_HOME"]
@@ -177 +183 @@
- File.join(ENV["HOME"], ".cache", "rb-sys-dock")
+ File.join(ENV["HOME"], ".cache", "rb-sys")
@@ -362 +368 @@
- -v #{working_directory}:#{working_directory} \
+ -v $(pwd):$(pwd) \
@@ -424 +430 @@
- cargo_version = cargo_metadata.rb_sys_version
+ cargo_version = cargo_metadata&.rb_sys_version || RbSys::VERSION
lib/rb_sys/cargo/metadata.rb
--- /tmp/d20240801-1929-r07ewd/rb_sys-0.9.88/lib/rb_sys/cargo/metadata.rb 2024-08-01 02:40:36.804651419 +0000
+++ /tmp/d20240801-1929-r07ewd/rb_sys-0.9.99/lib/rb_sys/cargo/metadata.rb 2024-08-01 02:40:36.808651498 +0000
@@ -11,0 +12,20 @@
+ class << self
+ # Infers the Cargo project's name from the Cargo.toml file.
+ #
+ # @return [RbSys::Cargo::Metadata]
+ def inferred(deps: false)
+ new(File.read("Cargo.toml").match(/^name = "(.*)"/)[1], deps: deps)
+ rescue
+ new(File.basename(Dir.pwd), deps: deps)
+ end
+
+ # Initializes a new Cargo::Metadata instance or infers the Cargo project's name.
+ #
+ # @param name [String] the name of the Cargo project
+ def new_or_inferred(name, deps: false)
+ new(name, deps: deps).load!
+ rescue CargoMetadataError
+ inferred
+ end
+ end
+
@@ -94,0 +115,2 @@
+ #
+ # @return [String]
@@ -98,0 +121,8 @@
+ end
+
+ # Eagerly run `cargo metadata`, raising a RbSys::CargoCargoMetadataError` if it fails.
+ #
+ # @return [RbSys::Cargo::Metadata]
+ def load!
+ cargo_metadata
+ self
lib/rb_sys/cargo_builder.rb
--- /tmp/d20240801-1929-r07ewd/rb_sys-0.9.88/lib/rb_sys/cargo_builder.rb 2024-08-01 02:40:36.804651419 +0000
+++ /tmp/d20240801-1929-r07ewd/rb_sys-0.9.99/lib/rb_sys/cargo_builder.rb 2024-08-01 02:40:36.808651498 +0000
@@ -12 +12 @@
- :extra_cargo_args
+ :extra_cargo_args, :config
@@ -69 +69,5 @@
- cmd += ["cargo", "rustc"]
+ cmd += if config.use_cargo_build
+ ["cargo", "build"]
+ else
+ ["cargo", "rustc"]
+ end
@@ -77,3 +81,5 @@
- cmd += ["--"]
- cmd += [*rustc_args(dest_path)]
- cmd += extra_rustc_args
+ if !config.use_cargo_build
+ cmd += ["--"]
+ cmd += [*rustc_args(dest_path)]
+ cmd += extra_rustc_args
+ end
@@ -144,0 +151,4 @@
+ if musl?
+ flags += ["-C", "target-feature=-crt-static"]
+ end
+
@@ -331 +341,5 @@
- ENV.key?("SOURCE_DATE_EPOCH") && !ENV["RB_SYS_TEST"] == "1"
+ ENV.key?("SOURCE_DATE_EPOCH") && ENV["RB_SYS_TEST"] != "1"
+ end
+
+ def musl?
+ RbConfig::CONFIG["target_os"] == "linux-musl" || RbConfig::CONFIG["CC"]&.include?("musl-gcc")
lib/rb_sys/extensiontask.rb
--- /tmp/d20240801-1929-r07ewd/rb_sys-0.9.88/lib/rb_sys/extensiontask.rb 2024-08-01 02:40:36.804651419 +0000
+++ /tmp/d20240801-1929-r07ewd/rb_sys-0.9.99/lib/rb_sys/extensiontask.rb 2024-08-01 02:40:36.808651498 +0000
@@ -60 +60 @@
- @cargo_metadata ||= Cargo::Metadata.new(@name)
+ @cargo_metadata ||= Cargo::Metadata.new_or_inferred(@name)
lib/rb_sys/mkmf.rb
--- /tmp/d20240801-1929-r07ewd/rb_sys-0.9.88/lib/rb_sys/mkmf.rb 2024-08-01 02:40:36.804651419 +0000
+++ /tmp/d20240801-1929-r07ewd/rb_sys-0.9.99/lib/rb_sys/mkmf.rb 2024-08-01 02:40:36.808651498 +0000
@@ -13,3 +12,0 @@
- # @api private
- GLOBAL_RUSTFLAGS = ["--cfg=rb_sys_gem"]
-
@@ -35 +32 @@
- # r.rustflags = %w[--cfg=foo]
+ # r.extra_rustflags = %w[--cfg=foo]
@@ -56 +53,3 @@
- global_rustflags = GLOBAL_RUSTFLAGS.dup
+
+ global_rustflags = []
+ global_rustflags << "--cfg=rb_sys_gem" unless builder.use_cargo_build
@@ -172 +171,5 @@
- cmd.gsub!(/\Acargo rustc/, "$(CARGO) rustc $(RB_SYS_EXTRA_CARGO_ARGS) --manifest-path $(RB_SYS_CARGO_MANIFEST_DIR)/Cargo.toml")
+ if builder.use_cargo_build
+ cmd.gsub!(/\Acargo rustc/, "$(CARGO) build $(RB_SYS_EXTRA_CARGO_ARGS) --manifest-path $(RB_SYS_CARGO_MANIFEST_DIR)/Cargo.toml")
+ else
+ cmd.gsub!(/\Acargo rustc/, "$(CARGO) rustc $(RB_SYS_EXTRA_CARGO_ARGS) --manifest-path $(RB_SYS_CARGO_MANIFEST_DIR)/Cargo.toml")
+ end
lib/rb_sys/mkmf/config.rb
--- /tmp/d20240801-1929-r07ewd/rb_sys-0.9.88/lib/rb_sys/mkmf/config.rb 2024-08-01 02:40:36.808651498 +0000
+++ /tmp/d20240801-1929-r07ewd/rb_sys-0.9.99/lib/rb_sys/mkmf/config.rb 2024-08-01 02:40:36.808651498 +0000
@@ -27,0 +28,4 @@
+ # Instead of the default `cargo rustc` behaviour, just call `cargo build`.
+ # Requires manually setting relevant rb-sys environment (default: false)
+ attr_accessor :use_cargo_build
+
@@ -29,0 +34 @@
+ @builder.config = self
@@ -58 +63 @@
- ENV.key?("SOURCE_DATE_EPOCH") && !ENV["RB_SYS_TEST"] == "1"
+ ENV.key?("SOURCE_DATE_EPOCH") && ENV["RB_SYS_TEST"] != "1"
lib/rb_sys/toolchain_info.rb
--- /tmp/d20240801-1929-r07ewd/rb_sys-0.9.88/lib/rb_sys/toolchain_info.rb 2024-08-01 02:40:36.808651498 +0000
+++ /tmp/d20240801-1929-r07ewd/rb_sys-0.9.99/lib/rb_sys/toolchain_info.rb 2024-08-01 02:40:36.808651498 +0000
@@ -30,0 +31,7 @@
+ # Get all supported toolchain names, as strings.
+ #
+ # @return [Array<String>]
+ def supported_ruby_platforms
+ supported.map(&:platform)
+ end
+
lib/rb_sys/toolchain_info/data.rb
--- /tmp/d20240801-1929-r07ewd/rb_sys-0.9.88/lib/rb_sys/toolchain_info/data.rb 2024-08-01 02:40:36.808651498 +0000
+++ /tmp/d20240801-1929-r07ewd/rb_sys-0.9.99/lib/rb_sys/toolchain_info/data.rb 2024-08-01 02:40:36.808651498 +0000
@@ -8 +8 @@
- DATA = {"arm-linux" => {"rust-target" => "arm-unknown-linux-gnueabihf", "rake-compiler-dock" => {"cc" => "arm-linux-gnueabihf-gcc"}, "docker-platform" => "linux/arm/v7", "supported" => true}, "aarch64-linux" => {"rust-target" => "aarch64-unknown-linux-gnu", "rake-compiler-dock" => {"cc" => "aarch64-linux-gnu-gcc"}, "docker-platform" => "linux/arm64/v8", "supported" => true}, "arm64-darwin" => {"rust-target" => "aarch64-apple-darwin", "rake-compiler-dock" => {"cc" => "aarch64-apple-darwin-clang"}, "docker-platform" => "linux/arm64/v8", "supported" => true}, "x64-mingw-ucrt" => {"rust-target" => "x86_64-pc-windows-gnu", "rake-compiler-dock" => {"cc" => "x86_64-windows-gnu-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}, "x64-mingw32" => {"rust-target" => "x86_64-pc-windows-gnu", "rake-compiler-dock" => {"cc" => "x86_64-windows-gnu-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}, "x86-linux" => {"rust-target" => "i686-unknown-linux-gnu", "rake-compiler-dock" => {"cc" => "i686-redhat-linux-gcc"}, "docker-platform" => "linux/i386", "supported" => false}, "x86-mingw32" => {"rust-target" => "i686-pc-windows-gnu", "rake-compiler-dock" => {"cc" => "i686-w64-mingw32-gcc"}, "docker-platform" => "linux/i386", "supported" => false}, "x86_64-darwin" => {"rust-target" => "x86_64-apple-darwin", "rake-compiler-dock" => {"cc" => "x86_64-apple-darwin-clang"}, "docker-platform" => "linux/amd64", "supported" => true}, "x86_64-linux" => {"rust-target" => "x86_64-unknown-linux-gnu", "rake-compiler-dock" => {"cc" => "x86_64-redhat-linux-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}, "x86_64-linux-musl" => {"rust-target" => "x86_64-unknown-linux-musl", "rake-compiler-dock" => {"cc" => "x86_64-unknown-linux-musl-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}}
+ DATA = {"arm-linux" => {"rust-target" => "arm-unknown-linux-gnueabihf", "rake-compiler-dock" => {"cc" => "arm-linux-gnueabihf-gcc"}, "docker-platform" => "linux/arm/v7", "supported" => true}, "aarch64-linux" => {"rust-target" => "aarch64-unknown-linux-gnu", "rake-compiler-dock" => {"cc" => "aarch64-linux-gnu-gcc"}, "docker-platform" => "linux/arm64/v8", "supported" => true}, "aarch64-linux-musl" => {"rust-target" => "aarch64-unknown-linux-musl", "rake-compiler-dock" => {"cc" => "aarch64-linux-musl-gcc"}, "docker-platform" => "linux/arm64/v8", "supported" => true}, "arm64-darwin" => {"rust-target" => "aarch64-apple-darwin", "rake-compiler-dock" => {"cc" => "aarch64-apple-darwin-clang"}, "docker-platform" => "linux/arm64/v8", "supported" => true}, "x64-mingw-ucrt" => {"rust-target" => "x86_64-pc-windows-gnu", "rake-compiler-dock" => {"cc" => "x86_64-windows-gnu-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}, "x64-mingw32" => {"rust-target" => "x86_64-pc-windows-gnu", "rake-compiler-dock" => {"cc" => "x86_64-windows-gnu-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}, "x86-linux" => {"rust-target" => "i686-unknown-linux-gnu", "rake-compiler-dock" => {"cc" => "i686-redhat-linux-gcc"}, "docker-platform" => "linux/i386", "supported" => false}, "x86-mingw32" => {"rust-target" => "i686-pc-windows-gnu", "rake-compiler-dock" => {"cc" => "i686-w64-mingw32-gcc"}, "docker-platform" => "linux/i386", "supported" => false}, "x86_64-darwin" => {"rust-target" => "x86_64-apple-darwin", "rake-compiler-dock" => {"cc" => "x86_64-apple-darwin-clang"}, "docker-platform" => "linux/amd64", "supported" => true}, "x86_64-linux" => {"rust-target" => "x86_64-unknown-linux-gnu", "rake-compiler-dock" => {"cc" => "x86_64-redhat-linux-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}, "x86_64-linux-musl" => {"rust-target" => "x86_64-unknown-linux-musl", "rake-compiler-dock" => {"cc" => "x86_64-unknown-linux-musl-gcc"}, "docker-platform" => "linux/amd64", "supported" => true}}
lib/rb_sys/version.rb
--- /tmp/d20240801-1929-r07ewd/rb_sys-0.9.88/lib/rb_sys/version.rb 2024-08-01 02:40:36.808651498 +0000
+++ /tmp/d20240801-1929-r07ewd/rb_sys-0.9.99/lib/rb_sys/version.rb 2024-08-01 02:40:36.812651576 +0000
@@ -4 +4 @@
- VERSION = "0.9.88"
+ VERSION = "0.9.99" |
gem compare selma 0.2.2 0.4.5 Compared versions: ["0.2.2", "0.4.5"]
DIFFERENT date:
0.2.2: 2024-01-11 00:00:00 UTC
0.4.5: 2024-07-31 00:00:00 UTC
DIFFERENT require_paths:
0.2.2: ["/opt/hostedtoolcache/Ruby/3.2.5/x64/lib/ruby/gems/3.2.0/extensions/x86_64-linux/3.2.0/selma-0.2.2", "lib"]
0.4.5: ["/opt/hostedtoolcache/Ruby/3.2.5/x64/lib/ruby/gems/3.2.0/extensions/x86_64-linux/3.2.0/selma-0.4.5", "lib"]
DIFFERENT version:
0.2.2: 0.2.2
0.4.5: 0.4.5
DIFFERENT files:
0.2.2->0.4.5:
* Added:
lib/selma/config.rb +12/-0
lib/selma/html/element.rb +11/-0
* Changed:
Cargo.lock +124/-118
README.md +135/-29
ext/selma/Cargo.toml +5/-2
ext/selma/src/html/element.rs +32/-27
ext/selma/src/html/end_tag.rs +5/-5
ext/selma/src/html/text_chunk.rs +18/-5
ext/selma/src/native_ref_wrap.rs +30/-33
ext/selma/src/rewriter.rs +286/-123
ext/selma/src/sanitizer.rs +24/-18
lib/selma/html.rb +2/-0
lib/selma/sanitizer.rb +6/-1
lib/selma/sanitizer/config/default.rb +1/-1
lib/selma/sanitizer/config/relaxed.rb +1/-0
lib/selma/version.rb +1/-1 |
|
gem compare zeitwerk 2.6.13 2.6.17 Compared versions: ["2.6.13", "2.6.17"]
DIFFERENT date:
2.6.13: 2024-02-06 00:00:00 UTC
2.6.17: 2024-07-29 00:00:00 UTC
DIFFERENT rubygems_version:
2.6.13: 3.5.5
2.6.17: 3.5.15
DIFFERENT version:
2.6.13: 2.6.13
2.6.17: 2.6.17
DIFFERENT files:
2.6.13->2.6.17:
* Added:
lib/zeitwerk/cref.rb +99/-0
* Changed:
README.md +51/-2
lib/zeitwerk.rb +1/-0
lib/zeitwerk/gem_loader.rb +1/-2
lib/zeitwerk/loader.rb +123/-93
lib/zeitwerk/loader/callbacks.rb +13/-14
lib/zeitwerk/loader/eager_load.rb +12/-14
lib/zeitwerk/loader/helpers.rb +25/-64
lib/zeitwerk/version.rb +1/-1 |
gem compare --diff zeitwerk 2.6.13 2.6.17 Compared versions: ["2.6.13", "2.6.17"]
DIFFERENT files:
2.6.13->2.6.17:
* Added:
lib/zeitwerk/cref.rb
--- /tmp/20240801-2090-n5j59f 2024-08-01 02:40:48.556818371 +0000
+++ /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.17/lib/zeitwerk/cref.rb 2024-08-01 02:40:48.552818321 +0000
@@ -0,0 +1,99 @@
+# frozen_string_literal: true
+
+# This private class encapsulates pairs (mod, cname).
+#
+# Objects represent the constant cname in the class or module object mod, and
+# have API to manage them that encapsulates the constants API. Examples:
+#
+# cref.path
+# cref.set(value)
+# cref.get
+#
+# The constant may or may not exist in mod.
+class Zeitwerk::Cref
+ include Zeitwerk::RealModName
+
+ # @sig Symbol
+ attr_reader :cname
+
+ # The type of the first argument is Module because Class < Module, class
+ # objects are also valid.
+ #
+ # @sig (Module, Symbol) -> void
+ def initialize(mod, cname)
+ @mod = mod
+ @cname = cname
+ @path = nil
+ end
+
+ if Symbol.method_defined?(:name)
+ # Symbol#name was introduced in Ruby 3.0. It returns always the same
+ # frozen object, so we may save a few string allocations.
+ #
+ # @sig () -> String
+ def path
+ @path ||= Object.equal?(@mod) ? @cname.name : "#{real_mod_name(@mod)}::#{@cname.name}"
+ end
+ else
+ # @sig () -> String
+ def path
+ @path ||= Object.equal?(@mod) ? @cname.to_s : "#{real_mod_name(@mod)}::#{@cname}"
+ end
+ end
+
+ # The autoload? predicate takes into account the ancestor chain of the
+ # receiver, like const_defined? and other methods in the constants API do.
+ #
+ # For example, given
+ #
+ # class A
+ # autoload :X, "x.rb"
+ # end
+ #
+ # class B < A
+ # end
+ #
+ # B.autoload?(:X) returns "x.rb".
+ #
+ # We need a way to retrieve it ignoring ancestors.
+ #
+ # @sig () -> String?
+ if method(:autoload?).arity == 1
+ # @sig () -> String?
+ def autoload?
+ @mod.autoload?(@cname) if self.defined?
+ end
+ else
+ # @sig () -> String?
+ def autoload?
+ @mod.autoload?(@cname, false)
+ end
+ end
+
+ # @sig (String) -> bool
+ def autoload(abspath)
+ @mod.autoload(@cname, abspath)
+ end
+
+ # @sig () -> bool
+ def defined?
+ @mod.const_defined?(@cname, false)
+ end
+
+ # @sig (Object) -> Object
+ def set(value)
+ @mod.const_set(@cname, value)
+ end
+
+ # @raise [NameError]
+ # @sig () -> Object
+ def get
+ @mod.const_get(@cname, false)
+ end
+
+ # @raise [NameError]
+ # @sig () -> void
+ def remove
+ @mod.__send__(:remove_const, @cname)
+ end
+end
* Changed:
README.md
--- /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.13/README.md 2024-08-01 02:40:48.548818271 +0000
+++ /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.17/README.md 2024-08-01 02:40:48.552818321 +0000
@@ -62,0 +63 @@
+ - [`Zeitwerk::Loader#all_expected_cpaths`](#zeitwerkloaderall_expected_cpaths)
@@ -262 +263 @@
-To trigger this behavior, the directory must contain non-ignored Ruby files with the `.rb` extension, either directly or recursively. Otherwise, the directory is ignored. This condition is reevaluated during reloads.
+To trigger this behavior, the directory must contain non-ignored Ruby files with the ".rb" extension, either directly or recursively. Otherwise, the directory is ignored. This condition is reevaluated during reloads.
@@ -1067 +1068 @@
-There is an edge case related to nested root directories. Conceptually, root directories are independent source trees. If you ignore a parent of a nested root directory, the nested root directory is not affected. You need to ignore it explictly if you want it ignored too.
+There is an edge case related to nested root directories. Conceptually, root directories are independent source trees. If you ignore a parent of a nested root directory, the nested root directory is not affected. You need to ignore it explicitly if you want it ignored too.
@@ -1331,0 +1333,48 @@
+
+`Zeitwerk::Loader#cpath_expected_at` is designed to be used with individual paths. If you want to know all the expected constant paths in the project, please use `Zeitwerk::Loader#all_expected_cpaths`, documented next.
+
+<a id="markdown-zeitwerkloaderall_expected_cpaths" name="zeitwerkloaderall_expected_cpaths"></a>
+#### `Zeitwerk::Loader#all_expected_cpaths`
+
+The method `Zeitwerk::Loader#all_expected_cpaths` returns a hash that maps the absolute paths of the files and directories managed by the receiver to their expected constant paths.
+
+Ignored files, hidden files, and files whose extension is not ".rb" are not included in the result. Same for directories, hidden or ignored directories are not included in the result. Additionally, directories that contain no files with extension ".rb" (recursively) are also excluded, since those are not considered to represent Ruby namespaces.
+
+For example, if `lib` is the root directory of a gem with the following contents:
+
+```
+lib/.DS_Store
+lib/my_gem.rb
+lib/my_gem/version.rb
+lib/my_gem/ignored.rb
+lib/my_gem/drivers/unix.rb
+lib/my_gem/drivers/windows.rb
+lib/my_gem/collapsed/foo.rb
+lib/tasks/my_gem.rake
+```
+
+`Zeitwerk::Loader#all_expected_cpaths` would return (maybe in a different order):
+
+```ruby
+{
+ "/.../lib" => "Object",
+ "/.../lib/my_gem.rb" => "MyGem",
+ "/.../lib/my_gem" => "MyGem",
+ "/.../lib/my_gem/version.rb" => "MyGem::VERSION",
+ "/.../lib/my_gem/drivers" => "MyGem::Drivers",
+ "/.../lib/my_gem/drivers/unix.rb" => "MyGem::Drivers::Unix",
+ "/.../lib/my_gem/drivers/windows.rb" => "MyGem::Drivers::Windows",
+ "/.../lib/my_gem/collapsed" => "MyGem"
+ "/.../lib/my_gem/collapsed/foo.rb" => "MyGem::Foo"
+}
+```
+
+In the previous example we assume `lib/my_gem/ignored.rb` is ignored, and therefore it is not present in the returned hash. Also, `lib/my_gem/collapsed` is a collapsed directory, so the expected namespace at that level is still `MyGem` (this is an edge case).
+
+The file `lib/.DS_Store` is hidden, hence excluded. The directory `lib/tasks` is also not present because it contains no files with extension ".rb".
+
+Directory paths do not have trailing slashes.
+
+The order of the hash entries is undefined.
+
+This method does not parse or execute file contents and does not guarantee files define the corresponding constant paths. It just says which are the _expected_ ones.
lib/zeitwerk.rb
--- /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.13/lib/zeitwerk.rb 2024-08-01 02:40:48.548818271 +0000
+++ /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.17/lib/zeitwerk.rb 2024-08-01 02:40:48.552818321 +0000
@@ -5,0 +6 @@
+ require_relative "zeitwerk/cref"
lib/zeitwerk/gem_loader.rb
--- /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.13/lib/zeitwerk/gem_loader.rb 2024-08-01 02:40:48.548818271 +0000
+++ /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.17/lib/zeitwerk/gem_loader.rb 2024-08-01 02:40:48.552818321 +0000
@@ -45 +45 @@
- ls(@root_dir) do |basename, abspath|
+ ls(@root_dir) do |basename, abspath, ftype|
@@ -51 +50,0 @@
- ftype = dir?(abspath) ? "directory" : "file"
lib/zeitwerk/loader.rb
--- /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.13/lib/zeitwerk/loader.rb 2024-08-01 02:40:48.552818321 +0000
+++ /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.17/lib/zeitwerk/loader.rb 2024-08-01 02:40:48.552818321 +0000
@@ -25,2 +25 @@
- # executed--- to their corresponding parent class or module and constant
- # name.
+ # executed--- to their corresponding Zeitwerk::Cref object.
@@ -28,2 +27,2 @@
- # "/Users/fxn/blog/app/models/user.rb" => [Object, :User],
- # "/Users/fxn/blog/app/models/hotel/pricing.rb" => [Hotel, :Pricing]
+ # "/Users/fxn/blog/app/models/user.rb" => #<Zeitwerk::Cref:... @mod=Object, @cname=:User, ...>,
+ # "/Users/fxn/blog/app/models/hotel/pricing.rb" => #<Zeitwerk::Cref:... @mod=Hotel, @cname=:Pricing, ...>,
@@ -32 +31 @@
- # @sig Hash[String, [Module, Symbol]]
+ # @sig Hash[String, Zeitwerk::Cref]
@@ -48 +47,4 @@
- # "Admin::Role" => [".../admin/role.rb", [Admin, :Role]]
+ # "Admin::Role" => [
+ # ".../admin/role.rb",
+ # #<Zeitwerk::Cref:... @mod=Admin, @cname=:Role, ...>
+ # ]
@@ -52,2 +54 @@
- # pair [Module, Symbol] is used to remove_const the constant from the class
- # or module object.
+ # cref is used to remove the constant from the parent class or module.
@@ -58 +59 @@
- # @sig Hash[String, [String, [Module, Symbol]]]
+ # @sig Hash[String, [String, Zeitwerk::Cref]]
@@ -157,3 +158,3 @@
- autoloads.each do |abspath, (parent, cname)|
- if parent.autoload?(cname)
- unload_autoload(parent, cname)
+ autoloads.each do |abspath, cref|
+ if cref.autoload?
+ unload_autoload(cref)
@@ -164 +165 @@
- unload_cref(parent, cname)
+ unload_cref(cref)
@@ -169 +170 @@
- to_unload.each do |cpath, (abspath, (parent, cname))|
+ to_unload.each do |cpath, (abspath, cref)|
@@ -172 +173 @@
- value = cget(parent, cname)
+ value = cref.get
@@ -182 +183 @@
- unload_cref(parent, cname)
+ unload_cref(cref)
@@ -233,3 +234,6 @@
- # @sig (String | Pathname) -> String?
- def cpath_expected_at(path)
- abspath = File.expand_path(path)
+ # Returns a hash that maps the absolute paths of the managed files and
+ # directories to their respective expected constant paths.
+ #
+ # @sig () -> Hash[String, String]
+ def all_expected_cpaths
+ result = {}
@@ -237 +241,2 @@
- raise Zeitwerk::Error.new("#{abspath} does not exist") unless File.exist?(abspath)
+ actual_roots.each do |root_dir, root_namespace|
+ queue = [[root_dir, real_mod_name(root_namespace)]]
@@ -239,2 +244,2 @@
- return unless dir?(abspath) || ruby?(abspath)
- return if ignored_path?(abspath)
+ while (dir, cpath = queue.shift)
+ result[dir] = cpath
@@ -242 +247 @@
- paths = []
+ prefix = cpath == "Object" ? "" : cpath + "::"
@@ -244,3 +249,14 @@
- if ruby?(abspath)
- basename = File.basename(abspath, ".rb")
- return if hidden?(basename)
+ ls(dir) do |basename, abspath, ftype|
+ if ftype == :file
+ basename.delete_suffix!(".rb")
+ result[abspath] = prefix + inflector.camelize(basename, abspath)
+ else
+ if collapse?(abspath)
+ queue << [abspath, cpath]
+ else
+ queue << [abspath, prefix + inflector.camelize(basename, abspath)]
+ end
+ end
+ end
+ end
+ end
@@ -248,4 +264 @@
- paths << [basename, abspath]
- walk_up_from = File.dirname(abspath)
- else
- walk_up_from = abspath
+ result
@@ -254 +267,3 @@
- root_namespace = nil
+ # @sig (String | Pathname) -> String?
+ def cpath_expected_at(path)
+ abspath = File.expand_path(path)
@@ -256,3 +271 @@
- walk_up(walk_up_from) do |dir|
- break if root_namespace = roots[dir]
- return if ignored_path?(dir)
+ raise Zeitwerk::Error.new("#{abspath} does not exist") unless File.exist?(abspath)
@@ -260,2 +273,2 @@
- basename = File.basename(dir)
- return if hidden?(basename)
+ return unless dir?(abspath) || ruby?(abspath)
+ return if ignored_path?(abspath)
@@ -263,2 +276 @@
- paths << [basename, abspath] unless collapse?(dir)
- end
+ paths = []
@@ -266 +278,3 @@
- return unless root_namespace
+ if ruby?(abspath)
+ basename = File.basename(abspath, ".rb")
+ return if hidden?(basename)
@@ -268,4 +282,19 @@
- if paths.empty?
- real_mod_name(root_namespace)
- else
- cnames = paths.reverse_each.map { |b, a| cname_for(b, a) }
+ paths << [basename, abspath]
+ walk_up_from = File.dirname(abspath)
+ else
+ walk_up_from = abspath
+ end
+
+ root_namespace = nil
+
+ walk_up(walk_up_from) do |dir|
+ break if root_namespace = roots[dir]
+ return if ignored_path?(dir)
+
+ basename = File.basename(dir)
+ return if hidden?(basename)
+
+ paths << [basename, abspath] unless collapse?(dir)
+ end
+
+ return unless root_namespace
@@ -273,2 +302,2 @@
- if root_namespace == Object
- cnames.join("::")
+ if paths.empty?
+ real_mod_name(root_namespace)
@@ -276 +305,7 @@
- "#{real_mod_name(root_namespace)}::#{cnames.join("::")}"
+ cnames = paths.reverse_each.map { |b, a| cname_for(b, a) }
+
+ if root_namespace == Object
+ cnames.join("::")
+ else
+ "#{real_mod_name(root_namespace)}::#{cnames.join("::")}"
+ end
@@ -279 +313,0 @@
- end
@@ -411,2 +445,2 @@
- ls(dir) do |basename, abspath|
- if ruby?(basename)
+ ls(dir) do |basename, abspath, ftype|
+ if ftype == :file
@@ -414 +448,2 @@
- autoload_file(parent, cname_for(basename, abspath), abspath)
+ cref = Cref.new(parent, cname_for(basename, abspath))
+ autoload_file(cref, abspath)
@@ -419 +454,2 @@
- autoload_subdir(parent, cname_for(basename, abspath), abspath)
+ cref = Cref.new(parent, cname_for(basename, abspath))
+ autoload_subdir(cref, abspath)
@@ -426,3 +462,2 @@
- private def autoload_subdir(parent, cname, subdir)
- if autoload_path = autoload_path_set_by_me_for?(parent, cname)
- cpath = cpath(parent, cname)
+ private def autoload_subdir(cref, subdir)
+ if autoload_path = autoload_path_set_by_me_for?(cref)
@@ -437 +472 @@
- register_explicit_namespace(cpath)
+ register_explicit_namespace(cref.path)
@@ -442,2 +477,2 @@
- namespace_dirs[cpath] << subdir
- elsif !cdef?(parent, cname)
+ namespace_dirs[cref.path] << subdir
+ elsif !cref.defined?
@@ -445,2 +480,2 @@
- namespace_dirs[cpath(parent, cname)] << subdir
- define_autoload(parent, cname, subdir)
+ namespace_dirs[cref.path] << subdir
+ define_autoload(cref, subdir)
@@ -450,2 +485,2 @@
- log("the namespace #{cpath(parent, cname)} already exists, descending into #{subdir}") if logger
- define_autoloads_for_dir(subdir, cget(parent, cname))
+ log("the namespace #{cref.path} already exists, descending into #{subdir}") if logger
+ define_autoloads_for_dir(subdir, cref.get)
@@ -456,2 +491,2 @@
- private def autoload_file(parent, cname, file)
- if autoload_path = strict_autoload_path(parent, cname) || Registry.inception?(cpath(parent, cname))
+ private def autoload_file(cref, file)
+ if autoload_path = cref.autoload? || Registry.inception?(cref.path)
@@ -463,6 +498 @@
- promote_namespace_from_implicit_to_explicit(
- dir: autoload_path,
- file: file,
- parent: parent,
- cname: cname
- )
+ promote_namespace_from_implicit_to_explicit(dir: autoload_path, file: file, cref: cref)
@@ -470 +500 @@
- elsif cdef?(parent, cname)
+ elsif cref.defined?
@@ -472 +502 @@
- log("file #{file} is ignored because #{cpath(parent, cname)} is already defined") if logger
+ log("file #{file} is ignored because #{cref.path} is already defined") if logger
@@ -474 +504 @@
- define_autoload(parent, cname, file)
+ define_autoload(cref, file)
@@ -481,2 +511,2 @@
- # @sig (dir: String, file: String, parent: Module, cname: Symbol) -> void
- private def promote_namespace_from_implicit_to_explicit(dir:, file:, parent:, cname:)
+ # @sig (dir: String, file: String, cref: Zeitwerk::Cref) -> void
+ private def promote_namespace_from_implicit_to_explicit(dir:, file:, cref:)
@@ -486 +516 @@
- log("earlier autoload for #{cpath(parent, cname)} discarded, it is actually an explicit namespace defined in #{file}") if logger
+ log("earlier autoload for #{cref.path} discarded, it is actually an explicit namespace defined in #{file}") if logger
@@ -488,2 +518,2 @@
- define_autoload(parent, cname, file)
- register_explicit_namespace(cpath(parent, cname))
+ define_autoload(cref, file)
+ register_explicit_namespace(cref.path)
@@ -493,2 +523,2 @@
- private def define_autoload(parent, cname, abspath)
- parent.autoload(cname, abspath)
+ private def define_autoload(cref, abspath)
+ cref.autoload(abspath)
@@ -498 +528 @@
- log("autoload set for #{cpath(parent, cname)}, to be loaded from #{abspath}")
+ log("autoload set for #{cref.path}, to be loaded from #{abspath}")
@@ -500 +530 @@
- log("autoload set for #{cpath(parent, cname)}, to be autovivified from #{abspath}")
+ log("autoload set for #{cref.path}, to be autovivified from #{abspath}")
@@ -504 +534 @@
- autoloads[abspath] = [parent, cname]
+ autoloads[abspath] = cref
@@ -508,2 +538,2 @@
- unless parent.autoload?(cname)
- Registry.register_inception(cpath(parent, cname), abspath, self)
+ unless cref.autoload?
+ Registry.register_inception(cref.path, abspath, self)
@@ -514,2 +544,2 @@
- private def autoload_path_set_by_me_for?(parent, cname)
- if autoload_path = strict_autoload_path(parent, cname)
+ private def autoload_path_set_by_me_for?(cref)
+ if autoload_path = cref.autoload?
@@ -518 +548 @@
- Registry.inception?(cpath(parent, cname))
+ Registry.inception?(cref.path)
@@ -559,3 +589,3 @@
- private def unload_autoload(parent, cname)
- crem(parent, cname)
- log("autoload for #{cpath(parent, cname)} removed") if logger
+ private def unload_autoload(cref)
+ cref.remove
+ log("autoload for #{cref.path} removed") if logger
@@ -565 +595 @@
- private def unload_cref(parent, cname)
+ private def unload_cref(cref)
@@ -568 +598 @@
- crem(parent, cname)
+ cref.remove
@@ -573 +603 @@
- log("#{cpath(parent, cname)} unloaded") if logger
+ log("#{cref.path} unloaded") if logger
lib/zeitwerk/loader/callbacks.rb
--- /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.13/lib/zeitwerk/loader/callbacks.rb 2024-08-01 02:40:48.552818321 +0000
+++ /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.17/lib/zeitwerk/loader/callbacks.rb 2024-08-01 02:40:48.552818321 +0000
@@ -11,2 +11 @@
- cref = autoloads.delete(file)
- cpath = cpath(*cref)
+ cref = autoloads.delete(file)
@@ -16,4 +15,4 @@
- if cdef?(*cref)
- log("constant #{cpath} loaded from file #{file}") if logger
- to_unload[cpath] = [file, cref] if reloading_enabled?
- run_on_load_callbacks(cpath, cget(*cref), file) unless on_load_callbacks.empty?
+ if cref.defined?
+ log("constant #{cref.path} loaded from file #{file}") if logger
+ to_unload[cref.path] = [file, cref] if reloading_enabled?
+ run_on_load_callbacks(cref.path, cref.get, file) unless on_load_callbacks.empty?
@@ -21 +20 @@
- msg = "expected file #{file} to define constant #{cpath}, but didn't"
+ msg = "expected file #{file} to define constant #{cref.path}, but didn't"
@@ -26 +25 @@
- crem(*cref)
+ cref.remove
@@ -31 +30 @@
- to_unload[cpath] = [file, cref] if reloading_enabled?
+ to_unload[cref.path] = [file, cref] if reloading_enabled?
@@ -33 +32 @@
- raise Zeitwerk::NameError.new(msg, cref.last)
+ raise Zeitwerk::NameError.new(msg, cref.cname)
@@ -56,2 +55,2 @@
- autovivified_module = cref[0].const_set(cref[1], Module.new)
- cpath = autovivified_module.name
+ implicit_namespace = cref.set(Module.new)
+ cpath = implicit_namespace.name
@@ -68 +67 @@
- on_namespace_loaded(autovivified_module)
+ on_namespace_loaded(implicit_namespace)
@@ -70 +69 @@
- run_on_load_callbacks(cpath, autovivified_module, dir) unless on_load_callbacks.empty?
+ run_on_load_callbacks(cpath, implicit_namespace, dir) unless on_load_callbacks.empty?
lib/zeitwerk/loader/eager_load.rb
--- /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.13/lib/zeitwerk/loader/eager_load.rb 2024-08-01 02:40:48.552818321 +0000
+++ /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.17/lib/zeitwerk/loader/eager_load.rb 2024-08-01 02:40:48.556818371 +0000
@@ -64,2 +64,2 @@
- return unless cdef?(namespace, cname)
- namespace = cget(namespace, cname)
+ return unless namespace.const_defined?(cname, false)
+ namespace = namespace.const_get(cname, false)
@@ -148 +148 @@
- namespace = cget(namespace, cname)
+ namespace = namespace.const_get(cname, false)
@@ -153 +153 @@
- cget(namespace, base_cname)
+ namespace.const_get(base_cname, false)
@@ -167,4 +167,2 @@
- while to_eager_load = queue.shift
- dir, namespace = to_eager_load
-
- ls(dir) do |basename, abspath|
+ while (current_dir, namespace = queue.shift)
+ ls(current_dir) do |basename, abspath, ftype|
@@ -173 +171 @@
- if ruby?(abspath)
+ if ftype == :file
@@ -175 +173 @@
- cget(*cref)
+ cref.get
@@ -182 +180 @@
- queue << [abspath, cget(namespace, cname)]
+ queue << [abspath, namespace.const_get(cname, false)]
@@ -212,3 +210,3 @@
- while dir = dirs.shift
- ls(dir) do |basename, abspath|
- next unless dir?(abspath)
+ while (dir = dirs.shift)
+ ls(dir) do |basename, abspath, ftype|
+ next unless ftype == :directory
lib/zeitwerk/loader/helpers.rb
--- /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.13/lib/zeitwerk/loader/helpers.rb 2024-08-01 02:40:48.552818321 +0000
+++ /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.17/lib/zeitwerk/loader/helpers.rb 2024-08-01 02:40:48.556818371 +0000
@@ -33 +33,7 @@
- next if !has_at_least_one_ruby_file?(abspath)
+
+ if !has_at_least_one_ruby_file?(abspath)
+ log("directory #{abspath} is ignored because it has no Ruby files") if logger
+ next
+ end
+
+ ftype = :directory
@@ -35,0 +42 @@
+ ftype = :file
@@ -40 +47 @@
- yield basename, abspath.freeze
+ yield basename, abspath.freeze, ftype
@@ -43,0 +51,4 @@
+ # Looks for a Ruby file using breadth-first search. This type of search is
+ # important to list as less directories as possible and return fast in the
+ # common case in which there are Ruby files.
+ #
@@ -48,2 +59,9 @@
- while dir = to_visit.shift
- ls(dir) do |_basename, abspath|
+ while (dir = to_visit.shift)
+ children = Dir.children(dir)
+
+ children.each do |basename|
+ next if hidden?(basename)
+
+ abspath = File.join(dir, basename)
+ next if ignored_path?(abspath)
+
@@ -51 +69 @@
- to_visit << abspath
+ to_visit << abspath unless roots.key?(abspath)
@@ -53 +71 @@
- return true
+ return true if ruby?(abspath)
@@ -85,58 +103 @@
- # --- Constants ---------------------------------------------------------------------------------
-
- # The autoload? predicate takes into account the ancestor chain of the
- # receiver, like const_defined? and other methods in the constants API do.
- #
- # For example, given
- #
- # class A
- # autoload :X, "x.rb"
- # end
- #
- # class B < A
- # end
- #
- # B.autoload?(:X) returns "x.rb".
- #
- # We need a way to strictly check in parent ignoring ancestors.
- #
- # @sig (Module, Symbol) -> String?
- if method(:autoload?).arity == 1
- private def strict_autoload_path(parent, cname)
- parent.autoload?(cname) if cdef?(parent, cname)
- end
- else
- private def strict_autoload_path(parent, cname)
- parent.autoload?(cname, false)
- end
- end
-
- # @sig (Module, Symbol) -> String
- if Symbol.method_defined?(:name)
- # Symbol#name was introduced in Ruby 3.0. It returns always the same
- # frozen object, so we may save a few string allocations.
- private def cpath(parent, cname)
- Object == parent ? cname.name : "#{real_mod_name(parent)}::#{cname.name}"
- end
- else
- private def cpath(parent, cname)
- Object == parent ? cname.to_s : "#{real_mod_name(parent)}::#{cname}"
- end
- end
-
- # @sig (Module, Symbol) -> bool
- private def cdef?(parent, cname)
- parent.const_defined?(cname, false)
- end
-
- # @raise [NameError]
- # @sig (Module, Symbol) -> Object
- private def cget(parent, cname)
- parent.const_get(cname, false)
- end
-
- # @raise [NameError]
- # @sig (Module, Symbol) -> Object
- private def crem(parent, cname)
- parent.__send__(:remove_const, cname)
- end
+ # --- Inflection --------------------------------------------------------------------------------
lib/zeitwerk/version.rb
--- /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.13/lib/zeitwerk/version.rb 2024-08-01 02:40:48.552818321 +0000
+++ /tmp/d20240801-2090-cwobx9/zeitwerk-2.6.17/lib/zeitwerk/version.rb 2024-08-01 02:40:48.556818371 +0000
@@ -4 +4 @@
- VERSION = "2.6.13"
+ VERSION = "2.6.17" |
dependabot
bot
force-pushed
the
dependabot/bundler/html-pipeline-3.2.1
branch
3 times, most recently
from
August 10, 2024 17:30
4a5d4b0
to
41c68e5
Compare
Bumps [html-pipeline](https://github.com/gjtorikian/html-pipeline) from 3.0.3 to 3.2.1. - [Release notes](https://github.com/gjtorikian/html-pipeline/releases) - [Changelog](https://github.com/gjtorikian/html-pipeline/blob/main/CHANGELOG.md) - [Commits](gjtorikian/html-pipeline@v3.0.3...v3.2.1) --- updated-dependencies: - dependency-name: html-pipeline dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
dependabot
bot
force-pushed
the
dependabot/bundler/html-pipeline-3.2.1
branch
from
August 10, 2024 17:32
41c68e5
to
a8632c0
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bumps html-pipeline from 3.0.3 to 3.2.1.
Release notes
Sourced from html-pipeline's releases.
Changelog
Sourced from html-pipeline's changelog.
Commits
4a16827
doh6539f77
Merge pull request #409 from gjtorikian/release/v3.2.1e9e0481
[skip test] update changelog9dd46be
Merge pull request #408 from gjtorikian/why-double93b8a78
update publisha6d7c0a
lintf52c431
💎 3.2.1b4fc101
stop running sanitization twice9332008
highlight sanitization in testb074163
explain this betterYou can trigger a rebase of this PR by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)