Closed davispuh closed 11 years ago
I need to think about this one.
If nothing else, it's an interface change that would require a version bump.
I worry a little about the interplay between these two options, though I haven't yet come up with a specific example of my concerns…
I don't see any issues with this and I think it's correct way with separation, I'm not really sure what other way could be...
Well, I'm considering a total HighLine redesign. One thought is to handle Question
modifiers as Decorators that get added on much like Rack's middleware. I believe this would drastically simplify testing HighLine, which is surely needed.
This is just one idea that I have.
idea is good, but while it's not implemented there's no other choice so this patch is for current design, of course I would love seeing next version, but as we know it will take time and I assume that you've other things to do same as me...
Your change requires a version bump. It's not backwards compatible, since people will have to stop using one option and start using another.
If we have to do that anyway, I would rather get my long desired cleanup out of it. Does that make sense?
go for it ;)
FYI these changes are backward compatible, when completion
isn't specified it will be same as answer_type
, so setting answer_type
will still work same as it's for previous versions. lib/highline/question.rb#L36
If this isn't backwards compatible then why does all tests pass? and I didn't changed any.
I did not notice that. You are right. I apologize.
I think it's quite bad design to mix answer conversion and auto-completion using same variable
answer_type
. So this is a little separation giving more control to app, ie. allowing to enable auto-competition without requiring that answer will be enforced to exact value from array.eg. (user is still allowed to input 'yellow', but can use completion for green)
if
completion
isn't specified it will be same asanswer_type
thus consistent with that it used to be.this also kinda fixes #65, but probably it can be improved with more functionality.