diff --git a/pkgs/development/ruby-modules/bundler-env/functions.nix b/pkgs/development/ruby-modules/bundler-env/functions.nix index 5a51f4d8208..d9f02324cc2 100644 --- a/pkgs/development/ruby-modules/bundler-env/functions.nix +++ b/pkgs/development/ruby-modules/bundler-env/functions.nix @@ -4,12 +4,10 @@ rec { platformMatches = {rubyEngine, version, ...}@ruby: attrs: ( !(attrs ? "platforms") || - builtins.trace "ruby engine: ${rubyEngine}" - builtins.trace "ruby version ${version.majMin}" + builtins.length attrs.platforms == 0 || builtins.any (platform: - builtins.trace "checking: ${platform.engine}/${platform.version}" platform.engine == rubyEngine && - (!(platform ? "version") || platform.version == version.majMin) + (!(platform ? "version") || platform.version.majMin == version.majMin) ) attrs.platforms ); diff --git a/pkgs/development/ruby-modules/bundler-env/test.nix b/pkgs/development/ruby-modules/bundler-env/test.nix index af3d81d483d..c3de862f153 100644 --- a/pkgs/development/ruby-modules/bundler-env/test.nix +++ b/pkgs/development/ruby-modules/bundler-env/test.nix @@ -41,6 +41,9 @@ let ( let gemSet = { test = { groups = ["x" "y"]; }; }; in test.run "Filter matches a group" gemSet (set: functions.filterGemset {inherit ruby; groups = ["y" "z"];} set == gemSet)) + ( let gemSet = { test = { platforms = []; }; }; + in + test.run "Filter matches empty platforms list" gemSet (set: functions.filterGemset {inherit ruby; groups = [];} set == gemSet)) ( let gemSet = { test = { platforms = [{engine = ruby.rubyEngine; version = ruby.version;}]; }; }; in test.run "Filter matches on platform" gemSet (set: functions.filterGemset {inherit ruby; groups = [];} set == gemSet))