Skip to content

Commit

Permalink
[Fix #12848] Fix an error for RuboCop::Lockfile
Browse files Browse the repository at this point in the history
Fixes #12848.

This PR fixes an error that occurs in `RuboCop::Lockfile`
when the constant Bundler is uninitialized.
  • Loading branch information
koic authored and bbatsov committed Apr 19, 2024
1 parent 74037d9 commit c30838d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/fix_error_for_rubocop_lockfile.md
@@ -0,0 +1 @@
* [#12848](https://github.com/rubocop/rubocop/issues/12848): Fix an error that occurs in `RuboCop::Lockfile` when the constant Bundler is uninitialized. ([@koic][])
2 changes: 1 addition & 1 deletion lib/rubocop/lockfile.rb
Expand Up @@ -60,7 +60,7 @@ def includes_gem?(name)
def parser
return @parser if defined?(@parser)

@parser = if @lockfile_path
@parser = if @lockfile_path && bundler_lock_parser_defined?
begin
lockfile = ::Bundler.read_file(@lockfile_path)
::Bundler::LockfileParser.new(lockfile) if lockfile
Expand Down

0 comments on commit c30838d

Please sign in to comment.