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

Update AmazingPrint::MongoMapper for frozen strings #44

Merged
merged 2 commits into from
Jun 15, 2020

Conversation

HarlemSquirrel
Copy link
Member

@HarlemSquirrel HarlemSquirrel commented Jun 15, 2020

I'm not sure how many folks are using mongo_mapper but I noticed a fix was needed here and that specs were not running so I brought them back.

  • Regenerate gemfiles
  • Ignore some Rubocop issues with generated gemfiles

Kevin McCormack added 2 commits June 15, 2020 09:40
Also,
- Regenerate gemfiles
- Ignore some Rubocop issues with generated gemfiles
@HarlemSquirrel HarlemSquirrel changed the title Mongo mapper 20200615 Update AmazingPrint::MongoMapper for frozen strings Jun 15, 2020
@HarlemSquirrel HarlemSquirrel requested a review from paddor June 15, 2020 14:11
Copy link
Contributor

@paddor paddor left a comment

Choose a reason for hiding this comment

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

It looks like the # frozen_string_literal: true have been removed, which AFAIK means, that those string literals aren't frozen anymore. Was that the intention?

@@ -90,7 +90,7 @@ def awesome_mongo_mapper_instance(object)
label = "#{colorize('embedded', :assoc)} #{label}"
end

"#{label} " << awesome_hash(data)
[label, awesome_hash(data)].join(' ')
Copy link
Contributor

Choose a reason for hiding this comment

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

If the String should stay mutable, this should work too: +"#{label} #{awesome_hash(data)}". Up to you which one's more readable.

Copy link
Member Author

Choose a reason for hiding this comment

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

I went back and forth on this one but based on #41 I thought using the same approach everywhere was nice.

@HarlemSquirrel
Copy link
Member Author

@paddor I know the frozen string comments were removed from gemfiles as part of generating with appraisal. I thought this was fine since it's only for testing. Ignoring that and single quotes in Rubocop prevents needing to "correct" the gemfiles after running appraisal generate.

@paddor paddor merged commit d50c6a6 into master Jun 15, 2020
@HarlemSquirrel HarlemSquirrel deleted the mongo_mapper-20200615 branch June 17, 2020 02:06
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.

2 participants