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

Extend ErbTemplateHelper with trim_mode parameter #11144

Merged
merged 1 commit into from
Feb 17, 2018

Conversation

krin-san
Copy link
Contributor

@krin-san krin-san commented Dec 7, 2017

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

Current implementation of ErbTemplateHelper doesn't allow to pass trim_mode parameter to Erb initializer. It makes this class impossible to use with more or less advanced erb files eliminating empty lines. There is a workaround - Erb trim_mode could be defined globally, but it's not the way I'd like to follow.

A simple test is added to check if trim_mode parameter are actually used. Other tests in the same file was slightly changed to keep file syntax consistent.

Description

ErbTemplateHelper now have a new parameter - trim_mode - which is passed to ErbalT object and then passed to Erb initializer.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@googlebot
Copy link

CLAs look good, thanks!

@janpio
Copy link
Member

janpio commented Feb 16, 2018

Hi @krin-san, looks good.

Totally naive question: Where is this code actually used? When would you actually use this new option?

@krin-san
Copy link
Contributor Author

@janpio, already using it on few our projects to generate email messages for release candidates. Without this trim_mode option it looks impossible to keep template file readable while preserving empty lines where they needs to be.

p.s.: I even forgot about this PR - so old it is

Copy link
Member

@janpio janpio left a comment

Choose a reason for hiding this comment

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

Yeah, then let's just merge this.

Copy link
Member

@janpio janpio left a comment

Choose a reason for hiding this comment

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

Yeah, then let's just merge this.

@janpio janpio merged commit 1fa96a6 into fastlane:master Feb 17, 2018
@fastlane-bot
Copy link

Hey @krin-san 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀

@fastlane-bot
Copy link

Congratulations! 🎉 This was released as part of fastlane 2.82.0 🚀

@fastlane fastlane locked and limited conversation to collaborators Apr 24, 2018
@krin-san krin-san deleted the feature/erb_trim_mode branch September 10, 2019 11:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants