Refaktoring 🚑
Wewcome fwiends of wefactowing!
This week was all about improving the quality of our project! We are continuously striving to design our software with the highest possible standards, and this week was no exception. We invested some serious time into refactoring the RALF-Engine and the `actions/regex-replace` Action. ]
You can view the document in which we described the code smells we had in our code base here (sad/REFACTORING).
Get RALF P’s stories in your inbox
Join Medium for free to get updates from this writer.
The change in the action we made was to enable multiple replacement maps that could be specified. This not only increases the readability of our code, but also the readability of your RALF-definitions (also called “Flows”) but also allows us to increase the extensibility of our project. The before and after code snippets highlight the improvements we have made.
# BEFORE:
- do: actions/regex-replace
with:
in: [ "summary" ]
match: "[rl]"
replace: "w"
- do: actions/regex-replace
with:
in: [ "summary" ]
match: "[RL]"
replace: "W"
# AFTER:
- do: actions/regex-replace
with:
in: [ "summary" ]
map:
- match: "[rl]"
replace: "w"
- match: "[RL]"
replace: "W"We’ve also made changes to the default behavior of the regex-replace-Action regarding case-sensitivity. Now, case-sensitivity is checked by default.
In addition, we are very excited to announce the arrival of a new un-offical companion: today — an iCal-Viewer for the CLI with native RALF support 🥳! Which means you can locally use and test your RALF-definitions. With all these changes, we have laid the groundwork for accelerated development and improved design in the future.
That’s i-it fow ouw today’s bwog post. *cries* See you aww nyext week?!! 😹😹😹😹😹😹😹😹😹😹😹😹😹😹😹😹😹😹😹
“They say that with great power comes great responsibility. With RALF, I feel like I have the power to modify time itself! Okay, maybe not, but it’s still pretty cool.” - Spooder-Man, The Dark RALF Rises, 2012






