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

Allow multiple before_deploy blocks to be defined #126

Merged
merged 3 commits into from
Sep 21, 2020

Conversation

schneems
Copy link
Contributor

The current behavior of calling before_deploy will replace the existing block. This new behavior allows the end developer more control so they can fire multiple disk modifications if desired.

I'm also deprecating calling before_deploy as a mechanism to delete/replace any previously set block. In the future I'll make the default behavior of calling the block multiple times match before_deploy(:append)

The current behavior of calling `before_deploy` will replace the existing block. This new behavior allows the end developer more control so they can fire multiple disk modifications if desired.

I'm also deprecating calling `before_deploy` as a mechanism to delete/replace any previously set block. In the future I'll make the default behavior of calling the block multiple times match `before_deploy(:append)`
@Malax
Copy link
Member

Malax commented Sep 18, 2020

Do you have a real-world example where this feature is useful? I assume you implemented this because you had a use for it, I'm curious. :)

@schneems
Copy link
Contributor Author

Do you have a real-world example where this feature is useful? I assume you implemented this because you had a use for it, I'm curious. :)

It was originally requested by @dzuelke. One possible use case:

  • You need to add some helper file to all the tests in a file, so you define a before_deploy on them in some sort of a method to reduce duplication
  • Later you realize several of them need further modification, but not all of them. Without this it's possible but tricky to make that work. With this you can tack on additional file modifications without worry for over-writing existing ones.

@schneems schneems merged commit 3e0ee7c into main Sep 21, 2020
@schneems schneems deleted the schneems/multi-before-deploy branch September 21, 2020 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants