Skip to content

Commit cd72e20

Browse files
martinemdeivy
andauthored
Don't raise when we can't find a Gemfile (#48)
* 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. * Bump patchlevel to 0.26.1 for bundler fix * Update lib/parse_packwerk/configuration.rb Co-authored-by: Ivy Evans <[email protected]> --------- Co-authored-by: Ivy Evans <[email protected]>
1 parent 5399a93 commit cd72e20

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
parse_packwerk (0.26.0)
4+
parse_packwerk (0.26.1)
55
bigdecimal
66
sorbet-runtime
77

lib/parse_packwerk/configuration.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ def self.excludes(config_hash)
3737
Array(specified_exclude)
3838
end
3939

40-
excludes.push Bundler.bundle_path.join('**').to_s
40+
begin
41+
excludes.push Bundler.bundle_path.join('**').to_s
42+
rescue Bundler::GemfileNotFound
43+
# Optionally, add bundle to the path. Skip when there isn't a Gemfile.
44+
end
45+
46+
excludes
4147
end
4248

4349
sig { params(config_hash: T::Hash[T.untyped, T.untyped]).returns(T::Array[String]) }

parse_packwerk.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |spec|
22
spec.name = 'parse_packwerk'
3-
spec.version = '0.26.0'
3+
spec.version = '0.26.1'
44
spec.authors = ['Gusto Engineers']
55
spec.email = ['[email protected]']
66
spec.summary = 'A low-dependency gem for parsing and writing packwerk YML files'

0 commit comments

Comments
 (0)