From f9121b2cf28c6e069599c7b7893d7ae2cf100880 Mon Sep 17 00:00:00 2001 From: Chris LaRose Date: Thu, 8 Feb 2024 05:13:28 +0000 Subject: [PATCH 1/2] Raise an error on unexpected platform --- lib/bundix.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bundix.rb b/lib/bundix.rb index b0d45e9..20c6710 100755 --- a/lib/bundix.rb +++ b/lib/bundix.rb @@ -80,7 +80,7 @@ def groups(spec, dep_cache) def platforms(spec, dep_cache) # c.f. Bundler::CurrentRuby platforms = dep_cache.fetch(spec.name).platforms.map do |platform_name| - PLATFORM_MAPPING[platform_name.to_s] + PLATFORM_MAPPING.fetch platform_name.to_s end.flatten {platforms: platforms} From 48cb83464cb6da3d6fd26426d671b062afc7efcc Mon Sep 17 00:00:00 2001 From: Chris LaRose Date: Thu, 8 Feb 2024 05:13:59 +0000 Subject: [PATCH 2/2] Add support for platform "windows" Based on the mapping provided by https://github.com/rubygems/rubygems/blob/8c98dbf1b1f6005b4e0343999d7fd556428fa0c2/bundler/lib/bundler/rubygems_ext.rb#L208 --- lib/bundix.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/bundix.rb b/lib/bundix.rb index 20c6710..18ef4c9 100755 --- a/lib/bundix.rb +++ b/lib/bundix.rb @@ -68,6 +68,7 @@ def groups(spec, dep_cache) "mingw" => [{engine: "mingw"}], "truffleruby" => [{engine: "ruby"}], "x64_mingw" => [{engine: "mingw"}], + "windows" => [{engine: "mswin"}, {engine: "mswin64"}, {engine: "mingw"}], }.each do |name, list| PLATFORM_MAPPING[name] = list %w(1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6).each do |version|