From 5240a649aa46fd2bbfff0ba2e2d8f3109b5391e6 Mon Sep 17 00:00:00 2001 From: Martin Emde Date: Wed, 16 Apr 2025 12:14:25 -0700 Subject: [PATCH 1/3] Handle the case where we can't find a Gemfile without raising This fixes tests in query_packwerk when run without bundle exec. Usually this sort of thing is not an issue, so fixing it here prevents it from causing problem unnecessarily. --- lib/parse_packwerk/configuration.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/parse_packwerk/configuration.rb b/lib/parse_packwerk/configuration.rb index 5cd260a..a7c7ac6 100644 --- a/lib/parse_packwerk/configuration.rb +++ b/lib/parse_packwerk/configuration.rb @@ -37,7 +37,13 @@ def self.excludes(config_hash) Array(specified_exclude) end - excludes.push Bundler.bundle_path.join('**').to_s + begin + excludes.push Bundler.bundle_path.join('**').to_s + rescue Bundler::GemfileNotFound + # Not using a Gemfile, so we can't add the bundle path. + end + + excludes end sig { params(config_hash: T::Hash[T.untyped, T.untyped]).returns(T::Array[String]) } From 79d3235bb26df582513a5484af412e87a98fce81 Mon Sep 17 00:00:00 2001 From: Martin Emde Date: Wed, 16 Apr 2025 12:25:55 -0700 Subject: [PATCH 2/3] Bump patchlevel to 0.26.1 for bundler fix --- Gemfile.lock | 2 +- parse_packwerk.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 428e9e5..1b3a486 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - parse_packwerk (0.26.0) + parse_packwerk (0.26.1) bigdecimal sorbet-runtime diff --git a/parse_packwerk.gemspec b/parse_packwerk.gemspec index 6c9e2ab..491b4a6 100644 --- a/parse_packwerk.gemspec +++ b/parse_packwerk.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = 'parse_packwerk' - spec.version = '0.26.0' + spec.version = '0.26.1' spec.authors = ['Gusto Engineers'] spec.email = ['dev@gusto.com'] spec.summary = 'A low-dependency gem for parsing and writing packwerk YML files' From b4806c7a205a68efd3ab3ce42484490bc05123e9 Mon Sep 17 00:00:00 2001 From: Martin Emde Date: Wed, 16 Apr 2025 17:15:13 -0700 Subject: [PATCH 3/3] Update lib/parse_packwerk/configuration.rb Co-authored-by: Ivy Evans --- lib/parse_packwerk/configuration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parse_packwerk/configuration.rb b/lib/parse_packwerk/configuration.rb index a7c7ac6..e288421 100644 --- a/lib/parse_packwerk/configuration.rb +++ b/lib/parse_packwerk/configuration.rb @@ -40,7 +40,7 @@ def self.excludes(config_hash) begin excludes.push Bundler.bundle_path.join('**').to_s rescue Bundler::GemfileNotFound - # Not using a Gemfile, so we can't add the bundle path. + # Optionally, add bundle to the path. Skip when there isn't a Gemfile. end excludes