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

Fix map_headers when headers have the same prefix #1598

Merged
merged 5 commits into from
Dec 27, 2021

Conversation

valerianb
Copy link
Contributor

@valerianb valerianb commented Dec 21, 2021

Description

Fixes #1450

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • Tests have been added for any changes to behaviour of the code
  • New and existing tests are passing locally and on CI
  • bundle exec rubocop reports no offenses
  • RDoc comments have been updated
  • CHANGELOG.md has been updated

@luke-hill
Copy link
Contributor

RtM pending CI.

Copy link
Contributor

@aurelien-reeves aurelien-reeves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@@ -492,7 +492,7 @@ def convert_headers! # :nodoc:
end

@header_mappings.each_pair do |pre, post|
mapped_cells = header_cells.reject { |cell| cell.value.match(pre).nil? }
mapped_cells = header_cells.reject { |cell| pre.is_a?(Regexp) ? cell.value.match(pre).nil? : cell.value != pre }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an opportunity to use #match? ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done :)

@aurelien-reeves aurelien-reeves merged commit 8040625 into cucumber:main Dec 27, 2021
@aslakhellesoy
Copy link
Contributor

Hi @valerianb,

Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾

In return for this generous offer we hope you will:

  • ✅ Continue to use branches and pull requests. When someone on the core team approves a pull request (yours or someone else's), you're welcome to merge it yourself.
  • 💚 Commit to setting a good example by following and upholding our code of conduct in your interactions with other collaborators and users.
  • 💬 Join the community Slack channel to meet the rest of the team and make yourself at home.
  • ℹ️ Don't feel obliged to help, just do what you can if you have the time and the energy.
  • 🙋 Ask if you need anything. We're looking for feedback about how to make the project more welcoming, so please tell us!

On behalf of the Cucumber core team,
Aslak Hellesøy
Creator of Cucumber

@aurelien-reeves
Copy link
Contributor

Great work, thanks for your contribution @valerianb 🙏

@valerianb
Copy link
Contributor Author

Thanks all for your reviews and welcoming me here.

@valerianb valerianb deleted the fix-1450 branch December 27, 2021 14:32
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.

Cannot map datatable headers if one header is a prefix of another
5 participants