Question: Reusing script utils?
See original GitHub issueHey guys, what would be the best way to extract some common utils (things like extension methods, helpers, etc.) for reuse without having to build a true add-in?
I’m trying to refactor a Cake script that’s getting a bit too complex for my comfort, so I’m looking for ways to pull common behavior out into other “util” script files that I can reference from my main Cake script.
It looks like #load ./utils/MyHelpers.cake
seems to work, and I can define classes and methods there, so that’s nice. Unfortunately it doesn’t work for extension methods, which is what I’d really prefer for a lot of these kinds of things, for fluency’s sake.
Any ideas? Might it be possible to pull in other referenced files as CakeAliases?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:18 (14 by maintainers)
Top Results From Across the Web
Postman:how to set up library of (semi-)complicated ...
The test script will successfully print to console "I am a utility function". I've seen people do more complicated things where, if they...
Read more >How to write a reusable script Library
1) Define a new TestSuite in the root of your project called Library. · 2) Disable the Library TestSuite so that it doesn't...
Read more >Grumpy chronicles: The question of utils - tonsky.me
Grumpy chronicles: The question of utils. This is an ongoing mini-series of lessons learned from writing a tiny blog engine in Clojure.
Read more >apex - ANY documentation on writing reusable code?
Updated Answer: What you have described in your updated question is indeed behaviour or process around your Equipement object, ...
Read more >Create reusable tests and scripts with OpenAPI ...
Learn a creative way to store reusable scripts and tests in an OpenAPI definition, which can be retrieved on demand with the Postman...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@MiguelAlho: My memory is a little hazy on where my team really landed with this. I think we just used the
.Init()
approach for a while since we already had it working, but we ultimately moved to React Native so Cake became irrelevant. Sorry I’m not more help.You might also be interested to check out FAKE.
@MiguelAlho Checkout Cake.Recipe. You can create a similar approach for an internal shared script library, which can be reused across multiple repositories.