Skip to content

Commit

Permalink
Fix uninitialized constant Parser::AST::Processor::Mixin
Browse files Browse the repository at this point in the history
parser 3.3.1.0 introduced
whitequark/parser#1000, which causes this
failure:

```
% bundle exec ruby -Itest test/unit/profiles/profile_test.rb
inspec/lib/inspec/utils/profile_ast_helpers.rb:7:in `<class:CollectorBase>': uninitialized constant Parser::AST::Processor::Mixin (NameError)

        include Parser::AST::Processor::Mixin
                                      ^^^^^^^
```

Fix this by inherting from `Parser::AST::Processor` and
requiring the right version of the `parser` gem.

Closes inspec#7029
  • Loading branch information
stanhu committed Apr 26, 2024
1 parent f482fd0 commit d459348
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inspec.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ Source code obtained from the Chef GitHub repository is made available under Apa
spec.add_dependency "train-kubernetes", "~> 0.1"

spec.add_dependency "mongo", "= 2.13.2" # 2.14 introduces a broken symlink in mongo-2.14.0/spec/support/ocsp

spec.add_dependency "parser", ">= 3.3.1.0" # 3.3.1.0 removed a mix-in
end
3 changes: 1 addition & 2 deletions lib/inspec/utils/profile_ast_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
module Inspec
class Profile
class AstHelper
class CollectorBase
include Parser::AST::Processor::Mixin
class CollectorBase < Parser::AST::Processor
include RuboCop::AST::Traversal

attr_reader :memo
Expand Down

0 comments on commit d459348

Please sign in to comment.