Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use AST::Processor::Mixin instead of deprecated AST::Processor #1000

Merged
merged 1 commit into from Mar 16, 2024

Conversation

koic
Copy link
Collaborator

@koic koic commented Mar 16, 2024

This PR uses AST::Processor::Mixin instead of deprecated AST::Processor API:

# This class includes {AST::Processor::Mixin}; however, it is
# deprecated, since the module defines all of the behaviors that
# the processor includes.  Any new libraries should use
# {AST::Processor::Mixin} instead of subclassing this.
#
# @deprecated Use {AST::Processor::Mixin} instead.

https://github.com/whitequark/ast/blob/v2.4.2/lib/ast/processor.rb#L2-L7

There is an imcompatibility where the inheritance no longer includes AST::Processor, but the impact is expected to be negligible.

This PR uses `AST::Processor::Mixin` instead of deprecated `AST::Processor` API:

```ruby
# This class includes {AST::Processor::Mixin}; however, it is
# deprecated, since the module defines all of the behaviors that
# the processor includes.  Any new libraries should use
# {AST::Processor::Mixin} instead of subclassing this.
#
# @deprecated Use {AST::Processor::Mixin} instead.
```

https://github.com/whitequark/ast/blob/v2.4.2/lib/ast/processor.rb#L2-L7

There is an imcompatibility where the inheritance no longer includes `AST::Processor`,
but the impact is expected to be negligible.
@iliabylich iliabylich merged commit 76a704c into whitequark:master Mar 16, 2024
9 checks passed
@iliabylich
Copy link
Collaborator

Makes sense, thanks!

stanhu added a commit to stanhu/inspec that referenced this pull request Apr 26, 2024
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
stanhu added a commit to stanhu/inspec that referenced this pull request Apr 26, 2024
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

Signed-off-by: Stan Hu <stanhu@gmail.com>
stanhu added a commit to stanhu/inspec that referenced this pull request Apr 30, 2024
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` instead.

Closes inspec#7029

Signed-off-by: Stan Hu <stanhu@gmail.com>
stanhu added a commit to stanhu/inspec that referenced this pull request Apr 30, 2024
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` instead.

Closes inspec#7029

Signed-off-by: Stan Hu <stanhu@gmail.com>
ahasunos pushed a commit to inspec/inspec that referenced this pull request May 2, 2024
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` instead.

Closes #7029

Signed-off-by: Stan Hu <stanhu@gmail.com>
ahasunos pushed a commit to inspec/inspec that referenced this pull request May 2, 2024
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` instead.

Closes #7029

Signed-off-by: Stan Hu <stanhu@gmail.com>
ahasunos added a commit to inspec/inspec that referenced this pull request May 2, 2024
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` instead.

Closes #7029

Signed-off-by: Stan Hu <stanhu@gmail.com>
Co-authored-by: Stan Hu <stanhu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants