-
-
Notifications
You must be signed in to change notification settings - Fork 518
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
grep: New exercise #948
grep: New exercise #948
Conversation
- The files are hardcoded in the test template because I couldn't easily pass new variables from the test case to the ERB test template - Solution based on the solution on the Python track
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of it looks 'generally' good to me.
I noticed the conflglet failure as well as reported by Travis CI. I may have some time to look at the file name problem indicated as well as the configlet issue, if someone doesn't beat me to it, or already have some ideas. |
Yes, I noted above that before merging we need to add this exercise to
Not sure what file name problem you're referring to 🤔 |
I think it was corrected... so that part is good to go. |
It should be somewhere at the end of the track. The file reading is a feature above 'level 3'. And moreover, it's also not the simplest form of reading a file. And it's also totally new. I'd say: let's make it So, it starts as a side, so the mentors can play with it first, and we can come up with mentor notes. Looking sooooooooo forward to trying this :-)))) |
But I beseech your grace that I may know | ||
The worst that may befall me in this case, | ||
EXPECTED | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking TDD, would it make sense to put all the no-flags tests at the beginning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order is defined by the canonical data. Do we want to go against that? (It may be worth considering opening a PR on the problem-specifications repo if you feel strongly about changing the order everywhere).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, no, we don't want to go against that. And as the TDD sequence may differ from language to language, I don't think it's worth to change it in the prob-specs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks marvellous :-)
I'll leave the technical details to Victor to review.
Thanks so much @pgaspar, for yet another exercise 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good enough. We can always make improvements and changes later.
Let's get it in! ;)
Thank you both! |
Closes #946.
Implementation
The implementation was heavily influenced by python's. It can certainly be improved, but we may want to leave that for the mentor notes themselves, since the main goal here is to get CI to pass.
Test Generation
The tests are generated using the canonical data, but the file contents are hardcoded in a custom test template. I ended up doing this because I couldn't easily pass custom variables from the test case file to the ERB test template. Without that I can't parse the canonical data comments and make the file contents dynamic, like some tracks do.
I couldn't find other exercises that did anything close to this and looking at the generator code I didn't find a clear way to pass a
file_data
hash to the template file.Note: I really want to merge #929... Having the generator writeWe've merged this and I updated the code 👍.<<-EXPECTED.gsub(/^ */, '').strip
instead of<<~EXPECTED
on the test file adds a layer of extra complexity we could easily avoid.@exercism/ruby
TODO
config.json