Skip to content

Commit 2b3c783

Browse files
mikolalysenkoclaude
andcommitted
feat: unflag Ruby gem support and add e2e bundler tests
Remove the `gem` feature flag so Ruby gem support is always compiled in, matching npm and PyPI which are already default-on. This ensures gem support ships in every release binary built with `cargo build --release`. - Remove `gem = []` from both Cargo.toml feature sections - Remove all `#[cfg(feature = "gem")]` gates from crawler module, Ecosystem enum, PURL functions, and ecosystem dispatch - Rewrite e2e_gem.rs with full bundler lifecycle tests targeting activestorage@5.2.0 (CVE-2022-21831) with 3-file hash verification - Add Ruby 3.2 setup step in CI for e2e_gem suite - Update READMEs to reflect gem as default, not feature-flagged Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 90c5fb6 commit 2b3c783

11 files changed

Lines changed: 383 additions & 51 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,12 @@ jobs:
120120
with:
121121
python-version: "3.12"
122122

123+
- name: Setup Ruby
124+
if: matrix.suite == 'e2e_gem'
125+
uses: ruby/setup-ruby@v1
126+
with:
127+
ruby-version: '3.2'
128+
bundler-cache: false
129+
123130
- name: Run e2e tests
124131
run: cargo test -p socket-patch-cli --all-features --test ${{ matrix.suite }} -- --ignored

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ cargo install socket-patch-cli
6666
By default this builds with npm and PyPI support. For additional ecosystems:
6767

6868
```bash
69-
cargo install socket-patch-cli --features cargo,golang,maven,gem,composer,nuget
69+
cargo install socket-patch-cli --features cargo,golang,maven,composer,nuget
7070
```
7171

7272
## Quick Start

crates/socket-patch-cli/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ tempfile = { workspace = true }
2626
[features]
2727
default = []
2828
cargo = ["socket-patch-core/cargo"]
29-
gem = ["socket-patch-core/gem"]
3029
golang = ["socket-patch-core/golang"]
3130
maven = ["socket-patch-core/maven"]
3231
composer = ["socket-patch-core/composer"]

crates/socket-patch-cli/src/ecosystem_dispatch.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use std::path::PathBuf;
77

88
#[cfg(feature = "cargo")]
99
use socket_patch_core::crawlers::CargoCrawler;
10-
#[cfg(feature = "gem")]
1110
use socket_patch_core::crawlers::RubyCrawler;
1211
#[cfg(feature = "golang")]
1312
use socket_patch_core::crawlers::GoCrawler;
@@ -141,7 +140,6 @@ pub async fn find_packages_for_purls(
141140
}
142141

143142
// gem
144-
#[cfg(feature = "gem")]
145143
if let Some(gem_purls) = partitioned.get(&Ecosystem::Gem) {
146144
if !gem_purls.is_empty() {
147145
let ruby_crawler = RubyCrawler;
@@ -323,7 +321,6 @@ pub async fn crawl_all_ecosystems(
323321
all_packages.extend(cargo_packages);
324322
}
325323

326-
#[cfg(feature = "gem")]
327324
{
328325
let ruby_crawler = RubyCrawler;
329326
let gem_packages = ruby_crawler.crawl_all(options).await;
@@ -468,7 +465,6 @@ pub async fn find_packages_for_rollback(
468465
}
469466

470467
// gem
471-
#[cfg(feature = "gem")]
472468
if let Some(gem_purls) = partitioned.get(&Ecosystem::Gem) {
473469
if !gem_purls.is_empty() {
474470
let ruby_crawler = RubyCrawler;

0 commit comments

Comments
 (0)